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

com.imsweb.validation.edits.translated.rqrs.RqrsTranslatedCompiledRules.groovy Maven / Gradle / Ivy

package com.imsweb.validation.edits.translated.rqrs

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

@CompileStatic
class RqrsTranslatedCompiledRules implements CompiledRules {

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

    @Override
    public String getValidatorVersion() {
        return 'RQRS-001-01'
    }

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

    // ID: RQRS-00001; TAG: N0148; NAME: Abstracted By (COC)
    public boolean rqrs00001(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: RQRS-00002; TAG: N0360; NAME: Abstracted By, Date of Diagnosis (COC)
    public boolean rqrs00002(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00003; TAG: N0551; NAME: Accession Number, Class of Case, Seq Number (COC)
    public boolean rqrs00003(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.RQRS_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.RQRS_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.RQRS_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.sequenceNumberHosp, "00,01,60,61")) {
                if (dx_year < 1996) {
                    if (functions.GEN_VAL(ac_yy) < dx_year) {
                        functions.GEN_SAVE_TEXT(binding, 'essag')
                        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, 'essag')
                        return false
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "00,01,60,61")) {
                if ((functions.GEN_VAL(ac_yy) != dofc_year) || (dolc_year != dofc_year)) {
                    functions.GEN_SAVE_TEXT(binding, 'essag')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
            if (!functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "00,01,60,61")) {
                if (dolc_year != dofc_year) {
                    functions.GEN_SAVE_TEXT(binding, 'essag')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00004; TAG: N0034; NAME: Accession Number--Hosp (COC)
    public boolean rqrs00004(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: RQRS-00005; TAG: N0037; NAME: Addr at DX--City (COC)
    public boolean rqrs00005(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.addressAtDxCity))
            return true
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addressAtDxCity), context.RQRS_CITY_SPC, context.RQRS_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addressAtDxCity, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addressAtDxCity, 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.addressAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: RQRS-00006; TAG: N0341; NAME: Addr at DX--City, Date of Diagnosis (COC)
    public boolean rqrs00006(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxCity))
                return false
        }
        return true

    }

    // ID: RQRS-00007; TAG: N1680; NAME: Addr at DX--Country (COC)
    public boolean rqrs00007(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.addressAtDxCountry, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00008; TAG: N1681; NAME: Addr at DX--Country, Date of Diagnosis (COC)
    public boolean rqrs00008(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxCountry))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Addr at DX--Country cannot be ${untrimmedline.addressAtDxCountry} if Date of Diagnosis is greater than 2012')
        
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00009; TAG: N1699; NAME: Addr at DX--Country, State (NAACCR)
    public boolean rqrs00009(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.addressAtDxCountry) || functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        functions.GEN_STRCPY(cntry_state, untrimmedline.addressAtDxCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.addressAtDxState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00011; TAG: N0349; NAME: Addr at DX--Postal Code, Addr at DX--State (COC)
    public boolean rqrs00011(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AA,AE,AP"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "88888, 888888888")) {
            if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999, 999999, 999999999")) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "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.addressAtDxPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999,999999,999999999"))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_MATCH(untrimmedline.addressAtDxPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addressAtDxPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
                return false
        }
        if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addressAtDxPostalCode, 1, 5)) < 10)
            return false
        return true

    }

    // ID: RQRS-00012; TAG: N0334; NAME: Addr at DX--State (COC)
    public boolean rqrs00012(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        return functions.GEN_LOOKUP(untrimmedline.addressAtDxState, context.RQRS_STATE, context.RQRS_STATE_CODE, [:])

    }

    // ID: RQRS-00013; TAG: N0335; NAME: Addr at DX--State, Date of Diagnosis (COC)
    public boolean rqrs00013(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxState))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00015; TAG: N0025; NAME: Age, Birth Date, Date of Diagnosis (NAACCR IF13)
    public boolean rqrs00015(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.ageAtDx, "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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.birthDate)
        
        if (birth_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
        diag_age = functions.GEN_VAL(untrimmedline.ageAtDx)
        
        if (diag_age == 999) {
            if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.RQRS_GEN_DT_EMPTY)))
                return true
            else
                return false
        }
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.RQRS_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.birthDate)
        
        if ((birth_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.RQRS_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.RQRS_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.RQRS_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.birthDate)
        
        if (dx_month == birth_month) {
            if ((dx_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY)) || (birth_day == ((Integer)context.RQRS_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: RQRS-00016; TAG: N0718; NAME: Age, Primary Site, Morph ICDO3--Adult (SEER)
    public boolean rqrs00016(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.morphologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDx)
        
        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.morphologyIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphologyIcdO3, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "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.morphologyIcdO3, "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.morphologyIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "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.morphologyIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

    // ID: RQRS-00017; TAG: N0717; NAME: Age, Primary Site, Morph ICDO3--Pediatric (NPCR)
    public boolean rqrs00017(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.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001)
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDx)
        
        if (agetemp > 14) {
            return true
        }
        if (agetemp < 3) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9650-9667"))
                return false
        }
        if (agetemp > 9 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9490,9500"))
                return false
        }
        if (agetemp > 5 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514"))
                return false
        }
        if (agetemp > 8 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8960,8964"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8963") && functions.GEN_INLIST(untrimmedline.primarySite, "649,809", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 9) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "8312"))
                return false
        }
        if (agetemp > 5 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8970"))
                return false
        }
        if (agetemp < 9) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "8160-8180"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9180-9200"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9220-9230"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "9260") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419,809", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "8380,8381,8441-8473"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "8330-8350"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.histologyIcdO3, "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.behaviorIcdO3, "2"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "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.behaviorIcdO3, "3"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8140") && functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732,9823,9863,9875,9876,9945"))
                return false
        }
        return true

    }

    // ID: RQRS-00018; TAG: N0001; NAME: Age, Primary Site, Morphology ICDO2 (SEER IF15)
    public boolean rqrs00018(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.morphologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDx)
        
        if (agetemp < 15) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphologyIcdO2, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphologyIcdO2, "(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.morphologyIcdO2, "00000-82399,82450-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphologyIcdO2, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "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.morphologyIcdO2, "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.morphologyIcdO2, "9510-9512", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "8960", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 45) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

    // ID: RQRS-00019; TAG: N0741; NAME: Ambiguous Terminology DX (SEER)
    public boolean rqrs00019(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: RQRS-00020; TAG: N0882; NAME: Ambiguous Terminology DX, Date of DX (SEER IF157)
    public boolean rqrs00020(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00021; TAG: N0524; NAME: Archive FIN (COC)
    public boolean rqrs00021(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: RQRS-00022; TAG: N0550; NAME: Archive FIN, Date of Diagnosis (COC)
    public boolean rqrs00022(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00023; TAG: N0331; NAME: Behavior Code ICDO2, Sequence Number--Hosp (COC)
    public boolean rqrs00023(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (((dx_year == ((Integer)context.RQRS_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.sequenceNumberHosp, "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.sequenceNumberHosp, "60-88", "(\\d\\d)"))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00025; TAG: N0238; NAME: Behavior ICDO2 (COC)
    public boolean rqrs00025(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: RQRS-00026; TAG: N0737; NAME: Behavior ICDO2, Behavior ICDO3 (SEER IF115)
    public boolean rqrs00026(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.behaviorIcdO3, "3"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
                return false
        }
        return true

    }

    // ID: RQRS-00027; TAG: N0468; NAME: Behavior ICDO2, Date of Diagnosis (NAACCR)
    public boolean rqrs00027(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00028; TAG: N0469; NAME: Behavior ICDO3 (COC)
    public boolean rqrs00028(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        return functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,2,3")

    }

    // ID: RQRS-00029; TAG: N0467; NAME: Behavior ICDO3, Date of Diagnosis (NAACCR)
    public boolean rqrs00029(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
                return false
        }
        return true

    }

    // ID: RQRS-00030; TAG: N1688; NAME: Birthplace--Country (COC)
    public boolean rqrs00030(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00031; TAG: N1689; NAME: Birthplace--Country, Date of Diagnosis (COC)
    public boolean rqrs00031(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00032; TAG: N1694; NAME: Birthplace--State (COC)
    public boolean rqrs00032(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_STATE, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00033; TAG: N1692; NAME: Birthplace--State, Date of Diagnosis (COC)
    public boolean rqrs00033(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00034; TAG: N0650; NAME: Bladder, RX Hosp--Surg Prim Site, BRM (COC)
    public boolean rqrs00034(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: RQRS-00035; TAG: N0646; NAME: Bladder, RX Summ--Surg Prim Site, BRM (COC)
    public boolean rqrs00035(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: RQRS-00036; TAG: N0088; NAME: Cancer Status (COC)
    public boolean rqrs00036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.cancerStatus, "1,2,9")

    }

    // ID: RQRS-00037; TAG: 37; NAME: Class of Case (NCDB)
    public boolean rqrs00037(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "00,10,11,12,13,14,20,21,22"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00039; TAG: N1119; NAME: Class of Case, Date of 1st Cont, Date of DX (COC)
    public boolean rqrs00039(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "30-32"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOf1stContact, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stContact))
                functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00041; TAG: N0853; NAME: COC Coding Sys--Curr, COC Coding Sys--Orig (COC)
    public boolean rqrs00041(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: RQRS-00042; TAG: N0035; NAME: COC Coding Sys--Current (COC)
    public boolean rqrs00042(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: RQRS-00043; TAG: N0036; NAME: COC Coding Sys--Original (COC)
    public boolean rqrs00043(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: RQRS-00044; TAG: N0581; NAME: COC Coding Sys--Original, Date of Diagnosis (COC)
    public boolean rqrs00044(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00045; TAG: N1762; NAME: Comorbid/Compl 1, Secondary DX 1, Date DX (COC)
    public boolean rqrs00045(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.comorbidComplication1) && functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis1))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00047; TAG: N0504; NAME: Comorbid/Complication 1, Date DX (COC)
    public boolean rqrs00047(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "00000") || functions.GEN_EMPTY(untrimmedline.comorbidComplication1))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'Comorbid/Complication 1 and Date of Diagnosis conflict')
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication1, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return functions.GEN_ERROR_MSG(binding, 'Comorbid/Complication 1 and Date of Diagnosis conflict')
        }
        return true

    }

    // ID: RQRS-00048; TAG: N1480; NAME: Comorbid/Complication 10, Date DX (COC)
    public boolean rqrs00048(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication10))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication10, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00049; TAG: N1471; NAME: Comorbid/Complication 2, Date DX (COC)
    public boolean rqrs00049(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication2))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication2, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication2, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication2, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication2, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00050; TAG: N1473; NAME: Comorbid/Complication 3, Date DX (COC)
    public boolean rqrs00050(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication3))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication3, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication3, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication3, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication3, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00051; TAG: N1474; NAME: Comorbid/Complication 4, Date DX (COC)
    public boolean rqrs00051(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication4))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication4, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication4, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication4, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication4, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00052; TAG: N1475; NAME: Comorbid/Complication 5, Date DX (COC)
    public boolean rqrs00052(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication5))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication5, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication5, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication5, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication5, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00053; TAG: N1476; NAME: Comorbid/Complication 6, Date DX (COC)
    public boolean rqrs00053(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication6))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication6, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication6, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication6, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication6, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00054; TAG: N1477; NAME: Comorbid/Complication 7, Date DX (COC)
    public boolean rqrs00054(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication7))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication7, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication7, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication7, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication7, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00055; TAG: N1478; NAME: Comorbid/Complication 8, Date DX (COC)
    public boolean rqrs00055(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication8))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication8, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication8, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication8, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication8, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00056; TAG: N1479; NAME: Comorbid/Complication 9, Date DX (COC)
    public boolean rqrs00056(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication9))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication9, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication9, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication9, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication9, context.RQRS_ICD9CM, context.RQRS_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

    // ID: RQRS-00057; TAG: 57; NAME: County at DX (COC)
    public boolean rqrs00057(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty))
            return true
        return functions.GEN_MATCH(untrimmedline.addressAtDxCounty, "(\\d\\d\\d)")

    }

    // ID: RQRS-00058; TAG: 58; NAME: County at DX, Addr at DX--State (NAACCR)
    public boolean rqrs00058(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cnty_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty) || functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "CD,US,XX,YY,ZZ"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AA,AE,AP"))
            return true
        functions.GEN_STRCPY(cnty_state, untrimmedline.addressAtDxCounty)
        functions.GEN_STRCAT(cnty_state, untrimmedline.addressAtDxState)
        
        if (functions.GEN_LOOKUP(cnty_state, context.RQRS_CNTYALL, context.RQRS_CNTYALL_CNTYSTAT, [:]))
            return true
        return false

    }

    // ID: RQRS-00059; TAG: 59; NAME: County at DX, Date of Diagnosis (COC)
    public boolean rqrs00059(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty))
                return false
        }
        return true

    }

    // ID: RQRS-00060; TAG: N0907; NAME: CS Eval Items, Class of Case (CS)
    public boolean rqrs00060(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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: RQRS-00061; TAG: N0906; NAME: CS Eval Items, Vital Status (CS)
    public boolean rqrs00061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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: RQRS-00062; TAG: N0944; NAME: CS Ext, Histol ICDO3, Breast Schema (CS)
    public boolean rqrs00062(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00063; TAG: N1433; NAME: CS Ext, LN, Mets at DX, SSF 1, Retinoblastoma (CS)
    public boolean rqrs00063(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00064; TAG: N1432; NAME: CS Ext, LN, Mets at DX, SSF 3, Prostate (CS)
    public boolean rqrs00064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00065; TAG: N1707; NAME: CS Ext,TS/Ext Eval, SSF 1, MelanomaConjunc (CS)
    public boolean rqrs00065(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00066; TAG: N0656; NAME: CS Extension (CS)
    public boolean rqrs00066(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: RQRS-00067; TAG: 67; NAME: CS Extension, Brain Schema  (CS)
    public boolean rqrs00067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00068; TAG: N0683; NAME: CS Extension, CS Lymph Nodes, CS Mets at DX (CS)
    public boolean rqrs00068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00069; TAG: 69; NAME: CS Extension, CS Tumor Size, Breast Schema  (CS)
    public boolean rqrs00069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00070; TAG: N1867; NAME: CS Extension, CS Tumor Size, MycosisFungoides (CS)
    public boolean rqrs00070(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00071; TAG: N0698; NAME: CS Extension, CS Tumor Size, Site, Hist ICDO3 (CS)
    public boolean rqrs00071(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                    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, '_schema_ms')
                    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.RQRS_MEL_HN, context.RQRS_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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        return true

    }

    // ID: RQRS-00072; TAG: N0760; NAME: CS Extension, Hematopoietic (CS)
    public boolean rqrs00072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00073; TAG: N1571; NAME: CS Extension, Hist, Grade, Esophagus Schema (CS)
    public boolean rqrs00073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00074; TAG: 74; NAME: CS Extension, Hist, Grade, EsophagusGEJunction(CS)
    public boolean rqrs00074(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "8000-8046, 8051-8131, 8148-8152, 8154-8157, 8170-8175") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00075; TAG: N1715; NAME: CS Extension, Histology, Grade, Thyroid (CS)
    public boolean rqrs00075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "8000-8019,8022-8029,8033,8074,8153,8240,8300,8392,8413") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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.histologyIcdO3, "8020,8021,8030,8031,8032")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410,415,420,490"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00076; TAG: N0710; NAME: CS Extension, KidneyRenalPelvis Schema (CS)
    public boolean rqrs00076(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'KidneyRenalPelvis schema: CS Extension (${untrimmedline.csExtension}) allowed only for C669 (Ureter)')
            }
        }
        return true

    }

    // ID: RQRS-00077; TAG: N0923; NAME: CS Extension, Lymphoma Schema (CS)
    public boolean rqrs00077(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        
        return true

    }

    // ID: RQRS-00078; TAG: N0955; NAME: CS Extension, Morphology, Bladder ICDO3 (CS)
    public boolean rqrs00078(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.morphologyIcdO3, "81302")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00079; TAG: N0963; NAME: CS Extension, Mycosis Fungoides Schema (CS)
    public boolean rqrs00079(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00080; TAG: N1377; NAME: CS Extension, MyelomaPlasmaCellDisorder (CS)
    public boolean rqrs00080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "9731, 9734")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "110,200,500")) {
            if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "300")) {
            if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9734")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "810,820")) {
            if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00081; TAG: N0685; NAME: CS Extension, Primary Site, Behavior ICDO3 (CS)
    public boolean rqrs00081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.behaviorIcdO3, "2")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    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.behaviorIcdO3, "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, '_schema_ms')
                    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.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum,GISTColon,GISTRectum,NETColon,NETRectum")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8210,8261,8263") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'Conflict among schema, Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), Behavior Code ICD-O-3 (${untrimmedline.behaviorIcdO3}), CS Extension (${untrimmedline.csExtension})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Breast")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Cervix")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "010")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Penis")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    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, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis,UrinaryOther")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis,UrinaryOther")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Urethra")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    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.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bladder")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bladder")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MelanomaConjunctiva")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "005")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return false
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "100,120")) {
                    if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3")) {
                        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                        return false
                    }
                    else
                        return true
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-999")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00082; TAG: N1116; NAME: CS Extension, Schema (CS)
    public boolean rqrs00082(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-00083; TAG: N1708; NAME: CS Extension, SSF 1, Conjunctiva Schema (CS)
    public boolean rqrs00083(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00084; TAG: N1868; NAME: CS Extension, SSF 1, Head and Neck Schemas (CS)
    public boolean rqrs00084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00085; TAG: N1536; NAME: CS Extension, SSF 1, Lung Schema (CS)
    public boolean rqrs00085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00086; TAG: N0694; NAME: CS Extension, SSF 1, Thyroid Schema (CS)
    public boolean rqrs00086(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00087; TAG: N1869; NAME: CS Extension, SSF 11, MerkelCellVulva Schema (CS)
    public boolean rqrs00087(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00088; TAG: N1870; NAME: CS Extension, SSF 11, Vulva Schema (CS)
    public boolean rqrs00088(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00089; TAG: N1871; NAME: CS Extension, SSF 16, MerkelCell Schemas (CS)
    public boolean rqrs00089(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00090; TAG: N1872; NAME: CS Extension, SSF 16, Scrotum Schema (CS)
    public boolean rqrs00090(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00091; TAG: N1873; NAME: CS Extension, SSF 16, Skin Schema (CS)
    public boolean rqrs00091(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00092; TAG: N1874; NAME: CS Extension, SSF 17, MerkelCell Schemas (CS)
    public boolean rqrs00092(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00093; TAG: N1875; NAME: CS Extension, SSF 17, Penis Schema (CS)
    public boolean rqrs00093(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00094; TAG: N1876; NAME: CS Extension, SSF 18, MerkelCell Schemas (CS)
    public boolean rqrs00094(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00095; TAG: N1877; NAME: CS Extension, SSF 2, Bladder Schema (CS)
    public boolean rqrs00095(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00096; TAG: N1698; NAME: CS Extension, SSF 2, KidneyRenalPelvis (CS)
    public boolean rqrs00096(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00097; TAG: N1745; NAME: CS Extension, SSF 2, Lung Schema (CS)
    public boolean rqrs00097(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                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: RQRS-00098; TAG: N1709; NAME: CS Extension, SSF 2, MelanomaChoroid (CS)
    public boolean rqrs00098(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00099; TAG: 99; NAME: CS Extension, SSF 2, MelanomaCiliaryBody  (CS)
    public boolean rqrs00099(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00100; TAG: N1878; NAME: CS Extension, SSF 2, Vagina Schema (CS)
    public boolean rqrs00100(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00101; TAG: N1064; NAME: CS Extension, SSF 24, Breast Schema (CS)
    public boolean rqrs00101(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If Histologic Type ICD-O-3 = ${untrimmedline.histologyIcdO3}, 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Extension = ${untrimmedline.csExtension}, CS Site-Specific Factor24 must = 010 or 020')
            }
        }
        return true

    }

    // ID: RQRS-00102; TAG: N1434; NAME: CS Extension, SSF 3, Behavior, Prostate (CS)
    public boolean rqrs00102(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.behaviorIcdO3, "2")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "100-750") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00103; TAG: N1879; NAME: CS Extension, SSF 3, Bladder Schema (CS)
    public boolean rqrs00103(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00104; TAG: N1880; NAME: CS Extension, SSF 3, Breast Schema (CS)
    public boolean rqrs00104(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00105; TAG: N1881; NAME: CS Extension, SSF 3, CorpusCarcinoma Schema (CS)
    public boolean rqrs00105(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00106; TAG: N1882; NAME: CS Extension, SSF 3, Head and Neck Schemas (CS)
    public boolean rqrs00106(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00107; TAG: N1711; NAME: CS Extension, SSF 3, MelanomaChoroid (CS)
    public boolean rqrs00107(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00108; TAG: N1712; NAME: CS Extension, SSF 3, MelanomaCiliaryBody (CS)
    public boolean rqrs00108(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00109; TAG: N1883; NAME: CS Extension, SSF 4, FallopianTube Schema (CS)
    public boolean rqrs00109(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00110; TAG: N1884; NAME: CS Extension, SSF 4, Head and Neck Schemas (CS)
    public boolean rqrs00110(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00111; TAG: N1885; NAME: CS Extension, SSF 4, Vagina Schema (CS)
    public boolean rqrs00111(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00112; TAG: N1886; NAME: CS Extension, SSF 5, CorpusCarcinoma Schema (CS)
    public boolean rqrs00112(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00113; TAG: N1887; NAME: CS Extension, SSF 5, Head and Neck Schemas (CS)
    public boolean rqrs00113(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00114; TAG: N1888; NAME: CS Extension, SSF 5, Testis Schema (CS)
    public boolean rqrs00114(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00115; TAG: N1889; NAME: CS Extension, SSF 6, FallopianTube Schema (CS)
    public boolean rqrs00115(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00116; TAG: N1890; NAME: CS Extension, SSF 6, Head and Neck Schemas (CS)
    public boolean rqrs00116(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00117; TAG: N1891; NAME: CS Extension, SSF 6, Vagina Schema (CS)
    public boolean rqrs00117(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00118; TAG: N1892; NAME: CS Extension, SSF 8, KidneyParenchyma (CS)
    public boolean rqrs00118(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00119; TAG: N1866; NAME: CS Extension, SSF 9, Head and Neck Schemas (CS)
    public boolean rqrs00119(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00120; TAG: N0946; NAME: CS Extension, Surgery, Prostate Schema (CS)
    public boolean rqrs00120(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                return false
            }
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) > 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, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00121; TAG: N0950; NAME: CS Extension, TS/Ext Eval, Prostate Schema (CS)
    public boolean rqrs00121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00122; TAG: N1713; NAME: CS Extension, Tumor Size, Lung Schema (CS)
    public boolean rqrs00122(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-00123; TAG: 123; NAME: CS Items - CoC  Required - Non-SSF 2016 (CS)
    public boolean rqrs00123(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2016)
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Tumor Size must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Extension must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Lymph Nodes must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98,99")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX must be blank, 98, or 99')
                err_flag = 1
            }
        }
        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.csTumorSizeExtEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Tumor Size/Ext Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Lymph Nodes Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Bone must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Brain must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Liver must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Lung must be blank, 8 or 9')
                err_flag = 1
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Penis,Testis")) {
            if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Lymph-vascular Invasion cannot be blank for this schema')
                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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-00124; TAG: N0691; NAME: CS Items - COC Required - Non-SSF (CS)
    public boolean rqrs00124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year >= 2016)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.csVersionOriginal)) {
                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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-00125; TAG: N1812; NAME: CS Items - COC Required - SSF 1 (CS)
    public boolean rqrs00125(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00126; TAG: N1813; NAME: CS Items - COC Required - SSF 10 (CS)
    public boolean rqrs00126(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00127; TAG: N1815; NAME: CS Items - COC Required - SSF 11 (CS)
    public boolean rqrs00127(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00128; TAG: N1816; NAME: CS Items - COC Required - SSF 12 (CS)
    public boolean rqrs00128(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00129; TAG: N1817; NAME: CS Items - COC Required - SSF 13 (CS)
    public boolean rqrs00129(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00130; TAG: N1818; NAME: CS Items - COC Required - SSF 14 (CS)
    public boolean rqrs00130(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor14 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00131; TAG: N1819; NAME: CS Items - COC Required - SSF 15 (CS)
    public boolean rqrs00131(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                                return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00132; TAG: N1820; NAME: CS Items - COC Required - SSF 16 (CS)
    public boolean rqrs00132(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00133; TAG: N1821; NAME: CS Items - COC Required - SSF 17 (CS)
    public boolean rqrs00133(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00134; TAG: N1822; NAME: CS Items - COC Required - SSF 18 (CS)
    public boolean rqrs00134(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor18 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor18 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00135; TAG: N1823; NAME: CS Items - COC Required - SSF 19 (CS)
    public boolean rqrs00135(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: RQRS-00136; TAG: N1836; NAME: CS Items - COC Required - SSF 2 (CS)
    public boolean rqrs00136(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00137; TAG: N1825; NAME: CS Items - COC Required - SSF 20 (CS)
    public boolean rqrs00137(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: RQRS-00138; TAG: N1826; NAME: CS Items - COC Required - SSF 21 (CS)
    public boolean rqrs00138(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor21 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor21 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00139; TAG: N1827; NAME: CS Items - COC Required - SSF 22 (CS)
    public boolean rqrs00139(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor22 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor22 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00140; TAG: N1828; NAME: CS Items - COC Required - SSF 23 (CS)
    public boolean rqrs00140(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor23 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor23 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00141; TAG: N1829; NAME: CS Items - COC Required - SSF 24 (CS)
    public boolean rqrs00141(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: RQRS-00142; TAG: N1830; NAME: CS Items - COC Required - SSF 3 (CS)
    public boolean rqrs00142(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00143; TAG: N1831; NAME: CS Items - COC Required - SSF 4 (CS)
    public boolean rqrs00143(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
                }
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00144; TAG: N1832; NAME: CS Items - COC Required - SSF 5 (CS)
    public boolean rqrs00144(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00145; TAG: N1833; NAME: CS Items - COC Required - SSF 6 (CS)
    public boolean rqrs00145(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00146; TAG: N1834; NAME: CS Items - COC Required - SSF 7 (CS)
    public boolean rqrs00146(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00147; TAG: N1837; NAME: CS Items - COC Required - SSF 8 (CS)
    public boolean rqrs00147(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-00148; TAG: N1835; NAME: CS Items - COC Required - SSF 9 (CS)
    public boolean rqrs00148(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 9 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00149; TAG: N1716; NAME: CS LN, Nodes Eval, SSF 3, MelanomaSkin (CS)
    public boolean rqrs00149(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                    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, '_schema_ms')
                        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, '_schema_ms')
                            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: RQRS-00150; TAG: N1717; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellPenis (CS)
    public boolean rqrs00150(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                    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, '_schema_ms')
                    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: RQRS-00151; TAG: N1718; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellScrotum (CS)
    public boolean rqrs00151(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                    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, '_schema_ms')
                    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: RQRS-00152; TAG: N1719; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellSkin (CS)
    public boolean rqrs00152(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                    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, '_schema_ms')
                    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: RQRS-00153; TAG: N1720; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellVulva (CS)
    public boolean rqrs00153(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellVulva"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,105-109,114-130,600")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005,100")) {
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                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, '_schema_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "105-109,114-130,600")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0, 1, 5, 9")) {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    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: RQRS-00154; TAG: N0657; NAME: CS Lymph Nodes (CS)
    public boolean rqrs00154(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        return functions.GEN_INLIST(untrimmedline.csLymphNodes, "000-999", "(\\d\\d\\d)")

    }

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

    }

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

    }

    // ID: RQRS-00157; TAG: N1950; NAME: CS Lymph Nodes Eval, Nodes Ex (CS)
    public boolean rqrs00157(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,GISTAppendix,GISTColon") || functions.GEN_INLIST(t_schema_name, "GISTRectum,LymphomaOcularAdnexa,MelanomaSkin,MerkelCellSkin") || functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellVulva,MerkelCellScrotum,NetColon") || functions.GEN_INLIST(t_schema_name, "NETRectum,Rectum,Retinoblastoma"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "3,5,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00"))
            return false
        return true

    }

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

    }

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

    }

    // ID: RQRS-00160; TAG: N1721; NAME: CS Lymph Nodes, LN Nodes Eval, RNP, Testis (CS)
    public boolean rqrs00160(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-500")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
                if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98,99"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-00161; TAG: N1803; NAME: CS Lymph Nodes, Lymph Nodes Eval, RNP (CS)
    public boolean rqrs00161(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            functions.GEN_NOOP()
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa,MelanomaSkin,MerkelCellPenis,MerkelCellScrotum"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin,MerkelCellVulva,Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Breast") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "EsophagusGEJunction") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "100"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Stomach") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "100,110"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "NETStomach,NETColon,NETRectum,GISTAppendix,GISTStomach,GISTColon,GISTRectum") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050,100"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999") && functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "3,6")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00169; TAG: N0703; NAME: CS Lymph Nodes, SSF 1, Head/Neck Schemas (CS)
    public boolean rqrs00169(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_SCHEM_HN_SCHEMA, [:]))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00179; TAG: 179; NAME: CS Mets at DX, SSF 4, MelanomaChor/Cil/Iris(CS)
    public boolean rqrs00179(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10,40,50,52,54,56,60")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00180; TAG: N1893; NAME: CS Mets at DX-BBLL, LymphomaOcularAdnexa (CS)
    public boolean rqrs00180(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        int req_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Bone must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Brain must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Liver must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Lung must not = 8')
        return true

    }

    // ID: RQRS-00181; TAG: N1894; NAME: CS Mets at DX-BBLL, MycosisFungoides (CS)
    public boolean rqrs00181(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MycosisFungoides"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Bone must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Brain must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Liver must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Lung must not = 8')
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00293; TAG: N1640; NAME: CS SSF 25, PeritoneumFemaleGen (CS)
    public boolean rqrs00293(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        if (functions.GEN_INLIST(untrimmedline.sex, "2") && functions.GEN_INLIST(untrimmedline.primarySite, "481,482,488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8590-8671, 8930-8934,8940-9110")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002,100"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00300; TAG: N0965; NAME: CS SSF 3, SSF 4, Prostate Schema (CS)
    public boolean rqrs00300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        w_cs_version_1st = functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.csVersionOriginal, 1, 4))
        if (w_cs_version_1st < 102)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                return true
        }
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960, 970, 980")) {
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.csSiteSpecificFactor4, 2, 1), "5"))
                return true
            else
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00327; TAG: N2028; NAME: CS SSF 8, SSF 10, Grade, Prostate (SEER)
    public boolean rqrs00327(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2014) || (dx_year > 2017))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C619") || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9136, 9141-9582, 9700-9701"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "002-006")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002-006,998,999")) {
                if (!functions.GEN_INLIST(untrimmedline.grade, "1"))
                    return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 1')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007")) {
                    if (!functions.GEN_INLIST(untrimmedline.grade, "2"))
                        return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 2')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008-010")) {
                        if (!functions.GEN_INLIST(untrimmedline.grade, "3"))
                            return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 3')
                    }
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002-007,998,999")) {
                    if (!functions.GEN_INLIST(untrimmedline.grade, "2"))
                        return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 2')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008-010")) {
                        if (!functions.GEN_INLIST(untrimmedline.grade, "3"))
                            return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 3')
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008-010")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002-010,998,999")) {
                        if (!functions.GEN_INLIST(untrimmedline.grade, "3"))
                            return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 3')
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998,999")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002-006")) {
                            if (!functions.GEN_INLIST(untrimmedline.grade, "1"))
                                return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 1')
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007")) {
                                if (!functions.GEN_INLIST(untrimmedline.grade, "2"))
                                    return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 2')
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008-010")) {
                                    if (!functions.GEN_INLIST(untrimmedline.grade, "3"))
                                        return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8} and CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, Grade must = 3')
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00330; TAG: N1634; NAME: CS SSF 9, Head and Neck Schemas (CS)
    public boolean rqrs00330(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,95,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00340; TAG: 340; NAME: CS Validate Schema  (CS)
    public boolean rqrs00340(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2004)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: RQRS-00341; TAG: N1800; NAME: CS Verify CStage Version 0205xx (CS)
    public boolean rqrs00341(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_cs_version = new char[7]
        int t_compare
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017)
            return true
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_version", t_cs_version)
        
        t_compare = functions.GEN_STRCMP(t_cs_version, "0205", 4)
        if (t_compare == 0)
            return true
        return false

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00348; TAG: N0157; NAME: Date 1st Crs RX COC (COC)
    public boolean rqrs00348(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stCrsRxCoc))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00349; TAG: 349; NAME: Date 1st Crs RX COC , Date Flag (COC)
    public boolean rqrs00349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date 1st Crs RX COC is blank, corresponding Date 1st Crs RX COC Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-00350; TAG: N1079; NAME: Date 1st Crs RX COC Flag (NAACCR)
    public boolean rqrs00350(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00351; TAG: N0199; NAME: Date 1st Crs RX COC, Date of Diagnosis (COC)
    public boolean rqrs00351(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOf1stCrsRxCoc, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stCrsRxCoc))
                functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00352; TAG: N0200; NAME: Date 1st Crs RX COC, Date of Last Contact (COC)
    public boolean rqrs00352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastContact, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stCrsRxCoc)) {
                functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00353; TAG: N1348; NAME: Date 1st Crs RX COC, Dates of RX (COC)
    public boolean rqrs00353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int earliest_dt
        char[] rx_flag = new char[2]
        int dtcmp
        
        if ((functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) && functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag)))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11") && functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "11,15"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "11"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,12")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,12"))
                return true
            else
                return false
        }
        if ((!functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc)) && (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stCrsRxCoc))) {
            functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC: %DC')
            return false
        }
        if ((!functions.GEN_EMPTY(untrimmedline.rxDateSurgery)) && (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery))) {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery: %DC')
            return false
        }
        if ((!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) && (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation))) {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation: %DC')
            return false
        }
        if ((!functions.GEN_EMPTY(untrimmedline.rxDateSystemic)) && (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSystemic))) {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Systemic: %DC')
            return false
        }
        if ((!functions.GEN_EMPTY(untrimmedline.rxDateOther)) && (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateOther))) {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Other: %DC')
            return false
        }
        if (functions.GEN_VAL(untrimmedline.rxDateSurgery) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateRadiation) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateSystemic) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateOther) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc))
            functions.GEN_NOOP()
        else {
            return false
        }
        if (functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSystemic, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0)
            return false
        return true

    }

    // ID: RQRS-00354; TAG: 354; NAME: Date Case Completed-CoC (COC)
    public boolean rqrs00354(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseCompletedCoc))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseCompletedCoc))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Completed-CoC: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00355; TAG: 355; NAME: Date Case Completed-CoC, Date of Diagnosis (COC)
    public boolean rqrs00355(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "00-22"))
            return true
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.dateCaseCompletedCoc))
                return false
        }
        return true

    }

    // ID: RQRS-00356; TAG: 356; NAME: Date Case Completed-CoC, Date of Diagnosis (NCDB)
    public boolean rqrs00356(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2010) {
            if (functions.GEN_EMPTY(untrimmedline.dateCaseCompletedCoc))
                return false
        }
        return true

    }

    // ID: RQRS-00357; TAG: N1136; NAME: Date Case Last Changed (NAACCR)
    public boolean rqrs00357(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseLastChanged))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseLastChanged))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Last Changed: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00358; TAG: N0748; NAME: Date Conclusive DX (SEER)
    public boolean rqrs00358(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateConclusiveDx))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Conclusive DX: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00359; TAG: N1076; NAME: Date Conclusive DX Flag (NAACCR)
    public boolean rqrs00359(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00360; TAG: N1132; NAME: Date Conclusive DX, Date Flag (NAACCR)
    public boolean rqrs00360(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx) && functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx)) {
            if (!functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "10,11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = blank, 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-00361; TAG: N0883; NAME: Date Conclusive DX, Date of DX (SEER IF164)
    public boolean rqrs00361(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int days_diff
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.dateConclusiveDx) && functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = 2007-2012, then Date Conclusive DX and Date Conclusive DX Flag cannot both be blank')
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.dateConclusiveDx) || !functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Date Conclusive DX and Date Conclusive DX Flag must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx))
            return true
        days_diff = (functions.GEN_DAYDIFF_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateConclusiveDx, ((Integer)context.RQRS_GEN_DT_MAX)))
        
        if (days_diff == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Conclusive DX: %DC')
        if (days_diff > 60)
            return true
        else
            return false
        return true

    }

    // ID: RQRS-00362; TAG: N0542; NAME: Date of 1st Contact (COC)
    public boolean rqrs00362(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stContact))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00363; TAG: N1070; NAME: Date of 1st Contact Flag (NAACCR)
    public boolean rqrs00363(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContactFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOf1stContactFlag, "12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00364; TAG: 364; NAME: Date of 1st Contact, Date Flag(NAACCR)
    public boolean rqrs00364(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOf1stContactFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOf1stContactFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

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

    }

    // ID: RQRS-00366; TAG: N1035; NAME: Date of Birth Flag (NAACCR)
    public boolean rqrs00366(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.birthDateFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.birthDateFlag, "12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00367; TAG: N1036; NAME: Date of Birth, Date Flag (NAACCR)
    public boolean rqrs00367(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.birthDate)) {
            if (!functions.GEN_INLIST(untrimmedline.birthDateFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.birthDateFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00371; TAG: N1069; NAME: Date of Last Contact Flag (NAACCR)
    public boolean rqrs00371(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContactFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfLastContactFlag, "12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00372; TAG: 372; NAME: Date of Last Contact, Date Flag(NAACCR)
    public boolean rqrs00372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfLastContactFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfLastContactFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

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

    }

    // ID: RQRS-00374; TAG: 374; NAME: Date of Mult Tum, Lymphoma/Leukem/Unk Site(NAACCR)
    public boolean rqrs00374(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
            return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751-9758,9765-9769,9970"))
                return true
        }
        if (dx_year == 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9732-9733,9735-9738,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
        }
        if (dx_year == 2011) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (!functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3)))
                return true
        }
        if (dx_year > 2010) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C809")) || ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3))) || (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732-9733,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992"))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
        }
        
        return true

    }

    // ID: RQRS-00375; TAG: N0749; NAME: Date of Mult Tumors (SEER)
    public boolean rqrs00375(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfMultipleTumors))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Multiple Tumors: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00376; TAG: N1077; NAME: Date of Mult Tumors Flag (NAACCR)
    public boolean rqrs00376(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00377; TAG: N0884; NAME: Date of Mult Tumors, Date of DX (SEER IF165)
    public boolean rqrs00377(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = 2007-2012, then Date of Mult Tumors and Date of Mult Tumors Flag cannot both be blank')
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) || !functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Date of Mult Tumors and Date of Mult Tumors Flag must be blank')
        }
        return true

    }

    // ID: RQRS-00378; TAG: N0670; NAME: Derived AJCC-6 M (CS)
    public boolean rqrs00378(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6M, "00,10-13,19,88,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00379; TAG: N0680; NAME: Derived AJCC-6 M Descriptor (CS)
    public boolean rqrs00379(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6MDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00380; TAG: N0669; NAME: Derived AJCC-6 N (CS)
    public boolean rqrs00380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6N, "00-04,10-13,18-23,29,30-33,39,88,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00381; TAG: N0681; NAME: Derived AJCC-6 N Descriptor (CS)
    public boolean rqrs00381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6NDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00382; TAG: N0671; NAME: Derived AJCC-6 Stage Group (CS)
    public boolean rqrs00382(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6StageGroup, "00-02,10-24,30-43,50-63,70-74,88,90,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00383; TAG: N0668; NAME: Derived AJCC-6 T (CS)
    public boolean rqrs00383(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6T, "00,01,05-07,10-23,29-33,39-44,49,80,81,88,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00384; TAG: N0682; NAME: Derived AJCC-6 T Descriptor (CS)
    public boolean rqrs00384(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc6TDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00385; TAG: N1019; NAME: Derived AJCC-7 M (CS)
    public boolean rqrs00385(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7M, "000,010,100,110,120,130,140,150,199,888,999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00386; TAG: N1020; NAME: Derived AJCC-7 M Descriptor (CS)
    public boolean rqrs00386(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7MDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00387; TAG: N1017; NAME: Derived AJCC-7 N (CS)
    public boolean rqrs00387(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7N, "000,010,020,030,040,100,110,120,130,180,199,200", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7N, "210,220,230,299,300,310,320,330,399,400,888,999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00388; TAG: N1021; NAME: Derived AJCC-7 N Descript (CS)
    public boolean rqrs00388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7NDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00389; TAG: N1022; NAME: Derived AJCC-7 Stage Group (CS)
    public boolean rqrs00389(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7StageGroup, "000,010,020,100,110,120,121,130,140,150,151,160,170,180,190", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7StageGroup, "200,210,220,230,240,300,310,320,321,322,323,330,340,350,360,370,380,390, ", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7StageGroup, "400,410,420,430,500,510,520,530,540,541,542,550,560,570,580,590", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7StageGroup, "600,610,620,630,700,710,720,721,722,730,740,888,900,999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00390; TAG: N1015; NAME: Derived AJCC-7 T (CS)
    public boolean rqrs00390(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7T, "000,010,050,060,070,100,110,120,121,122,130,140", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7T, "150,151,152,160,170,180,181,191,192,199, ", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7T, "200,201,202,210-213,220,230,240,299,300,301,302,310,320,330,340,399", "(\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7T, "400,410,411,412,420,421,422,430,440,450,491,492,499,800,810,888,999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-00391; TAG: N1016; NAME: Derived AJCC-7 T Descript (CS)
    public boolean rqrs00391(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjcc7TDescriptor, "c,p,a,y,N"))
            return true
        return false

    }

    // ID: RQRS-00392; TAG: N0674; NAME: Derived AJCC--Flag (CS)
    public boolean rqrs00392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjccFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedAjccFlag, "1,2"))
            return true
        return false

    }

    // ID: RQRS-00393; TAG: N0679; NAME: Derived AJCC--Flag, Derived AJCC (COC)
    public boolean rqrs00393(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        err_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjccFlag)) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 Stage Group')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 Stage Group')
                err_flag = 1
            }
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T Descriptor')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N Descriptor')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M Descriptor')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 Stage Group')
                err_flag = 1
            }
            if (dx_year > 2009) {
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 Stage Group')
                    err_flag = 1
                }
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-00394; TAG: 394; NAME: Derived Items, Date of DX (COC)
    public boolean rqrs00394(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2015)
            return true
        if (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 Stage Group cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS1977 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS2000 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Derived cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 Stage Group cannot be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-00395; TAG: N0672; NAME: Derived SS1977 (CS)
    public boolean rqrs00395(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSs1977, "0-5, 7-9"))
            return true
        return false

    }

    // ID: RQRS-00396; TAG: N0675; NAME: Derived SS1977--Flag (CS)
    public boolean rqrs00396(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs1977Flag))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSs1977Flag, "1,2"))
            return true
        return false

    }

    // ID: RQRS-00397; TAG: N0678; NAME: Derived SS1977--Flag, Derived SS1977 (CS)
    public boolean rqrs00397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs1977Flag)) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSs1977))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs1977))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00399; TAG: N1029; NAME: Derived SS2000, Behavior ICDO3 (CS)
    public boolean rqrs00399(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            if (functions.GEN_INLIST(untrimmedline.derivedSs2000, "8"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2") && functions.GEN_INLIST(t_schema_name, "Bladder") && functions.GEN_INLIST(untrimmedline.csExtension, "100")) {
                if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "0,8"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return false
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                    if (functions.GEN_INLIST(untrimmedline.derivedSs2000, "0"))
                        return true
                    else {
                        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                        return false
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3") && functions.GEN_INLIST(t_schema_name, "Prostate") && functions.GEN_INLIST(untrimmedline.csExtension, "999") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000")) {
                        if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "8"))
                            return true
                        else {
                            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                            return false
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                            if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "0,8"))
                                return true
                            else {
                                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00400; TAG: N0676; NAME: Derived SS2000--Flag (CS)
    public boolean rqrs00400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs2000Flag))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSs2000Flag, "1,2"))
            return true
        return false

    }

    // ID: RQRS-00401; TAG: N0677; NAME: Derived SS2000--Flag, Derived SS2000 (CS)
    public boolean rqrs00401(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs2000Flag)) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00402; TAG: N0369; NAME: Diagnostic Confirm, Seq Num--Hosp (COC)
    public boolean rqrs00402(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.overRideHospSeqDxConf, "1") || functions.GEN_INLIST(untrimmedline.primarySite, "760-768, 809", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "60-99"))
            return true
        if (functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6-9") && functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "01-99"))
            return false
        return true

    }

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

    }

    // ID: RQRS-00404; TAG: 404; NAME: Diagnostic Confirmation, Behavior ICDO2(SEER IF31)
    public boolean rqrs00404(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
        if (functions.GEN_MATCH(untrimmedline.overRideHistology, "(2)|(3)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.behaviorIcdO2, "(2)")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00406; TAG: 406; NAME: Diagnostic Confirmation, Histology ICDO2(SEER IF48
    public boolean rqrs00406(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideLeukLymphoma, "1"))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9717", "(\\d\\d\\d\\d)") && functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6,8")))
            return false
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720-9941", "(\\d\\d\\d\\d)") && functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6")))
            return false
        return true

    }

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

    }

    // ID: RQRS-00408; TAG: 408; NAME: DX 1985-2016, 1st Contact 1985-2018 (NCDB)
    public boolean rqrs00408(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int cont_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        cont_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return false
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return false
        if (cont_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return false
        if (cont_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return false
        if (dx_year > 2016)
            return false
        if (cont_year > 2018)
            return false
        if (dx_year < 1985)
            return false
        if (cont_year < 1985)
            return false
        
        return true

    }

    // ID: RQRS-00409; TAG: 409; NAME: Edit Over-rides (NCDB)
    public boolean rqrs00409(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHistology, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAgeSiteMorph, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSurgDxConf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideLeukLymphoma, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAcsnClassSeq, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHospSeqDxConf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHospSeqSite, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteTnmStgGrp, "(1)|(\\s)"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00410; TAG: N0370; NAME: EOD--Tumor Size (COC)
    public boolean rqrs00410(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        return functions.GEN_MATCH(untrimmedline.eodTumorSize, "(\\d\\d\\d)")

    }

    // ID: RQRS-00411; TAG: N0709; NAME: EOD--Tumor Size, Date of Diagnosis (COC)
    public boolean rqrs00411(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2004) {
            if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
                return false
        }
        return true

    }

    // ID: RQRS-00412; TAG: N0373; NAME: Grade (COC)
    public boolean rqrs00412(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.grade))
            return true
        if (functions.GEN_INLIST(untrimmedline.grade, "1-9"))
            return true
        return false

    }

    // ID: RQRS-00413; TAG: N0979; NAME: Grade Path System (COC)
    public boolean rqrs00413(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePathSys))
            return true
        if (!functions.GEN_INLIST(untrimmedline.gradePathSys, "2, 3, 4"))
            return false
        
        return true

    }

    // ID: RQRS-00414; TAG: N0981; NAME: Grade Path System, Grade Path Value, Grade (COC)
    public boolean rqrs00414(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePathSys)) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePathValue))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.gradePathSys, "2")) {
                if (!functions.GEN_INLIST(untrimmedline.gradePathValue, "1,2"))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.gradePathSys, "3")) {
                    if (!functions.GEN_INLIST(untrimmedline.gradePathValue, "1-3"))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.gradePathSys, "4")) {
                        if (!functions.GEN_INLIST(untrimmedline.gradePathValue, "1-4"))
                            return false
                    }
                }
            }
        }
        
        return true

    }

    // ID: RQRS-00415; TAG: N0980; NAME: Grade Path Value (COC)
    public boolean rqrs00415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePathValue))
            return true
        if (!functions.GEN_INLIST(untrimmedline.gradePathValue, "1-4"))
            return false
        
        return true

    }

    // ID: RQRS-00416; TAG: N0374; NAME: Hematopoietic, TNM, ICDO2 (NAACCR)
    public boolean rqrs00416(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1996) || (dx_year > 2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49") || functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9722,9723,9731,9732,9740,9741,9760-9989")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00417; TAG: N0932; NAME: Hematopoietic, TNM, ICDO3 (COC)
    public boolean rqrs00417(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1996)
            return true
        if (dx_year > 2009)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49") || functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992"))
            return true
        if (dx_year < 2008) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
            else
                return false
        }
        if (dx_year > 2007) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathT)) && (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathN)) && (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathM)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Hematopoietic, all Clin TNM fields must = 88, Path TNM fields must = 88 or blank')
        }
        return true

    }

    // ID: RQRS-00418; TAG: N0740; NAME: Hist/Behav ICDO2, Hist/Behav ICDO3 (SEER IF126)
    public boolean rqrs00418(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.morphologyIcdO2) && functions.GEN_EMPTY(untrimmedline.morphologyIcdO3))
            return false
        if (!functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO2, 1, 4)) && functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO2, 5, 1)))
            return functions.GEN_ERROR_MSG(binding, 'Histology (92-00) ICD-O-2/Behavior (92-00) ICD-O-2 conflict')
        if (!functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO2, 5, 1)) && functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO2, 1, 4)))
            return functions.GEN_ERROR_MSG(binding, 'Histology (92-00) ICD-O-2/Behavior (92-00) ICD-O-2 conflict')
        if (!functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO3, 1, 4)) && functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO3, 5, 1)))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3/Behavior Code ICD-O-3 conflict')
        if (!functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO3, 5, 1)) && functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.morphologyIcdO3, 1, 4)))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3/Behavior Code ICD-O-3 conflict')
        return true

    }

    // ID: RQRS-00419; TAG: N0355; NAME: Histologic Type ICDO2 (COC)
    public boolean rqrs00419(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (!functions.GEN_ILOOKUP(untrimmedline.histologyIcdO2, context.RQRS_HISICDO2, context.RQRS_HISICDO2_HISTOLOGY, [:]))
            return false
        return true

    }

    // ID: RQRS-00420; TAG: N0795; NAME: Histologic Type ICDO3 (SEER)
    public boolean rqrs00420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_HISICDO3_HISTOLOGY, untrimmedline.histologyIcdO3, [:]))
            return false
        return true

    }

    // ID: RQRS-00421; TAG: N0458; NAME: Histology ICDO2, Date of Diagnosis (NAACCR)
    public boolean rqrs00421(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
                return false
        }
        return true

    }

    // ID: RQRS-00422; TAG: N0500; NAME: Histology ICDO3, Date DX, Date 1st Cont (NAACCR)
    public boolean rqrs00422(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fc_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (dx_year > 2000) {
                if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                    return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis > 2000, Histologic Type ICD-O-3 cannot be blank')
                else
                    return true
            }
            else
                return true
        }
        fc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (fc_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (fc_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
        if (fc_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is unknown and Date of 1st Contact > 2000, then Histologic Type ICD-O-3 cannot be blank')
            else
                return true
        }
        return true

    }

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

    }

    // ID: RQRS-00424; TAG: N0375; NAME: Histology, Primary Site, Tumor Size, ICDO2 (COC)
    public boolean rqrs00424(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.morphologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9722,9732,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989")) {
            if (functions.GEN_VAL(untrimmedline.eodTumorSize) == 999)
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-765,767-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_VAL(untrimmedline.eodTumorSize) == 999)
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00425; TAG: N0452; NAME: Histology, Primary Site, Tumor Size, ICDO3 (COC)
    public boolean rqrs00425(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.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
            if (functions.GEN_VAL(untrimmedline.eodTumorSize) == 999)
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-765,767-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_VAL(untrimmedline.eodTumorSize) == 999)
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00426; TAG: N0849; NAME: ICD Revision Comorbid (COC)
    public boolean rqrs00426(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionComorbid))
            return true
        return functions.GEN_INLIST(untrimmedline.icdRevisionComorbid, "0,1,9")

    }

    // ID: RQRS-00427; TAG: 427; NAME: ICD Revision Comorbid, Date of DX (COC)
    public boolean rqrs00427(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005) {
            if (functions.GEN_EMPTY(untrimmedline.icdRevisionComorbid))
                return false
        }
        return true

    }

    // ID: RQRS-00428; TAG: N0147; NAME: ICD-O-2 Conversion Flag (SEER ICDOREV)
    public boolean rqrs00428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.icdO2ConversionFlag, "0-6") || functions.GEN_EMPTY(untrimmedline.icdO2ConversionFlag))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00429; TAG: N0487; NAME: ICD-O-3 Conversion Flag (NAACCR)
    public boolean rqrs00429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.icdO3ConversionFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "0,1,3"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00430; TAG: 430; NAME: ICD-O-3 Conversion Flag, Histology ICDO3(SEER IF95
    public boolean rqrs00430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.icdO3ConversionFlag)) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00433; TAG: N0933; NAME: Lymphoma, TNM, ICDO3 (COC)
    public boolean rqrs00433(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "441, 690, 695, 696", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729"))
            return true
        if (dx_year < 2008) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
            else
                return false
        }
        if (dx_year > 2007) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathT)) && (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathN)) && (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathM)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Lymphoma, all Clin T,N,M fields must = 88, Path T,N,M fields must = 88 or blank')
        }
        return true

    }

    // ID: RQRS-00434; TAG: 434; NAME: Lymph-vascular Invasion (CS)
    public boolean rqrs00434(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: RQRS-00435; TAG: 435; NAME: Lymph-vascular Invasion, Histology, Behav (COC)
    public boolean rqrs00435(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
                return false
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,2")) {
                if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "1"))
                    return functions.GEN_ERROR_MSG(binding, 'If Behavior Code ICD-O-3 = ${untrimmedline.behaviorIcdO3}, Lymphovascular Invasion must not = 1')
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
                    return functions.GEN_ERROR_MSG(binding, 'If Histologic Type ICD-O-3 not = 9590-9992, Lymphovascular Invasion must not = 8')
            }
        }
        return true

    }

    // ID: RQRS-00436; TAG: N2427; NAME: Mets at DX-BBDLLO, HemeRetic (SEER)
    public boolean rqrs00436(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone) && functions.GEN_EMPTY(untrimmedline.metsDxBrain) && functions.GEN_EMPTY(untrimmedline.metsDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsDxLiver) && functions.GEN_EMPTY(untrimmedline.metsDxLung) && functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        char[] SiteGrp = new char[7]
        
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9740-9809,  9840-9992"))
            functions.GEN_STRCPY(SiteGrp, "Heme1")
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9820, 9826,9831-9834") && functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_STRCPY(SiteGrp, "Heme2")
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9823,9827") && functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_STRCPY(SiteGrp, "Heme3")
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9837") && functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_STRCPY(SiteGrp, "Heme4")
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731,9732,9734") && functions.GEN_INLIST(untrimmedline.primarySite, "000-440, 442-689, 691-694,698-809", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_STRCPY(SiteGrp, "Plasma")
        if (functions.GEN_INLIST(SiteGrp, "Heme4")) {
        
            if (functions.GEN_INLIST(untrimmedline.metsDxBone, "0,1,8,9") && functions.GEN_INLIST(untrimmedline.metsDxBrain, "0,1,8,9") && functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "0,1,8,9") && functions.GEN_INLIST(untrimmedline.metsDxLiver, "0,1,8,9") && functions.GEN_INLIST(untrimmedline.metsDxLung, "0,1,8,9") && functions.GEN_INLIST(untrimmedline.metsDxOther, "0,1,2,8,9"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "Heme1,Heme2,Heme3,Plasma")) {
        
            if (!functions.GEN_INLIST(untrimmedline.metsDxBone, "8"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.metsDxBrain, "8"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "8"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.metsDxLiver, "8"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.metsDxLung, "8"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.metsDxOther, "8"))
                return false
        }
        else {
        
            if (functions.GEN_INLIST(untrimmedline.metsDxBone, "8"))
                return false
            if (functions.GEN_INLIST(untrimmedline.metsDxBrain, "8"))
                return false
            if (functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "8"))
                return false
            if (functions.GEN_INLIST(untrimmedline.metsDxLiver, "8"))
                return false
            if (functions.GEN_INLIST(untrimmedline.metsDxLung, "8"))
                return false
            if (functions.GEN_INLIST(untrimmedline.metsDxOther, "8"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00437; TAG: N2126; NAME: Mets at DX-Bone (SEER)
    public boolean rqrs00437(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBone, "0189", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00438; TAG: 438; NAME: Mets at DX-Bone, Date of Diagnosis
    public boolean rqrs00438(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxBone)))
                return false
        }
        return true

    }

    // ID: RQRS-00439; TAG: N2186; NAME: Mets at DX-Bone, TNM Clin M, Path M (SEER)
    public boolean rqrs00439(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_STRCMP(untrimmedline.metsDxBone, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone=${untrimmedline.metsDxBone} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxBone, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone = ${untrimmedline.metsDxBone} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxBone, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone = ${untrimmedline.metsDxBone}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00440; TAG: N2128; NAME: Mets at DX-Brain (SEER)
    public boolean rqrs00440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBrain, "0189", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00441; TAG: 441; NAME: Mets at DX-Brain , Date of Diagnosis (SEER)
    public boolean rqrs00441(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxBrain)))
                return false
        }
        return true

    }

    // ID: RQRS-00442; TAG: N2187; NAME: Mets at DX-Brain, TNM Clin M, Path M (SEER)
    public boolean rqrs00442(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_STRCMP(untrimmedline.metsDxBrain, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain=${untrimmedline.metsDxBrain} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxBrain, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain = ${untrimmedline.metsDxBrain} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxBrain, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain = ${untrimmedline.metsDxBrain}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00443; TAG: N2130; NAME: Mets at DX-Distant LN (SEER)
    public boolean rqrs00443(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "0189", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00444; TAG: 444; NAME: Mets at DX-Distant LN , Date of Diagnosis (SEER)
    public boolean rqrs00444(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxDistantLn)))
                return false
        }
        return true

    }

    // ID: RQRS-00445; TAG: N2188; NAME: Mets at DX-Distant LN, TNM Clin M, Path M (SEER)
    public boolean rqrs00445(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_STRCMP(untrimmedline.metsDxDistantLn, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN=${untrimmedline.metsDxDistantLn} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxDistantLn, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN = ${untrimmedline.metsDxDistantLn} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxDistantLn, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN = ${untrimmedline.metsDxDistantLn}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00446; TAG: N2132; NAME: Mets at DX-Liver (SEER)
    public boolean rqrs00446(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLiver, "0189", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00447; TAG: 447; NAME: Mets at DX-Liver , Date of Diagnosis (SEER)
    public boolean rqrs00447(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxLiver)))
                return false
        }
        return true

    }

    // ID: RQRS-00448; TAG: N2189; NAME: Mets at DX-Liver, TNM Clin M, Path M (SEER)
    public boolean rqrs00448(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_STRCMP(untrimmedline.metsDxLiver, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver=${untrimmedline.metsDxLiver} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxLiver, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver = ${untrimmedline.metsDxLiver} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxLiver, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver = ${untrimmedline.metsDxLiver}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00449; TAG: N2134; NAME: Mets at DX-Lung (SEER)
    public boolean rqrs00449(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLung, "0189", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00450; TAG: 450; NAME: Mets at DX-Lung , Date of Diagnosis (SEER)
    public boolean rqrs00450(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxLung)))
                return false
        }
        return true

    }

    // ID: RQRS-00451; TAG: N2190; NAME: Mets at DX-Lung, TNM Clin M, Path M (SEER)
    public boolean rqrs00451(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_STRCMP(untrimmedline.metsDxLung, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung=${untrimmedline.metsDxLung} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxLung, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung = ${untrimmedline.metsDxLung} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_STRCMP(untrimmedline.metsDxLung, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung = ${untrimmedline.metsDxLung}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00452; TAG: N2136; NAME: Mets at DX-Other (SEER)
    public boolean rqrs00452(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_AT(untrimmedline.metsDxOther, "01289", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-00453; TAG: 453; NAME: Mets at DX-Other , Date of Diagnosis (SEER)
    public boolean rqrs00453(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxOther)))
                return false
        }
        return true

    }

    // ID: RQRS-00454; TAG: N2191; NAME: Mets at DX-Other, TNM Clin M, Path M (SEER)
    public boolean rqrs00454(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_STRCMP(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_STRCMP(untrimmedline.tnmClinM, "88", 2) == 0 && functions.GEN_STRCMP(untrimmedline.tnmPathM, "88", 2) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other=${untrimmedline.metsDxOther} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_AT(untrimmedline.metsDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0 && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_AT(untrimmedline.metsDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+") != 0 && functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-00455; TAG: 455; NAME: Morph Coding Sys--Curr, Morph Coding Sys--Orig(COC
    public boolean rqrs00455(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.morphCodingSysCurrent) || functions.GEN_EMPTY(untrimmedline.morphCodingSysOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "9") || functions.GEN_INLIST(untrimmedline.morphCodingSysOriginal, "9"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.morphCodingSysCurrent, untrimmedline.morphCodingSysOriginal) >= 0)
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00456; TAG: 456; NAME: Morph Coding Sys--Current (NCDB)
    public boolean rqrs00456(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "4-8")

    }

    // ID: RQRS-00457; TAG: N0055; NAME: Morph Coding Sys--Originl (NAACCR)
    public boolean rqrs00457(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.morphCodingSysOriginal))
            return true
        return functions.GEN_INLIST(untrimmedline.morphCodingSysOriginal, "1-9,A")

    }

    // ID: RQRS-00458; TAG: N0582; NAME: Morph Coding Sys--Originl, Date of Diagnosis (COC)
    public boolean rqrs00458(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.morphCodingSysOriginal))
                return false
        }
        return true

    }

    // ID: RQRS-00459; TAG: N0218; NAME: Morphology--Type/Behavior ICDO2 (SEER MORPH)
    public boolean rqrs00459(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int i, borderline_ok
        boolean morphflg
        int dx_year
        char[] histbeh = new char[6]
        
        morphflg = false
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            return true
        }
        if (!functions.GEN_ILOOKUP(untrimmedline.histologyIcdO2, context.RQRS_HISICDO2, context.RQRS_HISICDO2_HISTOLOGY, [:])) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type not valid - ICDO2')
            morphflg = true
        }
        else {
            functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO2) /* look for Behavior 3 (malignant, first */
            functions.GEN_STRCAT(histbeh, "3")
        
            if (!functions.GEN_ILOOKUP(histbeh, context.RQRS_MORPH, context.RQRS_MORPH_HISTBEH, [:])) {
                functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO2)
                functions.GEN_STRCAT(histbeh, "2")
                if (functions.GEN_ILOOKUP(histbeh, context.RQRS_MORPH, context.RQRS_MORPH_HISTBEH, [:])) {
                    if (dx_year > 2000 && (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8931,9393,9538,9950,9960-9962,9980-9984,9989")) && (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "1")))
                        borderline_ok = 1
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Benign Histology - Please Review - ICDO2')
                    }
                }
                else {
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type not valid - ICDO2')
                    morphflg = true
                }
            }
        }
        if (functions.GEN_MATCH(untrimmedline.grade, "(\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "0")) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade not valid - ICDO2')
                morphflg = true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "5,6,7,8") && !functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9941")) {
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade not valid - ICDO2')
                    morphflg = true
                }
            }
        }
        else {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade not valid - ICDO2')
            morphflg = true
        }
        if (morphflg == true) {
            return true /* error flags have been set */
        }
        morphflg = false
        
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "3") == 0) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8331,8851,9511"))
                morphflg = (functions.GEN_VAL(untrimmedline.grade) != 1)
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9083"))
                    morphflg = (functions.GEN_VAL(untrimmedline.grade) != 2)
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9696"))
                        morphflg = (functions.GEN_INLIST(untrimmedline.grade, "1,2,4,9"))
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8020,8021,9062,9082,9401,9451,9512"))
                            morphflg = (functions.GEN_VAL(untrimmedline.grade) != 4)
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9693"))
                                morphflg = (functions.GEN_INLIST(untrimmedline.grade, "2,3,4,9"))
                        }
                    }
                }
            }
            if (morphflg == true)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade & Histology conflict - ICDO2')
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2") == 0 && !functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8004,8020-8021,8331-8332") || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8800-9054,9062-9062,9082-9083") || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9110-9491,9501-9989"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invalid Histology for In Situ - ICDO2')
        }
        return true

    }

    // ID: RQRS-00460; TAG: 460; NAME: Morphology--Type/Behavior ICDO3 (COC)
    public boolean rqrs00460(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        // This edit could not be translated because it contains invalid syntax.
        
        return true

    }

    // ID: RQRS-00461; TAG: N0754; NAME: Mult Tum Rpt As One Prim (SEER)
    public boolean rqrs00461(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
            return true
        return functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00,10-12,20,30-32,40,80,88,99", "(\\d\\d)")

    }

    // ID: RQRS-00462; TAG: N0885; NAME: Mult Tum Rpt As One Prim, Date of DX (SEER IF155)
    public boolean rqrs00462(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.multiTumorRptAsOnePrim))
                return false
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Mult Tum Rpt as One Prim must be blank')
        }
        return true

    }

    // ID: RQRS-00463; TAG: 463; NAME: Mult Tum Rpt as One Prim, Date of Mult Tum(NAACCR)
    public boolean rqrs00463(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00464; TAG: N0903; NAME: Mult Tum Rpt As One Prim, Primary Site (NAACCR)
    public boolean rqrs00464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "10-12")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "31,32")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        return true

    }

    // ID: RQRS-00465; TAG: N1619; NAME: Mult Tum Rpt, Lymphoma/Leukemia/Unk Site (NAACCR)
    public boolean rqrs00465(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.multiTumorRptAsOnePrim)) || (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must not = 88')
            }
            return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751-9758,9765-9769,9970"))
                return true
        }
        if (dx_year == 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9732-9733,9735-9738,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must not = 88')
            }
        }
        if (dx_year == 2011) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (!functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3)))
                return true
        }
        if (dx_year > 2010) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C809")) || ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3))) || (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732-9733,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992"))) {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Mult Tum Rpt as One Prim must not = 88')
            }
        }
        
        return true

    }

    // ID: RQRS-00466; TAG: N0886; NAME: Multiplicity Cntr, Date of Mult Tum (SEER IF163)
    public boolean rqrs00466(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15")) {
            if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00467; TAG: 467; NAME: Multiplicity Cntr, Mult Tum Rpt as One Prim(NAACCR
    public boolean rqrs00467(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim) || functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00")) {
            if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00468; TAG: N0755; NAME: Multiplicity Counter (SEER)
    public boolean rqrs00468(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
            return true
        return functions.GEN_INLIST(untrimmedline.multiplicityCounter, "00-89,99", "(\\d\\d)")

    }

    // ID: RQRS-00469; TAG: N0887; NAME: Multiplicity Counter, Date of DX (SEER IF156)
    public boolean rqrs00469(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.multiplicityCounter))
                return false
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Multiplicity Counter must be blank')
        }
        return true

    }

    // ID: RQRS-00470; TAG: 470; NAME: Multiplicity Ctr, Lymphoma/Leukem/Unk Site(NAACCR)
    public boolean rqrs00470(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.multiplicityCounter)) || (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
            return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751-9758,9765-9769,9970"))
                return true
        }
        if (dx_year == 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9732-9733,9735-9738,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
        }
        if (dx_year == 2011) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (!functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3)))
                return true
        }
        if (dx_year > 2010) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C809")) || ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3))) || (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732-9733,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992"))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
        }
        
        return true

    }

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

    }

    // ID: RQRS-00472; TAG: N0876; NAME: NPI--Archive FIN (NAACCR)
    public boolean rqrs00472(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.archiveFinNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.archiveFinNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Archive FIN cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.archiveFinNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Archive FIN must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.archiveFinNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Archive FIN failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-00473; TAG: 473; NAME: NPI-Archive FIN, Date of Diagnosis (NCDB)
    public boolean rqrs00473(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2008) {
            if (functions.GEN_EMPTY(untrimmedline.archiveFinNpi))
                return false
        }
        return true

    }

    // ID: RQRS-00474; TAG: 474; NAME: NPI--Physician 3 (NCDB)
    public boolean rqrs00474(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physician3Npi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physician3Npi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 3 cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physician3Npi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 3 must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physician3Npi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 3 failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-00475; TAG: 475; NAME: NPI--Physician 4 (NCDB)
    public boolean rqrs00475(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physician4Npi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physician4Npi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 4 cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physician4Npi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 4 must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physician4Npi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys 4 failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-00476; TAG: 476; NAME: NPI--Physician--Prim Surg (NCDB)
    public boolean rqrs00476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physicianPrimarySurgNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physicianPrimarySurgNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys--Prim Surg cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physicianPrimarySurgNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys--Prim Surg must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physicianPrimarySurgNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Phys--Prim Surg failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-00477; TAG: N0872; NAME: NPI--Reporting Facility (NAACCR)
    public boolean rqrs00477(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.reportingFacilityNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.reportingFacilityNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Reporting Facility cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.reportingFacilityNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Reporting Facility must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.reportingFacilityNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Reporting Facility failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-00478; TAG: 478; NAME: NPI-Reporting Facility, Date of Diagnosis (NCDB)
    public boolean rqrs00478(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2008) {
            if (functions.GEN_EMPTY(untrimmedline.reportingFacilityNpi))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00505; TAG: N1966; NAME: Obsolete Histology ICDO3, Date of DX (SEER)
    public boolean rqrs00505(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8157"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3 (${untrimmedline.dateOfDiagnosis.formatDate()}) is obsolete; please use 8152 instead')
        if (dx_year < 2010)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9654,9661,9662,9664,9665,9667,9670,9675"))
            return false
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9684,9728,9729,9733,9750,9752,9753"))
            return false
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9754,9760,9764,9805,9835,9836,9960,9984,9987"))
            return false
        return true

    }

    // ID: RQRS-00506; TAG: N0870; NAME: Over-ride Misuse (NAACCR)
    public boolean rqrs00506(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int total
        
        total = 0
        
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteType))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHistology))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideAgeSiteMorph))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSeqNoDxConf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatSeqNo))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSurgDxConf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideReportSource))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideIllDefineSite))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideLeukLymphoma))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteBehavior))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteEodDxDate))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatEod))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatMorph))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsNodesPos))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsTnmN))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsTnmM))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideAcsnClassSeq))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHospSeqDxConf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideCocSiteType))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHospSeqSite))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteTnmStgGrp))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideTnmStage))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideTnmTis))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideNameSex))
            total = total + 1
        if (total > 6)
            return true
        else
            return true
        
        return true

    }

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

    }

    // ID: RQRS-00508; TAG: N0007; NAME: Primary Site (SEER SITE)
    public boolean rqrs00508(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.primarySite, context.RQRS_SITE_TBL, context.RQRS_SITE_TBL_SITECODE, [:])

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00515; TAG: N2332; NAME: Primary Site, AJCC Stage Group - Ed 7 (COC)
    public boolean rqrs00515(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010 || dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4"))) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9837"))
                            functions.GEN_STRCPY(SiteGrp, "57A")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "57A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9837"))
                functions.GEN_STRCPY(SiteGrp, "57C")
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
        if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGC, context.RQRS_AJC7STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
        if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGP, context.RQRS_AJC7STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-00516; TAG: N2208; NAME: Primary Site, AJCC Stage Group 2016 - Ed 7 (COC)
    public boolean rqrs00516(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
            functions.GEN_STRCPY(GrpStg, SiteGrp)
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_CC7C2016, context.RQRS_CC7C2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
        
            functions.GEN_STRCPY(GrpStg, SiteGrp)
        
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_CC7P2016, context.RQRS_CC7P2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
            }
        }
        return true

    }

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

    }

    // ID: RQRS-00518; TAG: N0008; NAME: Primary Site, Behavior Code ICDO2 (SEER IF39)
    public boolean rqrs00518(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2") == 0) {
            if (functions.GEN_MATCH(untrimmedline.primarySite, "(C269)|(C399)|(C559)|(C579)|(C639)|(C689)|(C729)|(C759)|(C76[0-8])|(C809)"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00523; TAG: N2336; NAME: Primary Site, M 2016 - Ed 7 (COC-NPCR)
    public boolean rqrs00523(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpMCode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinM)) && (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathM)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727, 9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
            functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmClinM)
        
            if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_NP7M2016, context.RQRS_NP7M2016_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmPathM)
        
        if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_NP7M2016, context.RQRS_NP7M2016_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00526; TAG: N0383; NAME: Primary Site, Morphology-Type ICDO2 (COC)
    public boolean rqrs00526(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] Site_Lo = new char[5], Site_Hi = new char[5], SitHist = new char[100]
        
        char[] SiteHist = new char[9]
        
        char[] SiteGrp = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8004,8010-8045,8050-8082,8090-8110")) {
            return true
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.RQRS_IF25_REF, context.RQRS_IF25_REF_SITE_LO, ['SITE_LO':Site_Lo, 'SITE_HI':Site_Hi])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Site_Lo) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Site_Hi) <= 0)
                functions.GEN_STRCPY(SiteGrp, Site_Lo)
            else {
                return false
            }
        }
        functions.GEN_STRCPY(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO2, 4)
        
        return functions.GEN_ILOOKUP(SiteHist, context.RQRS_IF25_2, context.RQRS_IF25_2_SITEHIST, [:])

    }

    // ID: RQRS-00527; TAG: N0455; NAME: Primary Site, Morphology-Type ICDO3 (COC)
    public boolean rqrs00527(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITE_LO = new char[5], SITE_HI = new char[5], SITE = new char[5], HIST = new char[5]
        int dx_year
        
        char[] SiteHist = new char[10]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) && (dx_year > 2008))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8005,8010-8046,8050-8084,8090-8110")) {
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_IF25_REF_SITE_LO, untrimmedline.primarySite, ['SITE_LO':SITE_LO, 'SITE_HI':SITE_HI])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LO) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HI) <= 0)
                functions.GEN_STRCPY(SiteGrp, SITE_LO)
            else {
                return false
            }
        }
        functions.GEN_STRCPY(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO3, 4)
        
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_IF25_3_SITEHIST, SiteHist, ['SITE':SITE, 'HIST':HIST]))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00528; TAG: N1032; NAME: Primary Site, Morphology-Type,Beh ICDO3 (COC)
    public boolean rqrs00528(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITE_LO = new char[5], SITE_HI = new char[5], SITE = new char[5], HIST = new char[5], BEH = new char[2]
        int dx_year
        
        char[] SiteHistBeh = new char[11]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2009)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8005,8010-8046,8050-8084,8090-8110") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3")) {
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_IF25_REF_SITE_LO, untrimmedline.primarySite, ['SITE_LO':SITE_LO, 'SITE_HI':SITE_HI])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LO) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HI) <= 0)
                functions.GEN_STRCPY(SiteGrp, SITE_LO)
            else {
                return false
            }
        }
        functions.GEN_STRCPY(SiteHistBeh, SiteGrp)
        functions.GEN_STRCAT(SiteHistBeh, untrimmedline.histologyIcdO3, 4)
        functions.GEN_STRCAT(SiteHistBeh, untrimmedline.behaviorIcdO3, 1)
        
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_IF25_3_SITEHISTBEH, SiteHistBeh, ['SITE':SITE, 'HIST':HIST, 'BEH':BEH]))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-00529; TAG: N2206; NAME: Primary Site, N 2016 - Ed 7 (COC-NPCR)
    public boolean rqrs00529(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinN)) && (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathN)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
        
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_NP7NCL16, context.RQRS_NP7NCL16_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_NP7NPA16, context.RQRS_NP7NPA16_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00532; TAG: 532; NAME: Primary Site, T 2016 - Ed 7, ICDO3 (COC-NPCR)
    public boolean rqrs00532(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinT)) && (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathT)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
        
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_NP7TCL16, context.RQRS_NP7TCL16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_NP7TPA16, context.RQRS_NP7TPA16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-00533; TAG: 533; NAME: Primary Site, TNM Clin Stage Valid A- Ed 7 (COC)
    public boolean rqrs00533(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[5], CLINN = new char[5], CLINM = new char[5], CLINSPEC = new char[8], CLINSTAGE = new char[6], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[100], PATHN = new char[100], PATHM = new char[100], PATHSPEC = new char[100], PATHSTAGE = new char[100], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[100], SSF15 = new char[100], SSF16 = new char[100], STESTIS = new char[100], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_EMPTY(untrimmedline.tnmClinN) || functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "027")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9260, 9364"))
                functions.GEN_STRCPY(SiteGrp, "27B")
            else
                functions.GEN_STRCPY(SiteGrp, "27A")
        }
        if (!functions.GEN_INLIST(SiteGrp, "003,04A,04B,04C,04D,05A,05B,08A,08B,08C,08D,08E,08F,009") && !functions.GEN_INLIST(SiteGrp, "011,012,13A,13B,014,015,16A") && !functions.GEN_INLIST(SiteGrp, "16B,17A,17B,17C,018,019,021,022,023,024,025,026,27A,27B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88")) {
            functions.GEN_STRCPY(cM, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            functions.GEN_STRCAT(cM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            functions.GEN_STRCPY(cM, untrimmedline.tnmClinM)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88")) {
            functions.GEN_STRCPY(cN, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
            functions.GEN_STRCAT(cN, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            functions.GEN_STRCPY(cN, untrimmedline.tnmClinN)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "88")) {
            functions.GEN_STRCPY(cT, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            functions.GEN_STRCAT(cT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            functions.GEN_STRCPY(cT, untrimmedline.tnmClinT)
        if (functions.GEN_INLIST(SiteGrp, "13A")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010, 011"))
                functions.GEN_STRCPY(Spec, "C1")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "020, 021"))
                functions.GEN_STRCPY(Spec, "C2")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "030"))
                functions.GEN_STRCPY(Spec, "C3")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "040"))
                functions.GEN_STRCPY(Spec, "C4")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988, 998, 999"))
                functions.GEN_STRCPY(Spec, "CX")
        }
        if (functions.GEN_INLIST(SiteGrp, "028")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "2"))
                functions.GEN_STRCPY(Spec, "2")
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "3"))
                    functions.GEN_STRCPY(Spec, "3")
                else {
                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                        functions.GEN_STRCPY(Spec, "4")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "9"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "160-169", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110,991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050,988,990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996,998,999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110,991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050,988,990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996,998,999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16B")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159, 170-179", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110, 991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050, 988, 990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996, 998, 999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "180-189, 199, 209", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "051-100,110, 991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000-050, 988, 990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "996, 998, 999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110, 991"))
                            functions.GEN_STRCPY(Spec, "High")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050, 988, 990"))
                                functions.GEN_STRCPY(Spec, "Low")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996, 998, 999"))
                                    functions.GEN_STRCPY(Spec, "Unknown")
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_CLINTNM, SiteGrp)
        functions.GEN_STRCAT(t_CLINTNM, cT)
        functions.GEN_STRCAT(t_CLINTNM, cN)
        functions.GEN_STRCAT(t_CLINTNM, cM)
        
        if (functions.GEN_INLIST(SiteGrp, "025")) {
            if (functions.GEN_INLIST(cT, "X") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "99")) {
                return true
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A,16B") && functions.GEN_INLIST(Spec, "Unknown") && functions.GEN_INLIST(cT, "1,2,3,4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "13A") && functions.GEN_INLIST(Spec, "C2,C3,C4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "1A") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "4A")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "27A") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "2,3") && functions.GEN_INLIST(cN, "0,X") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "27A") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "1") && functions.GEN_INLIST(cN, "0,X") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "1,2") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "3") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "2"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "1,2") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "3") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "2"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "3A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "13A, 16A, 16B, 27A")) {
            functions.GEN_STRCPY(t_CLINTNMSP, t_CLINTNM)
            functions.GEN_STRCAT(t_CLINTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_CLINTNMSP, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNMSP, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmClinStageGroup}')
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "13A, 16A, 16B, 27A")) {
                if (functions.GEN_LOOKUP(t_CLINTNM, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNM, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                    if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} is invalid for TNM staging')
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} and assigned TNM stage ${untrimmedline.tnmClinStageGroup}')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00534; TAG: N2214; NAME: Primary Site, TNM Clin Stage Valid B-Ed 7 (COC)
    public boolean rqrs00534(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[5], CLINN = new char[5], CLINM = new char[5], CLINSPEC = new char[8], CLINSTAGE = new char[6], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[100], PATHN = new char[100], PATHM = new char[100], PATHSPEC = new char[100], PATHSTAGE = new char[100], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[4], SSF15 = new char[4], SSF16 = new char[4], STESTIS = new char[6], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        
        char[] st_msg = new char[79]
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07, U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "041")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "001-099"))
                functions.GEN_STRCPY(SiteGrp, "41B")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100-199"))
                    functions.GEN_STRCPY(SiteGrp, "41C")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200-980"))
                        functions.GEN_STRCPY(SiteGrp, "41D")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988, 997, 998, 999"))
                            functions.GEN_STRCPY(SiteGrp, "41A")
                    }
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "029,030,031,032,033,034,035,36A,36B,36C,37A,37B,038,039") && !functions.GEN_INLIST(SiteGrp, "040,41A,41B,41C,41D,042,043,044,045,046,47A,47B,048,049") && !functions.GEN_INLIST(SiteGrp, "51A,51B,052,053,054,055,057,57B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88")) {
            functions.GEN_STRCPY(cM, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            functions.GEN_STRCAT(cM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            functions.GEN_STRCPY(cM, untrimmedline.tnmClinM)
        if (!functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88")) {
                functions.GEN_STRCPY(cN, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
                functions.GEN_STRCAT(cN, " ")
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
                functions.GEN_STRCPY(cN, "88  ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            functions.GEN_STRCPY(cN, untrimmedline.tnmClinN)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "88")) {
            functions.GEN_STRCPY(cT, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            functions.GEN_STRCAT(cT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            functions.GEN_STRCPY(cT, untrimmedline.tnmClinT)
        if (functions.GEN_INLIST(SiteGrp, "042")) {
            functions.GEN_STRCPY(SSFTestis, untrimmedline.csSiteSpecificFactor13)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor15)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor16)
        
            if (functions.GEN_LOOKUP(SSFTestis, context.RQRS_SVALTEST, context.RQRS_SVALTEST_TESTISSSF, ['STESTIS':STESTIS, 'TESTISSSF':TESTISSSF]))
                functions.GEN_STRCPY(SValue, STESTIS)
            if (functions.GEN_INLIST(SValue, "S0"))
                functions.GEN_STRCPY(Spec, "S0")
            else {
                if (functions.GEN_INLIST(SValue, "S1"))
                    functions.GEN_STRCPY(Spec, "S1")
                else {
                    if (functions.GEN_INLIST(SValue, "S2"))
                        functions.GEN_STRCPY(Spec, "S2")
                    else {
                        if (functions.GEN_INLIST(SValue, "S3"))
                            functions.GEN_STRCPY(Spec, "S3")
                        else {
                            if (functions.GEN_INLIST(SValue, "SX"))
                                functions.GEN_STRCPY(Spec, "SX")
                            else {
                                if (functions.GEN_INLIST(SValue, "ERROR"))
                                    functions.GEN_STRCPY(Spec, "ERROR")
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                functions.GEN_STRCPY(Spec, "000")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                functions.GEN_STRCPY(Spec, "010")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                functions.GEN_STRCPY(Spec, "050")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "110"))
                functions.GEN_STRCPY(Spec, "110")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "150"))
                functions.GEN_STRCPY(Spec, "150")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200"))
                functions.GEN_STRCPY(Spec, "200")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                functions.GEN_STRCPY(Spec, "988")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "999"))
                functions.GEN_STRCPY(Spec, "999")
        }
        if (functions.GEN_INLIST(SiteGrp, "57B")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "030"))
                functions.GEN_STRCPY(Spec, "B0NOS")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                    functions.GEN_STRCPY(Spec, "B0a")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020"))
                        functions.GEN_STRCPY(Spec, "B0b")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "060"))
                            functions.GEN_STRCPY(Spec, "B1NOS")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "040"))
                                functions.GEN_STRCPY(Spec, "B1a")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                                    functions.GEN_STRCPY(Spec, "B1b")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "070"))
                                        functions.GEN_STRCPY(Spec, "B2")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "080, 090, 988,  997, 999"))
                                            functions.GEN_STRCPY(Spec, "BX")
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_CLINTNM, SiteGrp)
        functions.GEN_STRCAT(t_CLINTNM, cT)
        functions.GEN_STRCAT(t_CLINTNM, cN)
        functions.GEN_STRCAT(t_CLINTNM, cM)
        
        if (functions.GEN_INLIST(SiteGrp, "41B,41C,41D,41A")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "002, 003,004, 005, 006"))
                functions.GEN_STRCPY(Spec, "1")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                    functions.GEN_STRCPY(Spec, "2")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008, 009, 010"))
                        functions.GEN_STRCPY(Spec, "3")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988, 998, 999"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        functions.GEN_STRCPY(st_msg, "Set OR TNM 1 or OR TNM Tis to 1 if codes reviewed and confirmed to be correct")
        
        if (functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A, 042, 57B")) {
            functions.GEN_STRCPY(t_CLINTNMSP, t_CLINTNM)
            functions.GEN_STRCAT(t_CLINTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_CLINTNMSP, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNMSP, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0) {
                    functions.GEN_SAVE_TEXT(binding, 't_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                }
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmClinStageGroup}')
                    }
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A, 042, 57B")) {
                if (functions.GEN_LOOKUP(t_CLINTNM, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNM, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                    if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} is invalid for TNM staging')
                    }
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0) {
                            functions.GEN_SAVE_TEXT(binding, 't_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} and assigned TNM stage ${untrimmedline.tnmClinStageGroup}')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00535; TAG: N2415; NAME: Primary Site, TNM Path Stage Valid A-Ed 7 (COC)
    public boolean rqrs00535(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[100], CLINN = new char[100], CLINM = new char[100], CLINSPEC = new char[100], CLINSTAGE = new char[100], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[5], PATHN = new char[5], PATHM = new char[5], PATHSPEC = new char[8], PATHSTAGE = new char[6], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[100], SSF15 = new char[100], SSF16 = new char[100], STESTIS = new char[100], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        
        char[] st_msg = new char[79]
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4, 6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727, 9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8050, 8140-8147, 8160-8162, 8170-8175, 8180-8221, 8250-8507") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8514-8551,8571-8574, 8576, 8940-8941"))
                functions.GEN_STRCPY(SiteGrp, "10C")
        }
        if (functions.GEN_INLIST(SiteGrp, "10A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8046, 8051-8131, 8148-8157, 8230-8249, 8508") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8510-8513, 8560-8570, 8575, 8905, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p2, p3") && functions.GEN_INLIST(untrimmedline.tnmPathN, "p0") && functions.GEN_INLIST(untrimmedline.tnmPathM, "c0")) {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "150, 151, 153, 154", "(C\\d\\d\\d)", 2, 3))
                        functions.GEN_STRCPY(SiteGrp, "10E")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "152,155,158,159", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "10H")
                    }
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "10D")
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10B")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8050, 8140-8147, 8160-8162, 8170-8175, 8180-8221, 8250-8507") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8514-8551,8571-8574, 8576, 8940-8941"))
                functions.GEN_STRCPY(SiteGrp, "10F")
        }
        if (functions.GEN_INLIST(SiteGrp, "10B")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8046, 8051-8131, 8148-8157, 8230-8249, 8508") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8510-8513, 8560-8570, 8575, 8905, 8980-8981"))
                functions.GEN_STRCPY(SiteGrp, "10G")
        }
        if (functions.GEN_INLIST(SiteGrp, "027")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9260, 9364"))
                functions.GEN_STRCPY(SiteGrp, "27B")
            else
                functions.GEN_STRCPY(SiteGrp, "27A")
        }
        if (!functions.GEN_INLIST(SiteGrp, "003,04A,04B,04C,04D,05A,05B,08A,08B,08C,08D,08E,08F,009") && !functions.GEN_INLIST(SiteGrp, "10A,10C,10D,10E,10H,10F,10G,011,012,13A,13B,014,015,16A") && !functions.GEN_INLIST(SiteGrp, "16B,17A,17B,17C,018,019,021,022,023,024,025,026,27A,27B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmPathM, "88")) {
            functions.GEN_STRCPY(pM, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
            functions.GEN_STRCAT(pM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            functions.GEN_STRCPY(pM, untrimmedline.tnmPathM)
        if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88")) {
            functions.GEN_STRCPY(pN, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
            functions.GEN_STRCAT(pN, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            functions.GEN_STRCPY(pN, untrimmedline.tnmPathN)
        if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "88")) {
            functions.GEN_STRCPY(pT, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
            functions.GEN_STRCAT(pT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            functions.GEN_STRCPY(pT, untrimmedline.tnmPathT)
        if (functions.GEN_INLIST(SiteGrp, "13A")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010, 011"))
                functions.GEN_STRCPY(Spec, "C1")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "020, 021"))
                functions.GEN_STRCPY(Spec, "C2")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "030"))
                functions.GEN_STRCPY(Spec, "C3")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "040"))
                functions.GEN_STRCPY(Spec, "C4")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988, 998, 999"))
                functions.GEN_STRCPY(Spec, "CX")
        }
        if (functions.GEN_INLIST(SiteGrp, "028")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "2"))
                functions.GEN_STRCPY(Spec, "2")
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "3"))
                    functions.GEN_STRCPY(Spec, "3")
                else {
                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                        functions.GEN_STRCPY(Spec, "4")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "9"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10C,10D,10E,10F,10G,10H, 27A")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "1"))
                functions.GEN_STRCPY(Spec, "1")
            if (functions.GEN_INLIST(untrimmedline.grade, "2"))
                functions.GEN_STRCPY(Spec, "2")
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "3"))
                    functions.GEN_STRCPY(Spec, "3")
                else {
                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                        functions.GEN_STRCPY(Spec, "3")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "9"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "160-169", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110,991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050,988,990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996,998,999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110,991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050,988,990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996,998,999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16B")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159, 170-179", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110, 991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050, 988, 990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996, 998, 999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "180-189, 199, 209", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "051-100,110, 991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000-050, 988, 990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "996, 998, 999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110, 991"))
                            functions.GEN_STRCPY(Spec, "High")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050, 988, 990"))
                                functions.GEN_STRCPY(Spec, "Low")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996, 998, 999"))
                                    functions.GEN_STRCPY(Spec, "Unknown")
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_PATHTNM, SiteGrp)
        functions.GEN_STRCAT(t_PATHTNM, pT)
        functions.GEN_STRCAT(t_PATHTNM, pN)
        functions.GEN_STRCAT(t_PATHTNM, pM)
        
        if (functions.GEN_INLIST(SiteGrp, "025")) {
            if (functions.GEN_INLIST(pT, "X") && functions.GEN_INLIST(pN, "0") && functions.GEN_INLIST(pM, "0") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "99")) {
                return true
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A,16B") && functions.GEN_INLIST(Spec, "Unknown") && functions.GEN_INLIST(pT, "1,2,3,4") && functions.GEN_INLIST(pN, "0") && functions.GEN_INLIST(pM, "0"))
            return true
        functions.GEN_STRCPY(st_msg, "Set OR TNM 1 or OR TNM Tis to 1 if codes reviewed and confirmed to be correct")
        
        if (functions.GEN_INLIST(SiteGrp, "10C, 10D, 10E, 10F, 10G, 10H, 13A, 16A, 16B, 27A")) {
            functions.GEN_STRCPY(t_PATHTNMSP, t_PATHTNM)
            functions.GEN_STRCAT(t_PATHTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_PATHTNMSP, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNMSP, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0) {
                    functions.GEN_SAVE_TEXT(binding, 't_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                }
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmPathStageGroup}')
                    }
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "10C, 10D, 10E, 10F, 10G, 10H, 13A, 16A, 16B, 27A")) {
                if (functions.GEN_LOOKUP(t_PATHTNM, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNM, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                    if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} is invalid for TNM staging')
                    }
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0) {
                            functions.GEN_SAVE_TEXT(binding, 't_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} and assigned TNM stage ${untrimmedline.tnmPathStageGroup}')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00536; TAG: 536; NAME: Primary Site, TNM Path Stage Valid B- Ed 7 (COC)
    public boolean rqrs00536(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[100], CLINN = new char[100], CLINM = new char[100], CLINSPEC = new char[100], CLINSTAGE = new char[100], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[5], PATHN = new char[5], PATHM = new char[5], PATHSPEC = new char[8], PATHSTAGE = new char[6], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[4], SSF15 = new char[4], SSF16 = new char[4], STESTIS = new char[6], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4, 6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727, 9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "041")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "001-099"))
                functions.GEN_STRCPY(SiteGrp, "41B")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100-199"))
                    functions.GEN_STRCPY(SiteGrp, "41C")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200-980"))
                        functions.GEN_STRCPY(SiteGrp, "41D")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988, 997, 998, 999"))
                            functions.GEN_STRCPY(SiteGrp, "41A")
                    }
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "029,030,031,032,033,034,035,36A,36B,36C,37A,37B,038,039") && !functions.GEN_INLIST(SiteGrp, "040,41A,41B,41C,41D,042,043,044,045,046,47A,47B,048,049") && !functions.GEN_INLIST(SiteGrp, "51A,51B,052,053,054,055,057,57B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmPathM, "88")) {
            functions.GEN_STRCPY(pM, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
            functions.GEN_STRCAT(pM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            functions.GEN_STRCPY(pM, untrimmedline.tnmPathM)
        if (!functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88")) {
                functions.GEN_STRCPY(pN, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
                functions.GEN_STRCAT(pN, " ")
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                functions.GEN_STRCPY(pN, "88  ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            functions.GEN_STRCPY(pN, untrimmedline.tnmPathN)
        if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "88")) {
            functions.GEN_STRCPY(pT, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
            functions.GEN_STRCAT(pT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            functions.GEN_STRCPY(pT, untrimmedline.tnmPathT)
        if (functions.GEN_INLIST(SiteGrp, "042")) {
            functions.GEN_STRCPY(SSFTestis, untrimmedline.csSiteSpecificFactor13)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor15)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor16)
        
            if (functions.GEN_LOOKUP(SSFTestis, context.RQRS_SVALTEST, context.RQRS_SVALTEST_TESTISSSF, ['STESTIS':STESTIS, 'TESTISSSF':TESTISSSF]))
                functions.GEN_STRCPY(SValue, STESTIS)
            if (functions.GEN_INLIST(SValue, "S0"))
                functions.GEN_STRCPY(Spec, "S0")
            else {
                if (functions.GEN_INLIST(SValue, "S1"))
                    functions.GEN_STRCPY(Spec, "S1")
                else {
                    if (functions.GEN_INLIST(SValue, "S2"))
                        functions.GEN_STRCPY(Spec, "S2")
                    else {
                        if (functions.GEN_INLIST(SValue, "S3"))
                            functions.GEN_STRCPY(Spec, "S3")
                        else {
                            if (functions.GEN_INLIST(SValue, "SX"))
                                functions.GEN_STRCPY(Spec, "SX")
                            else {
                                if (functions.GEN_INLIST(SValue, "ERROR"))
                                    functions.GEN_STRCPY(Spec, "ERROR")
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                functions.GEN_STRCPY(Spec, "000")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                functions.GEN_STRCPY(Spec, "010")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                functions.GEN_STRCPY(Spec, "050")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "110"))
                functions.GEN_STRCPY(Spec, "110")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "150"))
                functions.GEN_STRCPY(Spec, "150")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200"))
                functions.GEN_STRCPY(Spec, "200")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                functions.GEN_STRCPY(Spec, "988")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "999"))
                functions.GEN_STRCPY(Spec, "999")
        }
        if (functions.GEN_INLIST(SiteGrp, "57B")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "030"))
                functions.GEN_STRCPY(Spec, "B0NOS")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                    functions.GEN_STRCPY(Spec, "B0a")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020"))
                        functions.GEN_STRCPY(Spec, "B0b")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "060"))
                            functions.GEN_STRCPY(Spec, "B1NOS")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "040"))
                                functions.GEN_STRCPY(Spec, "B1a")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                                    functions.GEN_STRCPY(Spec, "B1b")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "070"))
                                        functions.GEN_STRCPY(Spec, "B2")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "080, 090, 988,  997, 999"))
                                            functions.GEN_STRCPY(Spec, "BX")
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_PATHTNM, SiteGrp)
        functions.GEN_STRCAT(t_PATHTNM, pT)
        functions.GEN_STRCAT(t_PATHTNM, pN)
        functions.GEN_STRCAT(t_PATHTNM, pM)
        
        if (functions.GEN_INLIST(SiteGrp, "41B,41C,41D,41A")) {
            if (functions.GEN_VAL(untrimmedline.csSiteSpecificFactor8) >= functions.GEN_VAL(untrimmedline.csSiteSpecificFactor10) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988, 998, 999")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "002, 003,004, 005, 006"))
                    functions.GEN_STRCPY(Spec, "1")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                        functions.GEN_STRCPY(Spec, "2")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008, 009, 010"))
                            functions.GEN_STRCPY(Spec, "3")
                    }
                }
            }
            else {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002, 003,004, 005, 006"))
                    functions.GEN_STRCPY(Spec, "1")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007"))
                        functions.GEN_STRCPY(Spec, "2")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008, 009, 010"))
                            functions.GEN_STRCPY(Spec, "3")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988, 998, 999"))
                                functions.GEN_STRCPY(Spec, "9")
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A, 042, 57B")) {
            functions.GEN_STRCPY(t_PATHTNMSP, t_PATHTNM)
            functions.GEN_STRCAT(t_PATHTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_PATHTNMSP, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNMSP, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmPathStageGroup}')
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A,042, 57B")) {
                if (functions.GEN_LOOKUP(t_PATHTNM, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNM, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                    if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} is invalid for TNM staging')
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} and assigned TNM stage ${untrimmedline.tnmPathStageGroup}')
                    }
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00552; TAG: N0518; NAME: Rad--Boost Dose cGy, Date of Diagnosis (COC)
    public boolean rqrs00552(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radBoostDoseCgy))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00554; TAG: N0520; NAME: Rad--Boost RX Modality, Date of Diagnosis (COC)
    public boolean rqrs00554(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radBoostRxModality))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00560; TAG: N0574; NAME: Rad--Regional RX Modality, Reason for No Rad (COC)
    public boolean rqrs00560(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality) || functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "20-98")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "20-98"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00569; TAG: 569; NAME: Record Type (NCDB)
    public boolean rqrs00569(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.recordType, "I")

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00578; TAG: N0248; NAME: Recurrence Type--1st, Recurrence Date--1st (COC)
    public boolean rqrs00578(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceType1st))
            return true
        if (functions.GEN_EMPTY(untrimmedline.recurrenceDate1st) && functions.GEN_EMPTY(untrimmedline.recurrenceDate1stFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.recurrenceType1st, "00, 70")) {
            if (functions.GEN_INLIST(untrimmedline.recurrenceDate1stFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Recurrence Type--1st = ${untrimmedline.recurrenceType1st}, then Recurrence Date--1st Flag must = 11')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.recurrenceDate1stFlag, "11"))
                return functions.GEN_ERROR_MSG(binding, 'If Recurrence Date--1st Flag = 11, then Recurrence Type--1st must = 00 or 70')
            else
                return true
        }
        return true

    }

    // ID: RQRS-00579; TAG: N0118; NAME: Regional Nodes Ex, Reg Nodes Pos (COC)
    public boolean rqrs00579(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        ex = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        pos = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        if ((dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20000)) {
            if (ex == 0 && pos != 98)
                return false
            else {
                if (ex >= 1 && ex <= 90) {
                    if (pos == 97 || pos == 99 || pos <= ex)
                        return true
                    else
                        return false
                }
                else {
                    if (ex == 95 || ex == 96 || ex == 97 || ex == 98) {
                        if ((pos >= 0 && pos <= 90) || (pos == 95) || (pos == 97) || (pos == 99))
                            return true
                        else
                            return false
                    }
                    else {
                        if (ex == 99) {
                            if (pos == 99)
                                return true
                            else
                                return false
                        }
                    }
                }
            }
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) > 20000)) {
            if (ex == 0 && pos != 98)
                return false
            else {
                if (ex >= 1 && ex <= 90) {
                    if (pos == 95 || pos == 97 || pos == 99 || pos <= ex)
                        return true
                    else
                        return false
                }
                else {
                    if (ex == 95) {
                        if (pos == 0 || pos == 95 || pos == 99)
                            return true
                        else
                            return false
                    }
                }
            }
            if (ex == 96 || ex == 97 || ex == 98) {
                if ((pos >= 0 && pos <= 90) || (pos == 95) || (pos == 97) || (pos == 99))
                    return true
                else
                    return false
            }
            else {
                if (ex == 99) {
                    if (pos == 99)
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00584; TAG: N0071; NAME: RX Date BRM (COC)
    public boolean rqrs00584(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateBrm))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date BRM: %DC')
            return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00586; TAG: N1126; NAME: RX Date BRM, Date Flag, Date DX (COC)
    public boolean rqrs00586(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-00587; TAG: N1386; NAME: RX Date BRM, Date Last Contact (COC)
    public boolean rqrs00587(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateBrm)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date BRM is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00588; TAG: N1530; NAME: RX Date BRM, Date of Diagnosis (COC)
    public boolean rqrs00588(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00590; TAG: N1046; NAME: RX Date Chemo (COC)
    public boolean rqrs00590(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateChemo))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Chemo: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00591; TAG: N1121; NAME: RX Date Chemo Flag (NAACCR)
    public boolean rqrs00591(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00593; TAG: N1114; NAME: RX Date Chemo, Date Flag, Date DX (COC)
    public boolean rqrs00593(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-00594; TAG: N1384; NAME: RX Date Chemo, Date Last Contact (COC)
    public boolean rqrs00594(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateChemo)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Chemo is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00595; TAG: N1531; NAME: RX Date Chemo, Date of Diagnosis (COC)
    public boolean rqrs00595(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00601; TAG: 601; NAME: RX Date Hormone  (COC)
    public boolean rqrs00601(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateHormone))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Hormone: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00602; TAG: N1072; NAME: RX Date Hormone Flag (NAACCR)
    public boolean rqrs00602(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00604; TAG: N1127; NAME: RX Date Hormone, Date Flag, Date DX (COC)
    public boolean rqrs00604(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-00605; TAG: N1385; NAME: RX Date Hormone, Date Last Contact (COC)
    public boolean rqrs00605(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateHormone)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Hormone is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00606; TAG: N1532; NAME: RX Date Hormone, Date of Diagnosis (COC)
    public boolean rqrs00606(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00608; TAG: N0510; NAME: RX Date Mst Defn Srg (COC)
    public boolean rqrs00608(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00609; TAG: N1092; NAME: RX Date Mst Defn Srg Flag (NAACCR)
    public boolean rqrs00609(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00611; TAG: N1112; NAME: RX Date Mst Defn Srg, Date Flag, DX Date (COC)
    public boolean rqrs00611(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return false
        }
        
        return true

    }

    // ID: RQRS-00612; TAG: N0525; NAME: RX Date Mst Defn Srg, Date Last Contact (COC)
    public boolean rqrs00612(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00613; TAG: N0511; NAME: RX Date Mst Defn Srg, Date of DX (COC)
    public boolean rqrs00613(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg))
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00614; TAG: N0531; NAME: RX Date Mst Defn Srg, RX Date Surgery (COC)
    public boolean rqrs00614(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.rxDateSurgery, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00615; TAG: N0529; NAME: RX Date Mst Defn Srg, Surg Prim Site (COC)
    public boolean rqrs00615(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Date Mst Defn Srg Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
        
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10, 12"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis < 2012, RX Date Mst Defn Srg Flag must = 10 or 12')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis > 2011, RX Date Mst Defn Srg Flag must = 10')
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Mst Defn Srg is blank, if year of Date of Diagnosis < 2012, RX Date Mst Defn Srg Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Mst Defn Srg is blank, if year of Date of Diagnosis > 2011, RX Date Mst Defn Srg Flag must = 12')
                }
            }
        }
        return true

    }

    // ID: RQRS-00616; TAG: N0074; NAME: RX Date Other (COC)
    public boolean rqrs00616(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateOther))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Other: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00617; TAG: N1085; NAME: RX Date Other Flag (NAACCR)
    public boolean rqrs00617(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00619; TAG: N1107; NAME: RX Date Other, Date Flag, DX Date (COC)
    public boolean rqrs00619(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        
        return true

    }

    // ID: RQRS-00620; TAG: N0868; NAME: RX Date Other, Date Last Contact (COC)
    public boolean rqrs00620(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateOther)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Other is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00621; TAG: N1533; NAME: RX Date Other, Date of Diagnosis (COC)
    public boolean rqrs00621(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00626; TAG: N0586; NAME: RX Date Rad Ended, Rad--Location of RX (COC)
    public boolean rqrs00626(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended Flag = ${untrimmedline.rxDateRadiationEndedFlag}, then Rad--Location of RX must = 0')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00627; TAG: N1229; NAME: RX Date Rad Ended, Rad--No of Treatments Vol (COC)
    public boolean rqrs00627(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radNoOfTreatmentVol, "000"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended Flag = ${untrimmedline.rxDateRadiationEndedFlag}, then Rad--No of Treatments Vol must = 000')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_INLIST(untrimmedline.radNoOfTreatmentVol, "000"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00628; TAG: N0588; NAME: RX Date Rad Ended, Rad--Regional Dose: cGy (COC)
    public boolean rqrs00628(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalDoseCgy, "00000"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended Flag = ${untrimmedline.rxDateRadiationEndedFlag}, then radiation item must indicate no treatment')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalDoseCgy, "00000"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00629; TAG: N0589; NAME: RX Date Rad Ended, Rad--Regional RX Modality (COC)
    public boolean rqrs00629(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended Flag = ${untrimmedline.rxDateRadiationEndedFlag}, then Rad--Regional RX Modality must = 00')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00630; TAG: N0590; NAME: RX Date Rad Ended, Rad--Treatment Volume (COC)
    public boolean rqrs00630(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radTreatmentVolume, "00"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended Flag = ${untrimmedline.rxDateRadiationEndedFlag}, then Rad--Treatment Volume must = 00')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_INLIST(untrimmedline.radTreatmentVolume, "00"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00631; TAG: N2034; NAME: RX Date Rad Ended, RX Date Radiation (COC)
    public boolean rqrs00631(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11,15")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation Flag = ${untrimmedline.rxDateRadiationFlag}, then RX Date Rad Ended Flag must = 11')
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.rxDateRadiationEnded, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiationEnded)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation Ended is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00632; TAG: N0549; NAME: RX Date Radiation (COC)
    public boolean rqrs00632(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00633; TAG: N1073; NAME: RX Date Radiation Flag (NAACCR)
    public boolean rqrs00633(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00635; TAG: N1383; NAME: RX Date Radiation, Date Last Contact (COC)
    public boolean rqrs00635(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00636; TAG: N1534; NAME: RX Date Radiation, Date of Diagnosis (COC)
    public boolean rqrs00636(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

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

    }

    // ID: RQRS-00639; TAG: N0535; NAME: RX Date Radiation, Rad--Location of RX (COC)
    public boolean rqrs00639(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "15")) {
                if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0,9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10")) {
                    if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "9"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation Flag = ${untrimmedline.rxDateRadiationFlag}, then Rad--Location of RX must = 9')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "12") || functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag)) {
                        if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0"))
                            return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation Flag = ${untrimmedline.rxDateRadiationFlag}, then Rad--Location of RX must not = 0')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00640; TAG: N0569; NAME: RX Date Radiation, Rad--No of Treatments Vol (COC)
    public boolean rqrs00640(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radNoOfTreatmentVol, "000"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00641; TAG: N0571; NAME: RX Date Radiation, Rad--Regional Dose: cGy (COC)
    public boolean rqrs00641(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalDoseCgy, "00000"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00642; TAG: N0570; NAME: RX Date Radiation, Rad--Regional RX Modality (COC)
    public boolean rqrs00642(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00643; TAG: N0568; NAME: RX Date Radiation, Rad--Treatment Volume (COC)
    public boolean rqrs00643(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radTreatmentVolume, "00"))
                return true
            else
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00646; TAG: N1110; NAME: RX Date Surg Disch, Date Flag, DX Date (COC)
    public boolean rqrs00646(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) && functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00648; TAG: N0533; NAME: RX Date Surg Disch, Date Mst Defn Srg (COC)
    public boolean rqrs00648(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) && functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Mst Defn Srg Flag = ${untrimmedline.rxDateMostDefinSurgFlag}, then RX Date Surg Disch Flag must = 11')
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgicalDisch, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg Ended is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00649; TAG: N0522; NAME: RX Date Surg Disch, Date of DX (COC)
    public boolean rqrs00649(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgicalDisch, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch))
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00650; TAG: N0532; NAME: RX Date Surg Disch, Surg Prim Site (COC)
    public boolean rqrs00650(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) && functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Date Surg Disch Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
        
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "10, 12"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis < 2012, RX Date Surg Disch Flag must = 10 or 12')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "10"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis > 2011, RX Date Surg Disch Flag must = 10')
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Surg Disch is blank, if year of Date of Diagnosis < 2012, RX Date Surg Disch Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Surg Disch is blank, if year of Date of Diagnosis > 2011, RX Date Surg Disch Flag must = 12')
                }
            }
        }
        return true

    }

    // ID: RQRS-00651; TAG: N0356; NAME: RX Date Surgery (COC)
    public boolean rqrs00651(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-00652; TAG: N1086; NAME: RX Date Surgery Flag (NAACCR)
    public boolean rqrs00652(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00654; TAG: N0869; NAME: RX Date Surgery, Date Last Contact (COC)
    public boolean rqrs00654(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00655; TAG: N1535; NAME: RX Date Surgery, Date of Diagnosis (COC)
    public boolean rqrs00655(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00660; TAG: N0800; NAME: RX Date Systemic, Systemic RX (COC)
    public boolean rqrs00660(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo) || functions.GEN_EMPTY(untrimmedline.rxSummHormone) || functions.GEN_EMPTY(untrimmedline.rxSummBrm) || functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm}, RX Summ--Chemo = ${untrimmedline.rxSummChemo}, RX Summ--Hormone = ${untrimmedline.rxSummHormone}, and RX Summ--Transplnt/Endocr = ${untrimmedline.rxSummTransplntEndocr}, RX Date Systemic Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "01,02,03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-40")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If systemiic rx given & RX Date Systemic is blank, if year of Date of Diagnosis < 2012, RX Date Systemic Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If systemiic rx given & RX Date Systemic is blank, if year of Date of Diagnosis > 2011, RX Date Systemic Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "88") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "88") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "88") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "88")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-88")) {
                if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM, RX Summ--Chemo, RX Summ--Hormone, or RX Summ--Transplnt/Endocr = 88, & no systemic rx given, RX Date Systemic Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99")) {
            if (dx_year > 2011) {
                if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "10"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If all systemiic rx = 99, if year of Date of Diagnosis > 2011, RX Date Systemic Flag must = 10')
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00670; TAG: N0721; NAME: RX Hosp--Other, Date of Diagnosis (COC)
    public boolean rqrs00670(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxHospOther))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00679; TAG: N0591; NAME: RX Hosp--Scope Reg 98-02, RX Hosp--Scope Reg (COC)
    public boolean rqrs00679(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospScopeReg9802)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "0,9"))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00681; TAG: 681; NAME: RX Hosp--Scope Reg LN Sur, Primary Site,ICDO2(COC)
    public boolean rqrs00681(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00682; TAG: 682; NAME: RX Hosp--Scope Reg LN Sur, Primary Site,ICDO3(COC)
    public boolean rqrs00682(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3) || functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

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

    }

    // ID: RQRS-00684; TAG: 684; NAME: RX Hosp--Surg App 2010, Date of of Diagnosis (COC)
    public boolean rqrs00684(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010))
                return false
        }
        return true

    }

    // ID: RQRS-00685; TAG: N1065; NAME: RX Hosp--Surg App 2010, Surg Prim Site (COC)
    public boolean rqrs00685(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010) || functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00,98")) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgApp2010, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgApp2010, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00,98"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "99")) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgApp2010, "9"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgApp2010, "9")) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "99"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00688; TAG: N0592; NAME: RX Hosp--Surg Oth 98-02, RX Hosp--Surg Oth (COC)
    public boolean rqrs00688(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgOth9802)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgOthRegDis, "0,9"))
                return true
            else
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00694; TAG: N0603; NAME: RX Hosp--Surg Prim Site, Primary Site, ICDO3 (COC)
    public boolean rqrs00694(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == 2018 && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9702-9992"))
            return true
        if (dx_year > 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite)) {
            return true
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992")) {
                if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "98"))
                return true
            else {
                return false
            }
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.RQRS_SITGRP03, context.RQRS_SITGRP03_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "30")
        }
        else {
            functions.GEN_STRCPY(Sitegrp, "30")
        }
        if (functions.GEN_INLIST(Sitegrp, "30") && functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "41")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                return false
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxHospSurgPrimSite)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.RQRS_SURG03, context.RQRS_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

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

    }

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

    }

    // ID: RQRS-00697; TAG: N0593; NAME: RX Hosp--Surg Site 98-02, RX Hosp--Surg Site (COC)
    public boolean rqrs00697(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgSite9802)) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00,98,99"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgSite9802, "00")) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "10-90,99"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgSite9802, "10-90,99")) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00699; TAG: N1249; NAME: RX Summ--BRM, RX Date BRM (COC)
    public boolean rqrs00699(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm}, RX Date BRM Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and RX Date BRM is blank, if year of Date of Diagnosis < 2012, RX Date BRM Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and RX Date BRM is blank, if year of Date of Diagnosis > 2011, RX Date BRM Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "88")) {
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and Date of Diagnosis < 2012, RX Date BRM Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and Date of Diagnosis > 2011, RX Date BRM Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "99")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm}, RX Date BRM Flag must = 10')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00702; TAG: N1038; NAME: RX Summ--Chemo, RX Date Chemo (COC)
    public boolean rqrs00702(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo}, RX Date Chemo Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and RX Date Chemo is blank, if year of Date of Diagnosis < 2012, RX Date Chemo Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and RX Date Chemo is blank, if year of Date of Diagnosis > 2011, RX Date Chemo Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "88")) {
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and Date of Diagnosis < 2012, RX Date Chemo Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and Date of Diagnosis > 2011, RX Date Chemo Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "99")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo}, RX Date Chemo Flag must = 10')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00705; TAG: N0194; NAME: RX Summ--DX/Stg Proc, RX Date DX/Stg Proc (COC)
    public boolean rqrs00705(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc) && functions.GEN_EMPTY(untrimmedline.rxDateDxStgProcFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc}, RX Date Dx/Stg Proc Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "01-07")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc} and RX Date DX/Stg Proc is blank, if year of Date of Diagnosis < 2012, RX Date Dx/Stg Proc Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc} and RX Date DX/Stg Proc is blank, if year of Date of Diagnosis > 2011, RX Date Dx/Stg Proc Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "09")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc}, RX Date Dx/Stg Proc Flag must = 10')
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00737; TAG: N0758; NAME: RX Summ--Systemic/Sur Seq, Date of DX (COC)
    public boolean rqrs00737(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00741; TAG: N1461; NAME: RX Summ--Treatm Stat, Date 1st Crs RX COC (COC)
    public boolean rqrs00741(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus) || functions.GEN_EMPTY(untrimmedline.classOfCase))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) && functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
            if (!(functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag) || functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status: ${untrimmedline.rxSummTreatmentStatus} and Date 1st Crs RX COC Flag: ${untrimmedline.dateOf1stCrsRxCocFlag}')
            if (functions.GEN_INLIST(untrimmedline.classOfCase, "38"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status (${untrimmedline.rxSummTreatmentStatus}) and Class of Case (${untrimmedline.classOfCase})')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1,2")) {
                if (!(functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag) || functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "12")))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status: ${untrimmedline.rxSummTreatmentStatus} and Date 1st Crs RX COC Flag: ${untrimmedline.dateOf1stCrsRxCocFlag}')
                if (functions.GEN_INLIST(untrimmedline.classOfCase, "38"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status (${untrimmedline.rxSummTreatmentStatus}) and Class of Case (${untrimmedline.classOfCase})')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
                    if (!functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "11"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Treatment Status (${untrimmedline.rxSummTreatmentStatus}), Date 1st Crs RX COC Flag (${untrimmedline.dateOf1stCrsRxCocFlag}) and Class of Case (${untrimmedline.classOfCase})')
                }
                else {
                    if (!(functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag) || functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,12")))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Treatment Status (${untrimmedline.rxSummTreatmentStatus}), Date 1st Crs RX COC Flag (${untrimmedline.dateOf1stCrsRxCocFlag}) and Class of Case (${untrimmedline.classOfCase})')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-00742; TAG: N0985; NAME: RX Summ--Treatment Status (COC)
    public boolean rqrs00742(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0-2, 9"))
            return false
        
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00756; TAG: N0447; NAME: Seq Num--Hosp, Primary Site, Morph ICDO3 (COC)
    public boolean rqrs00756(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "60-88")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.overRideHospSeqSite, "1") && functions.GEN_INLIST(untrimmedline.sequenceNumberHosp, "01-99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "0000-9589", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738,9811-9818,9823,9826-9827,9837", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-424", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9740-9759", "(\\d\\d\\d\\d)"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00768; TAG: N2378; NAME: Summary Stage 2000, Date of Diagnosis (COC)
    public boolean rqrs00768(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of SEER Summary Stage 2000 = ${untrimmedline.seerSummaryStage2000} then Date of Diagnosis cannot be blank')
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If DX year >= 2018, SEER Summary Stage 2000 must be blank')
        }
        return true

    }

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

    }

    // ID: RQRS-00770; TAG: N2343; NAME: Summary Stage 2000, TNM M 2016 (NAACCR)
    public boolean rqrs00770(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] MCODE = new char[5]
        char[] MCODE2 = new char[3]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmPathM)
            if (functions.GEN_INLIST(MCODE, "88")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
                        functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
                }
            }
        }
        else
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
        functions.GEN_STRCPY(MCODE2, MCODE, 2)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,9")) {
            if (functions.GEN_INLIST(MCODE2, "p1,c1 "))
                return false
            else
                return true
        }
        else
            return true
        
        return true

    }

    // ID: RQRS-00771; TAG: N2221; NAME: Summary Stage 2000, TNM N 2016 (NAACCR)
    public boolean rqrs00771(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] NCODE = new char[5]
        char[] NCODE2 = new char[3]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage2000) > 4) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "180,182-189,199,209", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8152,8154-8231,8243-8245,8247-8248,8250-8576,8940-8950,8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p1C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p2C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440,442-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8247")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p2", "(p[A-Za-z0-9]\\s\\s)"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p2", "(p[A-Za-z0-9]\\s\\s)"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9738,9811-9818,9820-9837")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p3,p4", "(p[A-Za-z0-9]\\s\\s)"))
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmPathN)
            if (functions.GEN_INLIST(NCODE, "88,pX")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88,cX"))
                        functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
                }
            }
        }
        else
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
        functions.GEN_STRCPY(NCODE2, NCODE, 2)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(NCODE2, "p1, p2, p3") || functions.GEN_INLIST(NCODE2, "c1,c2,c3"))
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-00772; TAG: N0423; NAME: Surgery, Rad, Surg/Rad Seq (COC)
    public boolean rqrs00772(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int result, surg_num, scope_num, surgoth_num
        int dx_year
        int seer_init_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5"))) && (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "1,2,5-9")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else {
                if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "1,2,5-9")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

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

    }

    // ID: RQRS-00774; TAG: N0425; NAME: Surgery, RX Date Surgery, ICDO2 (COC)
    public boolean rqrs00774(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int exception
        int dx_year
        
        exception = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,809", "(C\\d\\d\\d)", 2, 3))
            exception = 1
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-8") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-8")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (exception == 1 && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-00775; TAG: N1606; NAME: Surgery, RX Date Surgery, ICDO3 (COC)
    public boolean rqrs00775(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int exception
        int dx_year
        
        exception = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == 2018 && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9702-9992"))
            return true
        if (dx_year > 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3))
                exception = 1
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3))
                exception = 1
        }
        if (dx_year == 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,761-768,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "C760") && functions.GEN_INLIST(untrimmedline.schemaId, "99999")))
                exception = 1
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If surgery performed and RX Date Surgery is blank,if year of Date of Diagnosis < 2012, RX Date Surgery Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If surgery performed and RX Date Surgery is blank, if year of Date of Diagnosis > 2011, RX Date Surgery Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || ((exception == 1 && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Summ--Scope Reg LN Sur = ${untrimmedline.rxSummScopeRegLnSur}, and RX Summ--Surg Oth Reg/Dis = ${untrimmedline.rxSummSurgOthRegDis}, RX Date Surgery Flag must = 11')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00778; TAG: N2223; NAME: TNM Clin Descriptor, Histologies - Ed 7 (COC)
    public boolean rqrs00778(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "1,2,5"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9738,9811-9818,9820-9837"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700,9701"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9823,9827, 9837,9811-9818") && functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9837,9811-9818") && functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 424", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699, 9702-9727, 9735, 9737, 9738") && functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00779; TAG: N2226; NAME: TNM Clin M Conv (COC)
    public boolean rqrs00779(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinM)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X,0,1", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(c0I\\+)"))
            return true
        return false

    }

    // ID: RQRS-00780; TAG: N2225; NAME: TNM Clin M, Date of Diagnosis (COC)
    public boolean rqrs00780(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinM)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0,1", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(c0I\\+)"))
            return true
        return false

    }

    // ID: RQRS-00781; TAG: N2346; NAME: TNM Clin N Conv (COC)
    public boolean rqrs00781(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X, 0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(c0I\\-)") || functions.GEN_MATCH(code, "(c0I\\+)") || functions.GEN_MATCH(code, "(c0M\\-)") || functions.GEN_MATCH(code, "(c0M\\+)") || functions.GEN_MATCH(code, "(c1MI)"))
            return true
        return false

    }

    // ID: RQRS-00782; TAG: N2227; NAME: TNM Clin N, Date of Diagnosis (COC)
    public boolean rqrs00782(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X, 0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        return false

    }

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

    }

    // ID: RQRS-00784; TAG: N2421; NAME: TNM Clin Stage Group, 2016 (COC)
    public boolean rqrs00784(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0A,0S,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-00785; TAG: N2392; NAME: TNM Clin Stage Group, Date of Diagnosis (COC)
    public boolean rqrs00785(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()} then TNM Clin Stage Group cannot be blank')
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00789; TAG: N2233; NAME: TNM Clin T Conv (COC)
    public boolean rqrs00789(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinT)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "X,0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "IS,SU, SD", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A,1B,1C,1D,1M, 2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E, A1,A2,B1,B2", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A1,1A2,1B1,1B2,1MI,2A1,2A2", "(c[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00790; TAG: N2466; NAME: TNM Clin T, Clin M (COC)
    public boolean rqrs00790(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "99"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return false
        return true

    }

    // ID: RQRS-00791; TAG: N2465; NAME: TNM Clin T, Clin N (COC)
    public boolean rqrs00791(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "99"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return false
        return true

    }

    // ID: RQRS-00792; TAG: N2232; NAME: TNM Clin T, Date of Diagnosis (COC)
    public boolean rqrs00792(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmClinT)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(code, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "X,0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A1,1A2,1B1,1B2,1MI,2A1,2A2", "(c[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00793; TAG: N2234; NAME: TNM Clin T, Histology, Grade, Thyroid (COC)
    public boolean rqrs00793(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C739"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8019, 8022-8029, 8033-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4") && functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c4,c4A,c4B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8020, 8021, 8030, 8031, 8032") && functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c4,c4A,c4B"))
                return false
        }
        return true

    }

    // ID: RQRS-00794; TAG: N2237; NAME: TNM Clin T, Surgery, Prostate (COC)
    public boolean rqrs00794(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8110,8140-8576,8940-8950, 8980-8981"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "1A,1B", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,99"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-00800; TAG: N2239; NAME: TNM Groups Not Stageable - Insitu (COC)
    public boolean rqrs00800(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_tnm_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,3")) {
            return true
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9811-9818, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "007,08A,08B,08C,08D,08E,08F,009,13B,16A,16B,17B,17C,018") || functions.GEN_INLIST(SiteGrp, "36B,36C, 37A,039,041,043,47A,47B,053,054,51A,51B,57B")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
                    return true
                else {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site (${untrimmedline.primarySite}), Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), and Behavior Code ICD-O-3 (${untrimmedline.behaviorIcdO3}): all TNM fields must = 88')
                }
            }
        }
        return true

    }

    // ID: RQRS-00801; TAG: N2462; NAME: TNM M, Mets at DX (COC)
    public boolean rqrs00801(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone) && functions.GEN_EMPTY(untrimmedline.metsDxBrain) && functions.GEN_EMPTY(untrimmedline.metsDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsDxLiver) && functions.GEN_EMPTY(untrimmedline.metsDxLung) && functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_INLIST(untrimmedline.metsDxBone, "8") && functions.GEN_INLIST(untrimmedline.metsDxBrain, "8") && functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "8") && functions.GEN_INLIST(untrimmedline.metsDxLiver, "8") && functions.GEN_INLIST(untrimmedline.metsDxLung, "8") && functions.GEN_INLIST(untrimmedline.metsDxOther, "8"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "1", "(c[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmClinM, "1A,1B,1C,1D,1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmClinM, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmClinM, "1A,1B,1C,1D,1E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathM, "1", "(c[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathM, "1A,1B,1C,1D,1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathM, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathM, "1A,1B,1C,1D,1E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
        
            if (functions.GEN_INLIST(untrimmedline.metsDxBone, "0") && functions.GEN_INLIST(untrimmedline.metsDxBrain, "0") && functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "0") && functions.GEN_INLIST(untrimmedline.metsDxLiver, "0") && functions.GEN_INLIST(untrimmedline.metsDxLung, "0") && functions.GEN_INLIST(untrimmedline.metsDxOther, "0"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Clin M = ${untrimmedline.tnmClinM} or TNM Path M = ${untrimmedline.tnmPathM}, at least 1 Mets at DX field must not = 0')
        }
        if (functions.GEN_INLIST(untrimmedline.metsDxBone, "1") || functions.GEN_INLIST(untrimmedline.metsDxBrain, "1") || functions.GEN_INLIST(untrimmedline.metsDxDistantLn, "1") || functions.GEN_INLIST(untrimmedline.metsDxLiver, "1") || functions.GEN_INLIST(untrimmedline.metsDxLung, "1") || functions.GEN_INLIST(untrimmedline.metsDxOther, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c0") && functions.GEN_INLIST(untrimmedline.tnmPathM, "c0"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If 1 Mets at DX field = 1, TNM Clin M and TNM Path M must not both = c0')
        }
        return true

    }

    // ID: RQRS-00802; TAG: 802; NAME: TNM M, Mets at DX, Melanoma of Skin  (CoC)
    public boolean rqrs00802(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.metsDxLung, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B, c1C, p1C") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B, c1C, p1B,p1C"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.metsDxLung, "0, 9")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B,p1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B, p1B")) {
            if (!functions.GEN_INLIST(untrimmedline.metsDxLung, "1"))
                return false
        }
        return true

    }

    // ID: RQRS-00803; TAG: 803; NAME: TNM M, SSF 4 Melanoma of Skin  (CoC)
    public boolean rqrs00803(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "010, 020, 030")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1A, c1B, p1A, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1A, c1B, p1A,p1B"))
                return false
        }
        return true

    }

    // ID: RQRS-00804; TAG: N2244; NAME: TNM N, Size Nodes, Site Spec - Ed 7 (COC)
    public boolean rqrs00804(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] NODECATEGORY = new char[100], NODELOW = new char[4], NODEHIGH = new char[4], GPNODECAT = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        char[] t_GrpNPcode = new char[14]
        char[] t_GRpNPnode = new char[14]
        char[] t_GrpNCcode = new char[14]
        char[] t_GrpNCnode = new char[14]
        char[] nodessf = new char[4]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04A, 04B, 04C, 04D, 05A, 05B, 006, 007, 029")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "003, 04B, 04A, 04C, 04D, 05A, 05B, 006, 007"))
            functions.GEN_STRCPY(nodessf, untrimmedline.csSiteSpecificFactor1)
        else {
            if (functions.GEN_INLIST(SiteGrp, "029")) {
                functions.GEN_STRCPY(nodessf, untrimmedline.csSiteSpecificFactor16)
            }
        }
        if (functions.GEN_INLIST(nodessf, "990, 991, 992, 993"))
            functions.GEN_STRCPY(nodessf, "030")
        if (functions.GEN_INLIST(nodessf, "994, 995, 996"))
            functions.GEN_STRCPY(nodessf, "050")
        if (functions.GEN_INLIST(nodessf, "997"))
            functions.GEN_STRCPY(nodessf, "061")
        if (functions.GEN_INLIST(nodessf, "999"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(t_GrpNCcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNCcode, untrimmedline.tnmClinN)
            functions.GEN_STRCPY(t_GrpNCnode, t_GrpNCcode)
            functions.GEN_STRCAT(t_GrpNCnode, nodessf)
        
            if (functions.GEN_LOOKUP(t_GrpNCcode, context.RQRS_NODESIZE, context.RQRS_NODESIZE_GPNODECAT, ['GPCODE':GPCODE, 'NODELOW':NODELOW, 'NODEHIGH':NODEHIGH, 'GPNODECAT':GPNODECAT])) {
                if (functions.GEN_STRCMP(nodessf, NODELOW) < 0 || functions.GEN_STRCMP(nodessf, NODEHIGH) > 0) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N of ${untrimmedline.tnmClinN} is not consistent with coded size of nodes')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(t_GrpNPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNPcode, untrimmedline.tnmPathN)
            functions.GEN_STRCPY(t_GRpNPnode, t_GrpNPcode)
            functions.GEN_STRCAT(t_GRpNPnode, nodessf)
        
            if (functions.GEN_LOOKUP(t_GrpNPcode, context.RQRS_NODESIZE, context.RQRS_NODESIZE_GPNODECAT, ['GPCODE':GPCODE, 'NODELOW':NODELOW, 'NODEHIGH':NODEHIGH, 'GPNODECAT':GPNODECAT])) {
                if (functions.GEN_STRCMP(nodessf, NODELOW) >= 0 && functions.GEN_STRCMP(nodessf, NODEHIGH) <= 0)
                    return true
                else {
                    if (functions.GEN_STRCMP(nodessf, NODELOW) < 0 || functions.GEN_STRCMP(nodessf, NODEHIGH) > 0) {
                        if (functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                            functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                            functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                            functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                            return functions.GEN_ERROR_MSG(binding, 'TNM Path N of ${untrimmedline.tnmPathN} is not consistent with coded size of nodes')
                        }
                        else {
                            if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                                functions.GEN_STRCPY(t_GrpNCcode, SiteGrp)
                                functions.GEN_STRCAT(t_GrpNCcode, untrimmedline.tnmClinN)
                                functions.GEN_STRCPY(t_GrpNCnode, t_GrpNCcode)
                                functions.GEN_STRCAT(t_GrpNCnode, nodessf)
        
        
                                if (functions.GEN_LOOKUP(t_GrpNCcode, context.RQRS_NODESIZE, context.RQRS_NODESIZE_GPNODECAT, ['GPCODE':GPCODE, 'NODELOW':NODELOW, 'NODEHIGH':NODEHIGH, 'GPNODECAT':GPNODECAT])) {
                                    if (functions.GEN_STRCMP(nodessf, NODELOW) < 0 || functions.GEN_STRCMP(nodessf, NODEHIGH) > 0) {
                                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin N of ${untrimmedline.tnmClinN} and TNM Path N of ${untrimmedline.tnmPathN} not consistent with coded size of nodes')
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00805; TAG: 805; NAME: TNM N, SSF 3 Melanoma of Skin  (CoC)
    public boolean rqrs00805(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "c0,p0,p2C, pX"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "pX,p1A,p2A,p3"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "043")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "045")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "048")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "100")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        return true

    }

    // ID: RQRS-00806; TAG: N2247; NAME: TNM N, SSF 3, 5 Corpus Uteri (COC)
    public boolean rqrs00806(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[100], CSSSF5 = new char[100], NODES = new char[100], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "540-559", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8790,8950-8951,8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "p0", "(p[A-Za-z0-9]\\s\\s)"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), and CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5})')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "001-090, 095, 097") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "001-090, 095, 097")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathN, "c0, p0") && functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Clin N (${untrimmedline.tnmClinN}), TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), and CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5})')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "098, 999") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "098, 999")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathN) && !functions.GEN_INLIST(untrimmedline.tnmPathN, "c0, pX"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), and CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5})')
        }
        return true

    }

    // ID: RQRS-00807; TAG: N2248; NAME: TNM N, SSF 4, 6 Fallopian Tube (COC)
    public boolean rqrs00807(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[100], CSSSF5 = new char[100], NODES = new char[100], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "570", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) && functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p0", "(p[A-Za-z0-9]\\s\\s)")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000, 098") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000, 098"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}), and CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6})')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "001-090, 095, 097") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "001-090, 095, 097")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathN, "c0, p0") && functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Clin N (${untrimmedline.tnmClinN}), TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}), and CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6})')
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "c0", "(c[A-Za-z0-9]\\s\\s)")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "098, 999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "098, 999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}), and CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6})')
        }
        return true

    }

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

    }

    // ID: RQRS-00809; TAG: N2253; NAME: TNM Path M Conv (COC)
    public boolean rqrs00809(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathM)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X,0,1", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0,1", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E, 1M", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1M1", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(c0I\\+)"))
            return true
        return false

    }

    // ID: RQRS-00810; TAG: N2252; NAME: TNM Path M, Date of Diagnosis (COC)
    public boolean rqrs00810(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathM)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(code, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0,1", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(c0I\\+)"))
            return true
        return false

    }

    // ID: RQRS-00811; TAG: N2255; NAME: TNM Path N Conv (COC)
    public boolean rqrs00811(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X,0-4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 1M, 2A, 2B, 2C, 3A, 3B, 3C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(p0I\\-)") || functions.GEN_MATCH(code, "(p0I\\+)") || functions.GEN_MATCH(code, "(p0M\\-)") || functions.GEN_MATCH(code, "(p0M\\+)") || functions.GEN_MATCH(code, "(p1MI)") || functions.GEN_MATCH(code, "(pI\\-\\s)") || functions.GEN_MATCH(code, "(pI\\+\\s)") || functions.GEN_MATCH(code, "(pM\\-\\s)") || functions.GEN_MATCH(code, "(pM\\+\\s)"))
            return true
        if (functions.GEN_INLIST(code, "c0"))
            return true
        return false

    }

    // ID: RQRS-00812; TAG: N2254; NAME: TNM Path N, Date of Diagnosis (COC)
    public boolean rqrs00812(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X, 0-4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_MATCH(code, "(p0I\\-)") || functions.GEN_MATCH(code, "(p0I\\+)") || functions.GEN_MATCH(code, "(p0M\\-)") || functions.GEN_MATCH(code, "(p0M\\+)") || functions.GEN_MATCH(code, "(p1MI)"))
            return true
        if (functions.GEN_INLIST(code, "X, 0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00813; TAG: N2256; NAME: TNM Path N, Reg Nodes Ex - Ed 7 (COC)
    public boolean rqrs00813(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "180,182-189,199,209", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8152,8154-8231,8243-8245,8247-8248,8250-8576,8940-8950,8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440,442-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8247")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576,8940-8950,8980-8981,9020")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "540-549,559", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8790, 8950-8951, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1,2", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9738,9811-9818,9820-9837")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "3,4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "pX, c0"))
                return false
        }
        return true

    }

    // ID: RQRS-00814; TAG: N2257; NAME: TNM Path N, Reg Nodes Pos - Ed 7 (COC)
    public boolean rqrs00814(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "180,182-189,199,209", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8152,8154-8231,8243-8245,8247-8248,8250-8576,8940-8950,8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440,442-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8247")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576,8940-8950,8980-8981,9020")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "540-549,559", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8790, 8950-8951, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1,2", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9738,9811-9818,9820-9837")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "3,4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1,2,3", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathN, "1A,1B,1C,1M,2A,2B,2C,3A,3B,3C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathN, "1MI", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98,99"))
                return false
        }
        return true

    }

    // ID: RQRS-00815; TAG: N2258; NAME: TNM Path N, Reg Nodes Pos,Ex, Breast - Ed 7 (COC)
    public boolean rqrs00815(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981, 9020")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0((I)|(M))((\\+)|(\\-)))")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00, 99"))
                return false
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00"))
                return false
        }
        return true

    }

    // ID: RQRS-00816; TAG: 816; NAME: TNM Path N, RNP, Site Spec - Ed 7, ICDO3 (COC)
    public boolean rqrs00816(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHN = new char[5], NODELOW = new char[3], NODEHIGH = new char[3], GPPATHN = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        char[] t_GrpNPcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "95, 97"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04A,  04D, 05A, 05B, 006, 007, 10A, 10B, 011, 012") && !functions.GEN_INLIST(SiteGrp, "13A, 13B, 014,029, 031, 032, 033, 040, 042, 044, 045, 046"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(t_GrpNPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNPcode, untrimmedline.tnmPathN)
        }
        if (functions.GEN_LOOKUP(t_GrpNPcode, context.RQRS_PATHNNUM, context.RQRS_PATHNNUM_GPPATHN, ['GPCODE':GPCODE, 'PATHN':PATHN, 'NODELOW':NODELOW, 'NODEHIGH':NODEHIGH, 'GPPATHN':GPPATHN])) {
            if (functions.GEN_STRCMP(untrimmedline.regionalNodesPositive, NODELOW) < 0 || functions.GEN_STRCMP(untrimmedline.regionalNodesPositive, NODEHIGH) > 0) {
                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                return functions.GEN_ERROR_MSG(binding, 'TNM Path N of ${untrimmedline.tnmPathN} is not consistent with Regional Nodes Positive of ${untrimmedline.regionalNodesPositive}')
            }
        }
        return true

    }

    // ID: RQRS-00817; TAG: N2260; NAME: TNM Path N, SSF 3, 4, 5 Breast (COC)
    public boolean rqrs00817(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[4], CSSSF5 = new char[4], NODES = new char[5], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981, 9020"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988")) {
            if (functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0\\s\\s)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0I\\-)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0I\\+)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0M\\-)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0M\\+)")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N (${untrimmedline.tnmPathN}) and CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3})')
            }
            if (functions.GEN_INLIST(untrimmedline.tnmPathN, "pX, c0")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "097, 098, 099"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N (${untrimmedline.tnmPathN}) and CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3})')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000") && functions.GEN_INLIST(untrimmedline.tnmPathN, "c0"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000") && functions.GEN_INLIST(untrimmedline.tnmClinN, "c0") && functions.GEN_INLIST(untrimmedline.tnmPathN, "pX"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "987") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "987") && functions.GEN_INLIST(untrimmedline.tnmPathN, "pX"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "987") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "987") && functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0I\\+)"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))
            functions.GEN_STRCPY(nodes45, untrimmedline.csSiteSpecificFactor4)
        functions.GEN_STRCAT(nodes45, untrimmedline.csSiteSpecificFactor5)
        
        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988")) {
            if (functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0\\s\\s)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0I\\-)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0I\\+)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0M\\-)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0M\\+)") || functions.GEN_MATCH(untrimmedline.tnmPathN, "(pX\\s\\s)"))
                functions.GEN_STRCPY(pnodes, untrimmedline.tnmPathN)
            else {
                if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p1, p2, p1MI, p1A, p1B, p1C, p2, p2A, p2B, p3, p3A, p3B, p3C"))
                    functions.GEN_STRCPY(pnodes, "p1")
            }
            if (functions.GEN_LOOKUP(nodes45, context.RQRS_BREAST45, context.RQRS_BREAST45_SS4SS5, ['NODES':NODES, 'SS4SS5':SS4SS5])) {
                if (functions.GEN_STRCMP(functions.GEN_TRIM(pnodes, ((Integer)context.RQRS_GEN_RIGHT)), NODES) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N (${untrimmedline.tnmPathN}), CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}), and CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5}) conflict')
            }
        }
        return true

    }

    // ID: RQRS-00818; TAG: N2261; NAME: TNM Path N, SSF 4 Colon (COC)
    public boolean rqrs00818(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "180, 182-189,  199, 209", "(C\\d\\d\\d)", 2, 3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8152, 8154-8231, 8243-8245,8247-8248") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8250-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p1C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p1C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000, 998, 999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "p0", "(p[A-Za-z0-9]\\s\\s)")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000, 998, 999"))
                return false
        }
        return true

    }

    // ID: RQRS-00819; TAG: N0039; NAME: TNM Path Stage Group (COC)
    public boolean rqrs00819(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A,0S,1A,A1,A2,1B,B1,B2,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "1E,1S,2E,2S,3E,3S,4E,4S", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-00820; TAG: N2423; NAME: TNM Path Stage Group, 2016 (COC)
    public boolean rqrs00820(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 && dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A,0S,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-00821; TAG: N2395; NAME: TNM Path Stage Group, Date of Diagnosis (COC)
    public boolean rqrs00821(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()} then TNM Path Stage Group cannot be blank')
        }
        return true

    }

    // ID: RQRS-00822; TAG: 822; NAME: TNM Path Stage Group, Prim Site, Surg - Ed 7(CoC)
    public boolean rqrs00822(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "670-679", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-98"))
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site (${untrimmedline.primarySite}), Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}): RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) must = 30-90.')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0", "([A-Za-z0-9]\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98"))
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site (${untrimmedline.primarySite}), Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}): RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) must = 20 - 90')
            }
        }
        
        return true

    }

    // ID: RQRS-00823; TAG: N0862; NAME: TNM Path Stage Group, TNM Items, ICDO3 (COC)
    public boolean rqrs00823(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9596,9650-9667,9670-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'If TNM Path Stage Group not = 88, then TNM Path T and M must not = 88')
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                    return false
            }
        }
        return true

    }

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

    }

    // ID: RQRS-00825; TAG: N0928; NAME: TNM Path Staged By, Date of Diagnosis (COC)
    public boolean rqrs00825(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2008) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
                return false
        }
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
                return false
        }
        return true

    }

    // ID: RQRS-00826; TAG: N2264; NAME: TNM Path T Conv (COC)
    public boolean rqrs00826(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathT)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X,A,0-4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "IS,1A,1B,1C,1D,1M,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E,A1,A2,B1,B2", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A1,1A2,1B1,1B2,1MI,2A1,2A2, ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00827; TAG: N2263; NAME: TNM Path T, Date of Diagnosis (COC)
    public boolean rqrs00827(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathT)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (functions.GEN_INLIST(code, "X,A,0-4", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "IS,1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A1,1A2,1B1,1B2,1MI,2A1,2A2, ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "X,0-4", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
            return true
        if (functions.GEN_INLIST(code, "1A1,1A2,1B1,1B2,1MI,2A1,2A2", "(c[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        return false

    }

    // ID: RQRS-00828; TAG: 828; NAME: TNM Path T, Depth, Melanoma- Ed 7, ICDO3 (CoC)
    public boolean rqrs00828(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHT = new char[5], SIZELOW = new char[4], SIZEHIGH = new char[4]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTPcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] ssfdepth = new char[4]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "031, 050"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "031,050")) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988, 999"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "031, 050"))
            functions.GEN_STRCPY(ssfdepth, untrimmedline.csSiteSpecificFactor1)
        if (functions.GEN_INLIST(SiteGrp, "050")) {
            if (functions.GEN_INLIST(ssfdepth, "991"))
                functions.GEN_STRCPY(ssfdepth, "005")
            if (functions.GEN_INLIST(ssfdepth, "992,993,994,995"))
                functions.GEN_STRCPY(ssfdepth, "150")
            if (functions.GEN_INLIST(ssfdepth, "996"))
                functions.GEN_STRCPY(ssfdepth, "980")
            if (functions.GEN_INLIST(ssfdepth, "998") && functions.GEN_INLIST(untrimmedline.tnmPathT, "p1A, p1B, p1C, p2A, p2B, p2C"))
                return false
        }
        if (functions.GEN_INLIST(SiteGrp, "031, 050")) {
            functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        }
        if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['GPCODE':GPCODE, 'PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
            if (functions.GEN_STRCMP(ssfdepth, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdepth, SIZEHIGH) > 0)
                return false
        }
        return true

    }

    // ID: RQRS-00829; TAG: N2266; NAME: TNM Path T, Primary Site, Surgery - Ed 7 (COC)
    public boolean rqrs00829(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_tnm_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        functions.GEN_STRCPY(code, untrimmedline.tnmPathT)
        
        if (functions.GEN_INLIST(SiteGrp, "003,04A,04D,05A,05B,006,007,08A,08B,08C,08D,08E,08F") || functions.GEN_INLIST(SiteGrp, "009,10A,10B,011,13A,014,031,51B")) {
            if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,1M,2A,2B,2C,2D,3A,3B,3C,3D,4A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return false
                }
            }
        }
        else {
            if (functions.GEN_INLIST(SiteGrp, "04B,04C,012,13B,015,16A,16B,17A,17B,17C,020-026,029,030,034,035") || functions.GEN_INLIST(SiteGrp, "36A,36B,36C,37A,37B,038,040,042,044,46A,46B,47A,47B,048,050,054,57B")) {
                if (functions.GEN_INLIST(code, "1, 2, 3", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                    if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                        return false
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "032,049")) {
                    if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B, 1C,1D,2A,2B,2C,2D,3A,3B,3C,3D", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(code, "4A,4B,4C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(code, "M1I", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3)) {
                        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                            functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                            functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                            functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                            return false
                        }
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "039")) {
                        if (functions.GEN_INLIST(code, "1", "(p[A-Za-z0-9]\\s\\s)", 2, 3)) {
                            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                return false
                            }
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "027,033")) {
                            if (functions.GEN_INLIST(code, "1, 2", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                    return false
                                }
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "028")) {
                                if (functions.GEN_INLIST(code, "1,2", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                    if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                        return false
                                    }
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "043")) {
                                    if (functions.GEN_INLIST(code, "1, 2, 3", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                            functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                            functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                            functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                            return false
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "052")) {
                                        if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                return false
                                            }
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                            if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                    return false
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "51A")) {
                                                if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98")) {
                                                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                        return false
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "041")) {
                                                    if (functions.GEN_INLIST(code, "2", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "2A,2B,2C", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                                                        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-98")) {
                                                            functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                            functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                            functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                            return false
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "042")) {
            if (functions.GEN_INLIST(code, "0,1,2,3", "(p[A-Za-z0-9]\\s\\s)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40-98")) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "045")) {
            if (functions.GEN_INLIST(code, "1, 2, 3, 4", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(code, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,4A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-98")) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-00830; TAG: 830; NAME: TNM Path T, SSF 2, 7 Melanoma Skin  (COC)
    public boolean rqrs00830(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "1A, 2A, 3A, 4A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "2B, 3B, 4B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "1B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "000, 990,998"))
                return false
        }
        return true

    }

    // ID: RQRS-00831; TAG: N2271; NAME: TNM Path T, SSF 3 Prostate (COC)
    public boolean rqrs00831(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8110, 8140-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "200, 300, 320, 400")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "210, 330, 402")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "220, 340, 404")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "230, 350, 406")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2C"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "495")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "415, 420, 430, 480, 482, 483")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "485, 490")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "500, 510, 520, 600, 700, 750")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p4"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960, 970, 980")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && !functions.GEN_INLIST(untrimmedline.tnmPathT, "pX,p3,p3A,p3B,p4"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "985, 990")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pX"))
                return false
        }
        return true

    }

    // ID: RQRS-00832; TAG: N2274; NAME: TNM T, Clin and Path Stage, Behavior 2 (COC)
    public boolean rqrs00832(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_tnm_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        char[] pTcode = new char[5]
        char[] cTcode = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        functions.GEN_STRCPY(cTcode, untrimmedline.tnmClinT)
        
        functions.GEN_STRCPY(pTcode, untrimmedline.tnmPathT)
        
        
        if (functions.GEN_EMPTY(pTcode)) {
        
            if (functions.GEN_INLIST(SiteGrp, "032") && functions.GEN_INLIST(cTcode, "pIS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8540,8541,8543"))
                return true
            if (functions.GEN_INLIST(SiteGrp, "040") && functions.GEN_INLIST(cTcode, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
            if (functions.GEN_INLIST(SiteGrp, "045") && functions.GEN_INLIST(cTcode, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return true
            if (!functions.GEN_INLIST(SiteGrp, "014,13A,17A,050")) {
                if ((functions.GEN_INLIST(cTcode, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0A")) || (functions.GEN_INLIST(cTcode, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0,0S,0IS")) || (functions.GEN_INLIST(cTcode, "ISU,ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0,0S,0IS"))) {
                    if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                        return functions.GEN_ERROR_MSG(binding, 'Behavior must = 2 for this combination of clin and path TNM')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(pTcode)) {
        
            if (functions.GEN_INLIST(SiteGrp, "032") && functions.GEN_INLIST(pTcode, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8540,8541,8543"))
                return true
            if (functions.GEN_INLIST(SiteGrp, "040") && functions.GEN_INLIST(pTcode, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
            if (functions.GEN_INLIST(SiteGrp, "045") && functions.GEN_INLIST(pTcode, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return true
            if (!functions.GEN_INLIST(SiteGrp, "014,13A,17A,050") && !functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6")) {
                if ((functions.GEN_INLIST(pTcode, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A")) || (functions.GEN_INLIST(pTcode, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0,0S,0IS")) || (functions.GEN_INLIST(pTcode, "ISU,ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0,0S,0IS"))) {
                    if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                        return functions.GEN_ERROR_MSG(binding, 'Behavior must = 2 for this combination of clin and path TNM')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00833; TAG: N2275; NAME: TNM T, Clin and Path Stage, Behavior 3 (COC)
    public boolean rqrs00833(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_tnm_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "cX", "(c[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinM, "cX", "(c[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "99") && functions.GEN_INLIST(untrimmedline.tnmPathT, "pX", "(p[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathN, "pX", "(p[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathM, "pX, cX") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "99"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7")) {
            return true
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "pA, pIS, pISU, pISD") && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0, 0A, 0IS")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior must = 3 for this combination of clin and path TNM')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pA, pIS, pISU, pISD") && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0,0A, 0IS") && !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0,0A, 0IS")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior must = 3 for this combination of clin and path TNM')
                }
            }
        }
        return true

    }

    // ID: RQRS-00834; TAG: N2282; NAME: TNM T, SSF 1, 2 Lung (COC)
    public boolean rqrs00834(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010, 040")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c3, c4", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p3, p4", "(p[A-Za-z0-9]\\s\\s)"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) conflicts with TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT})')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020, 030")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c4", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p4", "(p[A-Za-z0-9]\\s\\s)"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) conflicts with TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT})')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010, 020, 040")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c2, c3, c4, c2A, c2B") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p2, p3, p4, p2A, p2B"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) conflicts with TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT})')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c3, c4", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p3, p4", "(p[A-Za-z0-9]\\s\\s)"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) conflicts with TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT})')
            }
        }
        return true

    }

    // ID: RQRS-00835; TAG: 835; NAME: TNM T, SSF 6, Breast (CoC)
    public boolean rqrs00835(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[100], CSSSF5 = new char[100], NODES = new char[100], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981, 9020"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "pIS")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pIS"))
                return false
        }
        return true

    }

    // ID: RQRS-00836; TAG: 836; NAME: TNM T, SSize, Site Spec - Ed 7, ICDO3 (CoC)
    public boolean rqrs00836(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHT = new char[5], TSIZELOW = new char[4], TSIZEHIGH = new char[4], GPPATHT = new char[100], CLINT = new char[5], GPCLINT = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        char[] t_GrpTPcode = new char[10]
        char[] t_GrpTCcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "999"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary) || functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "999"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04A")) {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "129, 130-139", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "04E")
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "17B")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "241", "(C\\d\\d\\d)", 2, 3))
                                functions.GEN_STRCPY(SiteGrp, "17D")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "04D")
                                else {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                            functions.GEN_STRCPY(SiteGrp, "08A")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                                functions.GEN_STRCPY(SiteGrp, "08B")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "08C")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                            functions.GEN_STRCPY(SiteGrp, "08F")
                                        else
                                            functions.GEN_STRCPY(SiteGrp, "999")
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                            functions.GEN_STRCPY(SiteGrp, "08D")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                                functions.GEN_STRCPY(SiteGrp, "08F")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                                    functions.GEN_STRCPY(SiteGrp, "16A")
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                            functions.GEN_STRCPY(SiteGrp, "020")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                                functions.GEN_STRCPY(SiteGrp, "022")
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                                        else
                                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04A, 04D, 04E, 007, 015, 024, 025, 027, 028, 029, 030, 032, 47A, 47B") && !functions.GEN_INLIST(SiteGrp, "043, 049, 053, 054, 08A, 08B, 08C, 08D, 13B, 16A, 16B, 17A, 17B, 17D, 17E"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "025") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2A") || functions.GEN_INLIST(untrimmedline.tnmPathT, "p2A"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1, c1A, c1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                return true
            else {
                functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
                functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
                if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_CLINTSIZ, context.RQRS_CLINTSIZ_GPCLINT, ['GPCODE':GPCODE, 'CLINT':CLINT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPCLINT':GPCLINT])) {
                    if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin T of ${untrimmedline.tnmClinT} is not consistent with Tumor Size Summary of ${untrimmedline.tumorSizeSummary}')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1, p1A, p1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                return true
            else {
                functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
                functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        
                if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_PATHTSIZ, context.RQRS_PATHTSIZ_GPPATHT, ['GPCODE':GPCODE, 'PATHT':PATHT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPPATHT':GPPATHT])) {
                    if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) <= 0)
                        return true
                    else {
                        if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                return functions.GEN_ERROR_MSG(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with Tumor Size Summary of ${untrimmedline.tumorSizeSummary}')
                            }
                            else {
                                if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                                    if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1, c1A, c1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                                        return true
                                    else {
                                        functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
                                        functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
                                        if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_CLINTSIZ, context.RQRS_CLINTSIZ_GPCLINT, ['GPCODE':GPCODE, 'CLINT':CLINT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPCLINT':GPCLINT])) {
                                            if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                return functions.GEN_ERROR_MSG(binding, 'Tumor Size Summary of ${untrimmedline.tumorSizeSummary} is not consistent with TNM Clin T of ${untrimmedline.tnmClinT} and TNM Path T of ${untrimmedline.tnmPathT}')
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00837; TAG: N0015; NAME: Tumor Marker 1 (SEER TUMMARK1)
    public boolean rqrs00837(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker1))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6,8,9")

    }

    // ID: RQRS-00838; TAG: N0191; NAME: Tumor Marker 1, Primary Site, Morph ICDO2 (COC)
    public boolean rqrs00838(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.morphologyIcdO2))
            return true
        if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180-189,199,209,220,221,569,619", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "95003")) {
            if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3, 8,9"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6, 8, 9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
                    return true
                else
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-00839; TAG: N0477; NAME: Tumor Marker 1, Primary Site, Morph ICDO3 (COC)
    public boolean rqrs00839(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.morphologyIcdO3))
            return true
        if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180-189,199,209,220,221,569,619", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "95003")) {
            if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3, 8,9"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6, 8, 9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
                    return true
                else
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-00840; TAG: N0016; NAME: Tumor Marker 2 (SEER TUMMARK2)
    public boolean rqrs00840(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker2))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-6,8,9")

    }

    // ID: RQRS-00841; TAG: N0192; NAME: Tumor Marker 2, Primary Site (COC)
    public boolean rqrs00841(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker2) || functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,619", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8,9"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-6,8,9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9"))
                    return true
                else
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-00842; TAG: N0288; NAME: Tumor Marker 3 (SEER TUMMARK3)
    public boolean rqrs00842(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker3))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorMarker3, "0-6,8,9")

    }

    // ID: RQRS-00843; TAG: N0264; NAME: Tumor Marker 3, Primary Site (COC)
    public boolean rqrs00843(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorMarker3) || functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "0-6,8,9"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "9"))
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-00844; TAG: N2147; NAME: Tumor Size Summary (NPCR)
    public boolean rqrs00844(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000-990, 998, 999", "(\\d\\d\\d)")

    }

    // ID: RQRS-00845; TAG: N2148; NAME: Tumor Size Summary, Date of Diagnosis (NPCR)
    public boolean rqrs00845(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00847; TAG: N2293; NAME: Tumor Size Summary, TNM Clin/Path T (COC)
    public boolean rqrs00847(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000")) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p0"))
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000")) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c0"))
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT) && !functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p0") || !functions.GEN_INLIST(untrimmedline.tnmClinT, "c0"))
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c0") && functions.GEN_INLIST(untrimmedline.tnmPathT, "p0")) {
            if (!functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-00849; TAG: 849; NAME: Date of Last Contact (NCDB)
    public boolean rqrs00849(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int last_day
        last_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (last_day == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact or Death not valid')
            return false
        }
        if ((last_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY)))
            return functions.GEN_ERROR_MSG(binding, 'Need the full Date of Last Contact - year month day - for RQRS')
        
        return true

    }

    // ID: RQRS-00850; TAG: N2229; NAME: TNM Clin N, Digestive, Assess Nodes SSF (COC)
    public boolean rqrs00850(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] cN = new char[5]
        char[] pN = new char[5]
        char[] NodesSSF = new char[4]
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) || functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "10A, 10B, 011, 012, 13A, 13B, 014, 17A, 17C"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10A, 10B, 011, 17A"))
            functions.GEN_STRCPY(NodesSSF, untrimmedline.csSiteSpecificFactor1)
        if (functions.GEN_INLIST(SiteGrp, "012, 13A, 13B, 014, 17C"))
            functions.GEN_STRCPY(NodesSSF, untrimmedline.csSiteSpecificFactor2)
        if (functions.GEN_EMPTY(NodesSSF) || functions.GEN_INLIST(NodesSSF, "988"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10A, 10B, 011")) {
            if (functions.GEN_INLIST(NodesSSF, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "100")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "200")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "300")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "400")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "999")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "012,13A, 014 ")) {
            if (functions.GEN_INLIST(NodesSSF, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "100")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "200")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "400")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "999")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "011")) {
            if (functions.GEN_INLIST(NodesSSF, "310")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3A", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "320")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3B", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "014")) {
            if (functions.GEN_INLIST(NodesSSF, "010")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1A", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "020")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1B", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "110")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2A", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "120")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2B", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "17A")) {
            if (functions.GEN_INLIST(NodesSSF, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "100, 200, 300, 400")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
            if (functions.GEN_INLIST(NodesSSF, "999")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 1: ${untrimmedline.csSiteSpecificFactor1} conflict')
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "13B, 17C")) {
            if (functions.GEN_INLIST(NodesSSF, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "100, 200, 400")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(NodesSSF, "999")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin N: ${untrimmedline.tnmClinN} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
        }
        return true

    }

    // ID: RQRS-00851; TAG: 851; NAME: TNM M, SSF 3  Kidney (COC)
    public boolean rqrs00851(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020, 030")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "p1") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "p1"))
                return false
        }
        return true

    }

    // ID: RQRS-00852; TAG: N2468; NAME: TNM Path T, Path M (COC)
    public boolean rqrs00852(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "99"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return false
        return true

    }

    // ID: RQRS-00853; TAG: N2467; NAME: TNM Path T, Path N (COC)
    public boolean rqrs00853(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "99"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if ((functions.GEN_INLIST(untrimmedline.tnmPathT, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathT, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathT, "ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3)) && functions.GEN_INLIST(untrimmedline.tnmClinN, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (functions.GEN_INLIST(SiteGrp, "16A, 16B, 027,028") && functions.GEN_INLIST(untrimmedline.tnmClinN, "0,1", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (functions.GEN_INLIST(SiteGrp, "031") && functions.GEN_INLIST(untrimmedline.tnmPathT, "1A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && functions.GEN_INLIST(untrimmedline.tnmClinN, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (functions.GEN_INLIST(SiteGrp, "36A") && functions.GEN_INLIST(untrimmedline.tnmClinN, "0, 1, 2", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return false
        return true

    }

    // ID: RQRS-00854; TAG: N2443; NAME: TNM Clin T, N, M, In Situ (COC)
    public boolean rqrs00854(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] t_msg = new char[79]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && !functions.GEN_INLIST(untrimmedline.tnmClinT, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) && !functions.GEN_INLIST(untrimmedline.tnmClinT, "ISU,ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "007,08A,08B,08C,08D,08E,08F,009,13B,016,17B,17C,018, 36B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "36C, 37A,039,041,043,047,51A, 51B, 053,054,57B"))
            return true
        functions.GEN_STRCPY(t_msg, "Set CS Over-ride 1 to 1 if codes reviewed and confirmed to be correct")
        
        if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0, c0A, c0B")) {
            functions.GEN_SAVE_TEXT(binding, '_ms')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Clin T (${untrimmedline.tnmClinT}), TNM Clin N (${untrimmedline.tnmClinN}) must be coded as negative for involvement')
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c0, c0I+")) {
            functions.GEN_SAVE_TEXT(binding, '_ms')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Clin T (${untrimmedline.tnmClinT}), TNM Clin M (${untrimmedline.tnmClinM}) must be coded as negative for involvement')
        }
        if (!functions.GEN_INLIST(SiteGrp, "049,050")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0, 0A, 0IS")) {
                functions.GEN_SAVE_TEXT(binding, '_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Clin T (${untrimmedline.tnmClinT}), TNM Clin Stage Group (${untrimmedline.tnmClinStageGroup}) must be coded in situ stage group')
            }
        }
        return true

    }

    // ID: RQRS-00855; TAG: N2442; NAME: TNM Path T, N, M, In Situ (COC)
    public boolean rqrs00855(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) && !functions.GEN_INLIST(untrimmedline.tnmPathT, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) && !functions.GEN_INLIST(untrimmedline.tnmPathT, "ISU,ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "007,08A,08B,08C,08D,08E,08F,009,13B,016,17B,17C,018, 36B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "36C, 37A,039,041,043,047,51A, 51B, 053,054,57B"))
            return true
        functions.GEN_STRCPY(t_msg, "Set Over-ride TNM Tis to 1 if codes reviewed and confirmed to be correct")
        
        if (functions.GEN_INLIST(SiteGrp, "045")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathN) && !functions.GEN_INLIST(untrimmedline.tnmPathN, "c0, p0")) {
                functions.GEN_SAVE_TEXT(binding, '_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path N (${untrimmedline.tnmPathN}) must be coded as negative for involvement')
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathM) && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c0", "(c[A-Za-z0-9]\\s\\s)")) {
                functions.GEN_SAVE_TEXT(binding, '_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path M (${untrimmedline.tnmPathM}) must be coded as negative for involvement')
            }
            if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A,0IS, 99")) {
                functions.GEN_SAVE_TEXT(binding, '_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}) must be coded in situ stage group')
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "045")) {
                if (!functions.GEN_MATCH(untrimmedline.tnmPathN, "(p0((I)|(M))((\\+)|(\\-)))") && !functions.GEN_MATCH(untrimmedline.tnmPathN, "(((c)|(p))0\\s\\s)")) {
                    functions.GEN_SAVE_TEXT(binding, '_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path N (${untrimmedline.tnmPathN}) must be coded as negative for involvement')
                }
                if (!functions.GEN_INLIST(untrimmedline.tnmPathM, "c0,c0I+")) {
                    functions.GEN_SAVE_TEXT(binding, '_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path M (${untrimmedline.tnmPathM}) must be coded as negative for involvement')
                }
                if (!functions.GEN_INLIST(SiteGrp, "049,050")) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0, 0A, 0IS, 99")) {
                        functions.GEN_SAVE_TEXT(binding, '_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'For TNM Path T (${untrimmedline.tnmPathT}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}) must be coded in situ stage group')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00856; TAG: 857; NAME: Date of 1st Contact, Date of Diagnosis (RQRS)
    public boolean rqrs00856(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact))
                return false
        }
        return true

    }

    // ID: RQRS-00857; TAG: N2815; NAME: _SYS AJCC ID (NAACCR)
    public boolean rqrs00857(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] AJCCID = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID_AJCCID, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID_AJCCID_AJCCID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCCID':AJCCID]))
            return false
        return true

    }

    // ID: RQRS-00858; TAG: N2822; NAME: _SYS AJCC ID, Date of Diagnosis (NAACCR)
    public boolean rqrs00858(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-00859; TAG: N4203; NAME: _SYS AJCC ID, Date of Diagnosis, CoC Flag (SEER)
    public boolean rqrs00859(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-00860; TAG: N2843; NAME: _SYS AJCC ID, Primary Site, Histology, Behavior (NAACCR)
    public boolean rqrs00860(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[5], GPNAME = new char[26], BEHAVIOR = new char[2], SCDSCR1 = new char[2], SCDSCR2 = new char[2]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] t_schema_msg = new char[100]
        
        char[] SD1 = new char[1]
        char[] SD2 = new char[1]
        char[] age = new char[4]
        
        char[] group = new char[4]
        
        char[] Site_Hist_SD = new char[30]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, untrimmedline.schemaDiscriminator1)
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
            functions.GEN_STRCPY(SD2, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2)) {
            functions.GEN_STRCPY(SD2, untrimmedline.schemaDiscriminator2)
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8313, 8380, 8442, 8472, 8474, 9000,8806,8930-8931") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000,8010,8020,8041,8044,8070,8120,8140,8240,8243,8310,8323,8410") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8441,8452,8460-8461,8470,8480,8590,8594,8620,8622-8623,8631") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8633-8634,8640,8670,8806,8822,8933,8950,8960,8980,9050") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9052,9060,9070-9071,9073,9080,9085,9090-9091,9100,9110"))) {
            functions.GEN_STRCPY(SD1, untrimmedline.sex)
        }
        if (functions.GEN_AT(untrimmedline.primarySite, "C421") != 0 && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9835-9837"))
            functions.GEN_STRCPY(age, untrimmedline.ageAtDx)
        if (functions.GEN_INLIST(age, "000-019,999"))
            functions.GEN_STRCPY(SD1, "1")
        else {
            if (functions.GEN_INLIST(age, "020-120"))
                functions.GEN_STRCPY(SD1, "2")
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCCID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCCID2018STGP_SITELOW, Site, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
        
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.histologyIcdO3)
            }
            else {
                functions.GEN_STRCPY(group, "XX  ")
                functions.GEN_STRCPY(GPNAME, "No AJCC staging")
            }
        }
        else {
            functions.GEN_STRCPY(group, "XX  ")
            functions.GEN_STRCPY(GPNAME, "No AJCC staging")
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCCID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCCID2018STGP_SITELOWSITEHIGHHISTLOW, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0) {
                functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.behaviorIcdO3)
            }
            else {
                functions.GEN_STRCPY(group, "XX  ")
                functions.GEN_STRCPY(GPNAME, "No AJCC staging")
            }
        }
        else {
            functions.GEN_STRCPY(group, "XX  ")
            functions.GEN_STRCPY(GPNAME, "No AJCC staging")
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCCID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCCID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHBEHAVIOR, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.behaviorIcdO3, BEHAVIOR) == 0) {
                functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.behaviorIcdO3)
                functions.GEN_STRCAT(Site_Hist_SD, SD1)
                functions.GEN_STRCAT(Site_Hist_SD, SD2)
            }
            else {
                functions.GEN_STRCPY(group, "XX  ")
                functions.GEN_STRCPY(GPNAME, "No AJCC staging")
            }
        }
        else {
            functions.GEN_STRCPY(group, "XX  ")
            functions.GEN_STRCPY(GPNAME, "No AJCC staging")
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCCID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCCID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHBEHAVIORSCDSCR1SCDSCR2, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.behaviorIcdO3, BEHAVIOR) == 0 && functions.GEN_STRCMP(SD1, SCDSCR1) == 0 && functions.GEN_STRCMP(SD2, SCDSCR2) == 0)
                functions.GEN_STRCPY(group, GPCODE)
            else {
                functions.GEN_STRCPY(group, "XX  ")
                functions.GEN_STRCPY(GPNAME, "No AJCC staging")
            }
        }
        else {
            functions.GEN_STRCPY(group, "XX  ")
            functions.GEN_STRCPY(GPNAME, "No AJCC staging")
        }
        if (functions.GEN_INLIST(group, "55.A,55.B"))
            functions.GEN_STRCPY(group, "55")
        if (functions.GEN_INLIST(group, "77.A,77.B"))
            functions.GEN_STRCPY(group, "77")
        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), functions.GEN_TRIM(group, ((Integer)context.RQRS_GEN_RIGHT))) != 0) {
            functions.GEN_STRCPY(t_schema_msg, "Calculated AJCC ID: ")
            functions.GEN_STRCAT(t_schema_msg, group)
            functions.GEN_STRCAT(t_schema_msg, ", ")
            functions.GEN_STRCAT(t_schema_msg, GPNAME)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Reported AJCC ID ${untrimmedline.ajccId} not valid for ${untrimmedline.primarySite}, ${untrimmedline.histologyIcdO3}/${untrimmedline.behaviorIcdO3}, SD1:${untrimmedline.schemaDiscriminator1}, SD2:${untrimmedline.schemaDiscriminator2}, Sex, Age, ${untrimmedline.dateOfDiagnosis.formatDate()}; if codes correct, contact SW vendor for assistance')
        }
        return true

    }

    // ID: RQRS-00861; TAG: N4205; NAME: _SYS AJCC ID, Site, Histo, Age (NAACCR)
    public boolean rqrs00861(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_ID = new char[5], SITE = new char[5], DISCRIM = new char[2]
        
        int dx_year
        
        char[] group_DISCRIMH = new char[15]
        char[] discrim_msg1 = new char[100]
        char[] age = new char[4]
        char[] SD1 = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.ajccId, "83.283.3", 4) == 0)
            return true
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_ID, untrimmedline.ajccId, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCPY(group_DISCRIMH, untrimmedline.ajccId)
            functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.primarySite)
            functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.histologyIcdO3)
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_IDSITEHISTO, group_DISCRIMH, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]))
            return true
        else {
            functions.GEN_STRCPY(age, untrimmedline.ageAtDx)
        
            if (functions.GEN_INLIST(age, "000-019,999"))
                functions.GEN_STRCPY(SD1, "1")
            else {
                if (functions.GEN_INLIST(age, "020-120"))
                    functions.GEN_STRCPY(SD1, "2")
            }
            functions.GEN_STRCAT(group_DISCRIMH, SD1)
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_IDSITEHISTODISCRIM, group_DISCRIMH, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
        
            functions.GEN_STRCPY(discrim_msg1, "Site, Histology require age at diagnosis to assign %F1: %V1")
            functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Age at Diagnosis: ${untrimmedline.ageAtDx} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
        }
        return true

    }

    // ID: RQRS-00862; TAG: N3010; NAME: _SYS AJCC ID, Site, Histo, Schema Discriminator 1 (NAACCR)
    public boolean rqrs00862(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_ID = new char[5], SITE = new char[5], DISCRIM = new char[2]
        
        int dx_year
        
        char[] PCA = new char[5]
        char[] hist = new char[5]
        char[] psite = new char[5]
        char[] group_DISCRIMALL = new char[18]
        char[] discrim_msg1 = new char[100]
        char[] discrim_msg2 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_AT(untrimmedline.histologyIcdO3, "89358936", 4) == 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), "55") != 0)
                functions.GEN_STRCPY(PCA, "55.B")
        }
        else {
            functions.GEN_STRCPY(PCA, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (functions.GEN_INLIST(PCA, "55.B,45,83.2,83.3")) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "97329591", 4) == 0)
            functions.GEN_STRCPY(hist, "X")
        else {
            functions.GEN_STRCPY(hist, untrimmedline.histologyIcdO3)
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "95919732", 4) != 0)
            functions.GEN_STRCPY(psite, "X")
        else {
            functions.GEN_STRCPY(psite, untrimmedline.primarySite)
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_ID, PCA, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_ID, PCA, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCPY(group_DISCRIMALL, PCA)
            functions.GEN_STRCAT(group_DISCRIMALL, psite)
            functions.GEN_STRCAT(group_DISCRIMALL, hist)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_IDSITEHISTO, group_DISCRIMALL, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]))
                return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_IDSITEHISTO, group_DISCRIMALL, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1)) {
                functions.GEN_STRCAT(group_DISCRIMALL, untrimmedline.schemaDiscriminator1)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_AJCC_IDSITEHISTODISCRIM, group_DISCRIMALL, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance')
            }
            else {
                if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                    return true
            }
        }
        return true

    }

    // ID: RQRS-00863; TAG: N3013; NAME: _SYS AJCC ID, Site, Histo, Schema Discriminator 2 (NAACCR)
    public boolean rqrs00863(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_ID = new char[5], SITE = new char[5], DISCRIM = new char[2]
        
        int dx_year
        
        char[] group_DISCRIMP = new char[12]
        char[] group_DISCRIMH = new char[12]
        char[] discrim_msg1 = new char[100]
        char[] discrim_msg2 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId)) {
            return true
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
        
            functions.GEN_STRCPY(group_DISCRIMP, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_DISCRIMP, untrimmedline.primarySite)
        
            functions.GEN_STRCPY(group_DISCRIMH, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.histologyIcdO3)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDSITE, group_DISCRIMP, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDHISTO, group_DISCRIMH, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]))
                return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDSITE, group_DISCRIMP, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) || functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDHISTO, group_DISCRIMH, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2)) {
                functions.GEN_STRCAT(group_DISCRIMP, untrimmedline.schemaDiscriminator2)
                functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.schemaDiscriminator2)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDSITEDISCRIM, group_DISCRIMP, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_AJCC_IDHISTODISCRIM, group_DISCRIMH, ['AJCC_ID':AJCC_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
                    if (functions.GEN_AT(untrimmedline.histologyIcdO3, "8020") != 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} and Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance')
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite} and Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance.')
                }
            }
            else {
                if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
                    return true
            }
        }
        return true

    }

    // ID: RQRS-00864; TAG: N3068; NAME: _SYS AJCC ID, Site, Histo, Sex (NAACCR)
    public boolean rqrs00864(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] PCA = new char[5]
        char[] discrim_msg1 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.sex))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), "55") != 0)
                functions.GEN_STRCPY(PCA, "55.B")
            else
                functions.GEN_STRCPY(PCA, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_INLIST(PCA, "45,55.B"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8806, 8930-8931")) {
                if (functions.GEN_AT(untrimmedline.sex, "13459", 1) != 0 && !functions.GEN_INLIST(PCA, "45")) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require sex to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8313, 8380, 8442, 8472, 8474, 9000,8806,8930-8931") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000,8010,8020,8041,8044,8070,8120,8140,8240,8243,8310,8323,8410") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8441,8452,8460-8461,8470,8480,8590,8594,8620,8622-8623,8631") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8633-8634,8640,8670,8806,8822,8930-8931,8933,8950,8960,8980,9050") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9052,9060,9070-9071,9073,9080,9085,9090-9091,9100,9110")) {
                if (functions.GEN_AT(untrimmedline.sex, "26", 1) != 0 && !functions.GEN_INLIST(PCA, "55.B")) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require sex to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
                }
                else {
                    if (functions.GEN_AT(untrimmedline.sex, "13459", 1) != 0 && !functions.GEN_INLIST(PCA, "XX")) {
                        functions.GEN_STRCPY(discrim_msg1, "Site, Histology are not staged for sex")
                        functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00865; TAG: N2816; NAME: _SYS Schema ID (NAACCR)
    public boolean rqrs00865(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SCHEMAID = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID_AJCCID, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID_AJCCID_SCHEMAID, untrimmedline.schemaId, ['SCHEMAID':SCHEMAID]))
            return false
        return true

    }

    // ID: RQRS-00866; TAG: N2814; NAME: _SYS Schema ID, AJCC ID (NAACCR)
    public boolean rqrs00866(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SCHEMAID = new char[6], AJCCID = new char[5]
        
        char[] IDID = new char[10]
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        functions.GEN_STRCPY(IDID, untrimmedline.schemaId)
        functions.GEN_STRCAT(IDID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)))
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID_AJCCID, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID_AJCCID_SCHEMAIDAJCCID, IDID, ['SCHEMAID':SCHEMAID, 'AJCCID':AJCCID]))
            return false
        return true

    }

    // ID: RQRS-00867; TAG: N2823; NAME: _SYS Schema ID, Date of Diagnosis (NAACCR)
    public boolean rqrs00867(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema ID must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.schemaId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema ID must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-00868; TAG: N2824; NAME: _SYS Schema ID, Primary Site, Histology, Behavior (NAACCR)
    public boolean rqrs00868(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[6], GPNAME = new char[31], SCDSCR1 = new char[2], SCDSCR2 = new char[2], BEHAVIOR = new char[2]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] SchemaName = new char[35]
        char[] t_schema_msg = new char[100]
        char[] group = new char[5]
        
        char[] SD1 = new char[1]
        char[] SD2 = new char[1]
        
        char[] Site_HistLo = new char[20]
        
        char[] Site_Hist_SD = new char[25]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, untrimmedline.schemaDiscriminator1)
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
            functions.GEN_STRCPY(SD2, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2)) {
            functions.GEN_STRCPY(SD2, untrimmedline.schemaDiscriminator2)
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8700,8720-8790,8806,8822,8930-8931,8933,8950,8960,8980,9000,9050") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9052,9060,9070-9071,9073,9080,9085,9090-9091,9100,9110,9700-9701"))) {
            functions.GEN_STRCPY(SD1, untrimmedline.sex)
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "9732", 4) != 0) {
            functions.GEN_STRCPY(SD1, "X")
        }
        if (functions.GEN_AT(untrimmedline.primarySite, "C739", 4) != 0) {
            functions.GEN_STRCPY(SD1, "X")
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "89358936", 4) != 0)
            functions.GEN_STRCPY(SD1, "X")
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID2018STGP_SITELOW, Site, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        else {
            functions.GEN_STRCPY(group, "88888")
            functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOW, Site_HistLo, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0) {
                    functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                    functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, SD1)
                    functions.GEN_STRCAT(Site_Hist_SD, SD2)
                    functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.behaviorIcdO3)
                }
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHSCDSCR1SCDSCR2BEHAVIOR, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(SD1, SCDSCR1) == 0 && functions.GEN_STRCMP(SD2, SCDSCR2) == 0 && functions.GEN_STRCMP(untrimmedline.behaviorIcdO3, BEHAVIOR) == 0)
                functions.GEN_STRCPY(group, GPCODE)
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        else {
            functions.GEN_STRCPY(group, "88888")
            functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
        }
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOW, Site_HistLo, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0) {
                    functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                    functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, SD1)
                    functions.GEN_STRCAT(Site_Hist_SD, SD2)
                }
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHSCDSCR1SCDSCR2BEHAVIOR, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'BEHAVIOR':BEHAVIOR, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(SD1, SCDSCR1) == 0 && functions.GEN_STRCMP(SD2, SCDSCR2) == 0)
                functions.GEN_STRCPY(group, GPCODE)
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        else {
            functions.GEN_STRCPY(group, "88888")
            functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
        }
        if (functions.GEN_STRCMP(untrimmedline.schemaId, group) != 0) {
            functions.GEN_STRCPY(t_schema_msg, "Calculated Schema ID: ")
            functions.GEN_STRCAT(t_schema_msg, group)
            functions.GEN_STRCAT(t_schema_msg, ", ")
            functions.GEN_STRCAT(t_schema_msg, GPNAME)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Reported Schema ID ${untrimmedline.schemaId} not valid for ${untrimmedline.primarySite}, ${untrimmedline.histologyIcdO3}/${untrimmedline.behaviorIcdO3}, SD1: ${untrimmedline.schemaDiscriminator1}, SD2: ${untrimmedline.schemaDiscriminator2}, Sex: ${untrimmedline.sex}')
        }
        return true

    }

    // ID: RQRS-00869; TAG: N2965; NAME: _SYS Schema ID, Site, Histo, Schema Discriminator 1 (NAACCR)
    public boolean rqrs00869(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SITE = new char[5], DISCRIM = new char[2]
        
        int dx_year
        
        char[] hist = new char[5]
        char[] psite = new char[5]
        char[] group_DISCRIMALL = new char[18]
        char[] discrim_msg1 = new char[100]
        char[] discrim_msg2 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if ((functions.GEN_AT(untrimmedline.schemaId, "0044000552", 5) != 0) || (functions.GEN_AT(untrimmedline.schemaId, "00450") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C760") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00830") != 0 && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9835-9837"))) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "0006000090001110016100169001700024200250002600043000631006330067100672006900069800730007400010099999", 5) != 0)
            functions.GEN_STRCPY(hist, "X")
        else {
            functions.GEN_STRCPY(hist, untrimmedline.histologyIcdO3)
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "95919732", 4) != 0)
            functions.GEN_STRCPY(psite, "X")
        else {
            functions.GEN_STRCPY(psite, untrimmedline.primarySite)
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCPY(group_DISCRIMALL, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_DISCRIMALL, psite)
            functions.GEN_STRCAT(group_DISCRIMALL, hist)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_SCHEMA_IDSITEHISTO, group_DISCRIMALL, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
                if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for Schema ID: ${untrimmedline.schemaId}, Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}')
            }
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_SCHEMA_IDSITEHISTO, group_DISCRIMALL, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCAT(group_DISCRIMALL, untrimmedline.schemaDiscriminator1)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM1, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM1_SCHEMA_IDSITEHISTODISCRIM, group_DISCRIMALL, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance')
        }
        return true

    }

    // ID: RQRS-00870; TAG: N3007; NAME: _SYS Schema ID, Site, Histo, Schema Discriminator 2 (NAACCR)
    public boolean rqrs00870(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SITE = new char[5], DISCRIM = new char[2]
        
        int dx_year
        
        char[] group_DISCRIMP = new char[12]
        char[] group_DISCRIMH = new char[12]
        char[] discrim_msg1 = new char[100]
        char[] discrim_msg2 = new char[100]
        
        char[] group_DISCRIM = new char[12]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCPY(group_DISCRIMP, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_DISCRIMP, untrimmedline.primarySite)
        
            functions.GEN_STRCPY(group_DISCRIMH, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.histologyIcdO3)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDSITE, group_DISCRIMP, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDHISTO, group_DISCRIMH, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
                if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for Schema ID: ${untrimmedline.schemaId}, Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}')
            }
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDSITE, group_DISCRIMP, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) || functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDHISTO, group_DISCRIMH, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
            functions.GEN_STRCAT(group_DISCRIMP, untrimmedline.schemaDiscriminator2)
            functions.GEN_STRCAT(group_DISCRIMH, untrimmedline.schemaDiscriminator2)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDSITEDISCRIM, group_DISCRIMP, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_DISCRIM2, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_DISCRIM2_SCHEMA_IDHISTODISCRIM, group_DISCRIMH, ['SCHEMA_ID':SCHEMA_ID, 'SITE':SITE, 'DISCRIM':DISCRIM])) {
                if (functions.GEN_AT(untrimmedline.histologyIcdO3, "8020") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} and Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite} and Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance.')
            }
        }
        return true

    }

    // ID: RQRS-00871; TAG: N3069; NAME: _SYS Schema ID, Site, Histo, Sex (NAACCR)
    public boolean rqrs00871(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        int dx_year
        
        char[] discrim_msg1 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.sex))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "004400045000552", 5) == 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8806, 8930-8931")) {
                if (functions.GEN_AT(untrimmedline.sex, "13459", 1) != 0 && functions.GEN_AT(untrimmedline.schemaId, "00450") == 0) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require sex to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance. ')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8700,8720-8790,8822,8933,8950,8960,8980") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9000,9050,9052,9060,9070-9071,9073,9080,9085") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9090-9091,9100,9110,9700-9701")) {
                if (functions.GEN_AT(untrimmedline.sex, "13459", 1) != 0 && functions.GEN_AT(untrimmedline.schemaId, "00440") == 0) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require sex to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance. ')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8700,8720-8790,8806,8822,8930-8931,8933,8950,8960") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8980,9000,9050,9052,9060,9070-9071,9073,9080,9085") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9090-9091,9100,9110, 9700-9701")) {
                if (functions.GEN_AT(untrimmedline.sex, "26", 1) != 0 && functions.GEN_AT(untrimmedline.schemaId, "00552") == 0) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require sex to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, 'iscrim_msg')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite}, Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}, Sex: ${untrimmedline.sex} are incompatible with Schema ID: ${untrimmedline.schemaId}. If coding correct, contact software vendor for assistance. ')
                }
            }
        }
        return true

    }

    // ID: RQRS-00872; TAG: N0201; NAME: Abstracted By (NAACCR)
    public boolean rqrs00872(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: RQRS-00873; TAG: N0799; NAME: Addr at DX--City (NAACCR)
    public boolean rqrs00873(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.addressAtDxCity), context.RQRS_CITY_SPC, context.RQRS_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addressAtDxCity, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addressAtDxCity, 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.addressAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: RQRS-00874; TAG: N1666; NAME: Addr at DX--Country (NAACCR)
    public boolean rqrs00874(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.addressAtDxCountry, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00875; TAG: N1683; NAME: Addr at DX--Country, Date of Diagnosis (NAACCR)
    public boolean rqrs00875(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-00877; TAG: N0361; NAME: Addr at DX--No/Street, Date of Diagnosis (COC)
    public boolean rqrs00877(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxStreetName))
                return false
        }
        return true

    }

    // ID: RQRS-00878; TAG: N0122; NAME: Addr at DX--State (NAACCR)
    public boolean rqrs00878(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.addressAtDxState, context.RQRS_STATE, context.RQRS_STATE_CODE, [:])

    }

    // ID: RQRS-00879; TAG: N0909; NAME: Addr at DX--State, Postal Code Range (NAACCR)
    public boolean rqrs00879(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.addressAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxPostalCode, "99999, 999999999")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AA,AE,AP,CD,US,XX,YY,ZZ"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT")) {
            return true
        }
        functions.GEN_STRCPY(StateZip, untrimmedline.addressAtDxState)
        functions.GEN_STRCAT(StateZip, untrimmedline.addressAtDxPostalCode, 5)
        
        if (functions.GEN_RLOOKUP(StateZip, context.RQRS_STATEZIP, context.RQRS_STATEZIP_ST_ZIPLOW, ['STATE':state, 'ZIPLOW':ziplow, 'ZIPHIGH':ziphigh, 'ST_ZIPLOW':st_ziplow])) {
            if (functions.GEN_STRCMP(untrimmedline.addressAtDxState, state) == 0 && functions.GEN_STRCMP(untrimmedline.addressAtDxPostalCode, ziplow, 5) >= 0 && functions.GEN_STRCMP(untrimmedline.addressAtDxPostalCode, ziphigh, 5) <= 0)
                return true
            else
                return true
        }
        
        return true

    }

    // ID: RQRS-00880; TAG: N0156; NAME: Addr Current--City (COC)
    public boolean rqrs00880(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.addressCurrentCity))
            return true
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addressCurrentCity), context.RQRS_CITY_SPC, context.RQRS_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addressCurrentCity, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addressCurrentCity, 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.addressCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: RQRS-00881; TAG: N0350; NAME: Addr Current--City (NAACCR)
    public boolean rqrs00881(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.addressCurrentCity), context.RQRS_CITY_SPC, context.RQRS_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addressCurrentCity, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addressCurrentCity, 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.addressCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: RQRS-00882; TAG: N0342; NAME: Addr Current--City, Date of Diagnosis (COC)
    public boolean rqrs00882(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressCurrentCity))
                return false
        }
        return true

    }

    // ID: RQRS-00883; TAG: N1684; NAME: Addr Current--Country (COC)
    public boolean rqrs00883(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressCurrentCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.addressCurrentCountry, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00884; TAG: N1667; NAME: Addr Current--Country (NAACCR)
    public boolean rqrs00884(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.addressCurrentCountry, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00885; TAG: N1685; NAME: Addr Current--Country, Date of Diagnosis (COC)
    public boolean rqrs00885(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressCurrentCountry))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Addr Current--Country cannot be ${untrimmedline.addressCurrentCountry} if Date of Diagnosis is greater than 2012')
        
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00886; TAG: N1686; NAME: Addr Current--Country, Date of Diagnosis (NAACCR)
    public boolean rqrs00886(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.addressCurrentCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addressCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: RQRS-00887; TAG: N1700; NAME: Addr Current--Country, State (NAACCR)
    public boolean rqrs00887(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.addressCurrentCountry) || functions.GEN_EMPTY(untrimmedline.addressCurrentState))
            return true
        functions.GEN_STRCPY(cntry_state, untrimmedline.addressCurrentCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.addressCurrentState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

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

    }

    // ID: RQRS-00889; TAG: N0362; NAME: Addr Current--No/Street, Date of Diagnosis (COC)
    public boolean rqrs00889(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressCurrentStreetName))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00892; TAG: N0352; NAME: Addr Current--Postal Code, Addr Current--State (COC)
    public boolean rqrs00892(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addressCurrentState))
            return true
        if (functions.GEN_EMPTY(untrimmedline.addressCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addressCurrentState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "AA,AE,AP"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "99999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "88888, 888888888")) {
            if (!functions.GEN_INLIST(untrimmedline.addressCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "99999, 999999, 999999999")) {
            if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressCurrentState, "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.addressCurrentPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addressCurrentPostalCode, "99999,999999,999999999"))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_MATCH(untrimmedline.addressCurrentPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addressCurrentPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
                return false
        }
        if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addressCurrentPostalCode, 1, 5)) < 10)
            return false
        return true

    }

    // ID: RQRS-00893; TAG: N0337; NAME: Addr Current--Postal Code, Date of Diagnosis (COC)
    public boolean rqrs00893(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressCurrentPostalCode))
                return false
        }
        return true

    }

    // ID: RQRS-00894; TAG: N0338; NAME: Addr Current--State (COC)
    public boolean rqrs00894(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressCurrentState))
            return true
        return functions.GEN_LOOKUP(untrimmedline.addressCurrentState, context.RQRS_STATE, context.RQRS_STATE_CODE, [:])

    }

    // ID: RQRS-00895; TAG: N0197; NAME: Addr Current--State (NAACCR)
    public boolean rqrs00895(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.addressCurrentState, context.RQRS_STATE, context.RQRS_STATE_CODE, [:])

    }

    // ID: RQRS-00896; TAG: N0339; NAME: Addr Current--State, Date of Diagnosis (COC)
    public boolean rqrs00896(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressCurrentState))
                return false
        }
        return true

    }

    // ID: RQRS-00897; TAG: N2669; NAME: Adenoid Cystic Basaloid Pattern, Date DX (NAACCR)
    public boolean rqrs00897(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] basaloid = new char[5]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Adenoid Cystic Basaloid Pattern must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.adenoidCysticBasaloidPattern, 4, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Adenoid Cystic Basaloid Pattern must be right justified with one decimal place')
        functions.GEN_STRCPY(basaloid, functions.GEN_SUBSTR(untrimmedline.adenoidCysticBasaloidPattern, 1, 3))
        functions.GEN_STRCAT(basaloid, functions.GEN_SUBSTR(untrimmedline.adenoidCysticBasaloidPattern, 5, 1))
        
        if (functions.GEN_AT(basaloid, "XXX5XXX8XXX9", 4) == 0 && !functions.GEN_MATCH(basaloid, "(\\s\\s\\d\\d)") && !functions.GEN_MATCH(basaloid, "(\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(basaloid, "((([1-9]))\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.adenoidCysticBasaloidPattern} not valid code for Adenoid Cystic Basaloid Pattern')
        return true

    }

    // ID: RQRS-00898; TAG: N2988; NAME: Adenoid Cystic Basaloid Pattern, Schema ID, Required (NAACCR)
    public boolean rqrs00898(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00690", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern) || functions.GEN_AT(untrimmedline.adenoidCysticBasaloidPattern, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00899; TAG: N2741; NAME: Adenopathy, Date DX (NAACCR)
    public boolean rqrs00899(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.adenopathy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Adenopathy must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.adenopathy))
            return true
        if (functions.GEN_AT(untrimmedline.adenopathy, "019", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.adenopathy} not valid code for Adenopathy')
        return true

    }

    // ID: RQRS-00900; TAG: N2873; NAME: Adenopathy, Schema ID, Required (NAACCR)
    public boolean rqrs00900(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00795", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.adenopathy))
                return false
        }
        return true

    }

    // ID: RQRS-00901; TAG: N2660; NAME: AFP Post-Orchiectomy Lab Value, Date DX (NAACCR)
    public boolean rqrs00901(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] AFP = new char[7]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Post-Orchiectomy Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.afpPostOrchiectomyLabValue, 6, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Post-Orchiectomy Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(AFP, functions.GEN_SUBSTR(untrimmedline.afpPostOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(AFP, functions.GEN_SUBSTR(untrimmedline.afpPostOrchiectomyLabValue, 7, 1))
        
        if (functions.GEN_AT(AFP, "XXXXX1XXXXX7XXXXX8XXXXX9", 6) == 0 && !functions.GEN_MATCH(AFP, "(\\s\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s(([1-9]))\\d\\d\\d\\d)") && !functions.GEN_MATCH(AFP, "((([1-9]))\\d\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPostOrchiectomyLabValue} not valid code for AFP Post-Orchiectomy Lab Value')
        return true

    }

    // ID: RQRS-00902; TAG: N2971; NAME: AFP Post-Orchiectomy Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs00902(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) && functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00903; TAG: N3903; NAME: AFP Post-Orchiectomy Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00903(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00904; TAG: N2716; NAME: AFP Post-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs00904(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Post-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPostOrchiectomyRange} not valid code for AFP Post-Orchiectomy Range')
        return true

    }

    // ID: RQRS-00905; TAG: N2972; NAME: AFP Post-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs00905(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00906; TAG: N3904; NAME: AFP Post-Orchiectomy Range, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00906(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00907; TAG: N2658; NAME: AFP Pre-Orchiectomy Lab Value, Date DX (NAACCR)
    public boolean rqrs00907(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] AFP = new char[7]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pre-Orchiectomy Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.afpPreOrchiectomyLabValue, 6, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pre-Orchiectomy Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(AFP, functions.GEN_SUBSTR(untrimmedline.afpPreOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(AFP, functions.GEN_SUBSTR(untrimmedline.afpPreOrchiectomyLabValue, 7, 1))
        
        if (functions.GEN_AT(AFP, "XXXXX1XXXXX7XXXXX8XXXXX9", 6) == 0 && !functions.GEN_MATCH(AFP, "(\\s\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s(([1-9]))\\d\\d\\d\\d)") && !functions.GEN_MATCH(AFP, "((([1-9]))\\d\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPreOrchiectomyLabValue} not valid code for AFP Pre-Orchiectomy Lab Value')
        return true

    }

    // ID: RQRS-00908; TAG: N2973; NAME: AFP Pre-Orchiectomy Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs00908(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPreOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00909; TAG: N3009; NAME: AFP Pre-Orchiectomy Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00909(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPreOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00910; TAG: N2713; NAME: AFP Pre-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs00910(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pre-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.afpPreOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPreOrchiectomyRange} not valid code for AFP Pre-Orchiectomy Range')
        return true

    }

    // ID: RQRS-00911; TAG: N2984; NAME: AFP Pre-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs00911(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPreOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00912; TAG: N3905; NAME: AFP Pre-Orchiectomy Range, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00912(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPreOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00913; TAG: N2719; NAME: AFP Pretreatment Interpretation, Date DX (NAACCR)
    public boolean rqrs00913(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pretreatment Interpretation must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation))
            return true
        if (functions.GEN_AT(untrimmedline.afpPretreatmentInterpretation, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPretreatmentInterpretation} not valid code for AFP Pretreatment Interpretation')
        return true

    }

    // ID: RQRS-00914; TAG: N2974; NAME: AFP Pretreatment Interpretation, Schema ID, Required (NAACCR)
    public boolean rqrs00914(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation) || functions.GEN_AT(untrimmedline.afpPretreatmentInterpretation, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00915; TAG: N3906; NAME: AFP Pretreatment Interpretation, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00915(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation) || functions.GEN_AT(untrimmedline.afpPretreatmentInterpretation, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00916; TAG: N2650; NAME: AFP Pretreatment Lab Value, Date DX (NAACCR)
    public boolean rqrs00916(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] AFP = new char[6]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pretreatment Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.afpPretreatmentLabValue, 5, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AFP Pretreatment Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(AFP, functions.GEN_SUBSTR(untrimmedline.afpPretreatmentLabValue, 1, 4))
        functions.GEN_STRCAT(AFP, functions.GEN_SUBSTR(untrimmedline.afpPretreatmentLabValue, 6, 1))
        
        if (functions.GEN_AT(AFP, "XXXX1XXXX7XXXX8XXXX9", 5) == 0 && !functions.GEN_MATCH(AFP, "(\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(AFP, "(\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(AFP, "((([1-9]))\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.afpPretreatmentLabValue} not valid code for AFP Pretreatment Lab Value')
        return true

    }

    // ID: RQRS-00917; TAG: N2948; NAME: AFP Pretreatment Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs00917(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue) || functions.GEN_AT(untrimmedline.afpPretreatmentLabValue, "XXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00918; TAG: N3907; NAME: AFP Pretreatment Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00918(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue) || functions.GEN_AT(untrimmedline.afpPretreatmentLabValue, "XXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00919; TAG: N0363; NAME: Age at Diagnosis, Text--Usual Industry (NAACCR)
    public boolean rqrs00919(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1996)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDx)) {
            birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.birthDate)
        
            if (birth_year == ((Integer)context.RQRS_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.birthDate)
            dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.birthDate)
        
            if ((birth_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))) {
                wrk_age = 999
                return true
            }
            else {
                if ((birth_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.RQRS_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.RQRS_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.RQRS_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.ageAtDx)
        if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualIndustry))
            return false
        return true

    }

    // ID: RQRS-00920; TAG: N0364; NAME: Age at Diagnosis, Text--Usual Occupation (NAACCR)
    public boolean rqrs00920(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1996)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDx)) {
            birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.birthDate)
        
            if (birth_year == ((Integer)context.RQRS_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.birthDate)
            dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.birthDate)
        
            if ((birth_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))) {
                wrk_age = 999
                return true
            }
            else {
                if ((birth_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.RQRS_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.RQRS_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.RQRS_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.ageAtDx)
        if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualOccupation))
            return false
        return true

    }

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

    }

    // ID: RQRS-00922; TAG: N0449; NAME: Age, Primary Site, Morphology ICDO3 (SEER IF15)
    public boolean rqrs00922(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_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.morphologyIcdO3))
            return true /* don't test further if age is unknown */
        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDx)
        
        if (agetemp < 15) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphologyIcdO3, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphologyIcdO3, "(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.morphologyIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphologyIcdO3, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "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.morphologyIcdO3, "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.morphologyIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "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.morphologyIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

    // ID: RQRS-00923; TAG: N2508; NAME: AJCC ID, AJCC TNM M (COC)
    public boolean rqrs00923(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_CHID = new char[5], CLINM = new char[16], PATHM = new char[16], AJCC_ID = new char[5], AJCC_NAME = new char[26]
        
        int dx_year
        
        
        char[] group_cm = new char[20]
        char[] group_pm = new char[20]
        char[] group_ypm = new char[20]
        char[] short_not_the_keyword = new char[250]
        char[] short_ID = new char[5]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0888", 2) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "Chapter ")
            functions.GEN_STRCAT(name, untrimmedline.ajccId, 2)
            functions.GEN_STRCAT(name, ": ")
            functions.GEN_STRCAT(name, functions.GEN_TRIM(AJCC_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "AJCC ID not identified")
        }
        functions.GEN_STRCPY(short_not_the_keyword, "11.111.212.112.213.113.213.316.116.216.318.118.238.138.238.3")
        functions.GEN_STRCAT(short_not_the_keyword, "54.154.263.163.273.173.279.079.179.279.379.479.5")
        functions.GEN_STRCAT(short_not_the_keyword, "79.679.783.083.183.283.383.413.048.148.263.363.461.161.2")
        functions.GEN_STRCAT(short_not_the_keyword, "62.162.243.143.267.167.281.181.282.182.2")
        
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword, 4) != 0)
            functions.GEN_STRCPY(short_ID, functions.GEN_SUBSTR(untrimmedline.ajccId, 1, 2))
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword) == 0)
            functions.GEN_STRCPY(short_ID, untrimmedline.ajccId)
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinM)) {
            functions.GEN_STRCPY(group_cm, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_cm, functions.GEN_TRIM(untrimmedline.ajccTnmClinM, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCCLINMED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCCLINMED8_AJCC_CHIDCLINM, group_cm, ['AJCC_CHID':AJCC_CHID, 'CLINM':CLINM])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin M: ${untrimmedline.ajccTnmClinM} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM)) {
            functions.GEN_STRCPY(group_pm, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_pm, functions.GEN_TRIM(untrimmedline.ajccTnmPathM, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPATHMED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPATHMED8_AJCC_CHIDPATHM, group_pm, ['AJCC_CHID':AJCC_CHID, 'PATHM':PATHM])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path M: ${untrimmedline.ajccTnmPathM} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM)) {
            functions.GEN_STRCPY(group_ypm, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_ypm, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyM, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPATHMED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPATHMED8_AJCC_CHIDPATHM, group_ypm, ['AJCC_CHID':AJCC_CHID, 'PATHM':PATHM])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy M: ${untrimmedline.ajccTnmPostTherapyM} is not valid for AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: RQRS-00924; TAG: N2509; NAME: AJCC ID, AJCC TNM N (COC)
    public boolean rqrs00924(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_CHID = new char[5], CLINN = new char[16], PATHN = new char[16], YPATHN = new char[16], AJCC_ID = new char[5], AJCC_NAME = new char[26]
        
        int dx_year
        
        
        char[] group_cn = new char[20]
        char[] group_pn = new char[20]
        char[] group_ypn = new char[20]
        char[] short_not_the_keyword = new char[240]
        char[] short_ID = new char[5]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0888", 2) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "Chapter ")
            functions.GEN_STRCAT(name, untrimmedline.ajccId, 2)
            functions.GEN_STRCAT(name, ": ")
            functions.GEN_STRCAT(name, functions.GEN_TRIM(AJCC_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "AJCC ID not identified")
        }
        functions.GEN_STRCPY(short_not_the_keyword, "11.111.212.112.213.113.213.316.116.216.318.118.238.138.238.3")
        functions.GEN_STRCAT(short_not_the_keyword, "54.154.263.163.273.173.279.079.179.279.379.479.5")
        functions.GEN_STRCAT(short_not_the_keyword, "79.679.780.180.283.183.283.383.413.048.148.263.363.461.161.2")
        functions.GEN_STRCAT(short_not_the_keyword, "62.162.283.043.143.282.182.2")
        
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword, 4) != 0)
            functions.GEN_STRCPY(short_ID, functions.GEN_SUBSTR(untrimmedline.ajccId, 1, 2))
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword) == 0)
            functions.GEN_STRCPY(short_ID, untrimmedline.ajccId)
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN)) {
            functions.GEN_STRCPY(group_cn, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_cn, functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCCLINNED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCCLINNED8_AJCC_CHIDCLINN, group_cn, ['AJCC_CHID':AJCC_CHID, 'CLINN':CLINN])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin N: ${untrimmedline.ajccTnmClinN} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN)) {
            functions.GEN_STRCPY(group_pn, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_pn, functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPATHNED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPATHNED8_AJCC_CHIDPATHN, group_pn, ['AJCC_CHID':AJCC_CHID, 'PATHN':PATHN])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path N: ${untrimmedline.ajccTnmPathN} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN)) {
            functions.GEN_STRCPY(group_ypn, functions.GEN_TRIM(short_ID, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_ypn, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCYPATHNED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCYPATHNED8_AJCC_CHIDYPATHN, group_ypn, ['AJCC_CHID':AJCC_CHID, 'YPATHN':YPATHN])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN} is not valid for AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: RQRS-00925; TAG: N2611; NAME: AJCC ID, AJCC TNM Stage Group (COC)
    public boolean rqrs00925(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] AJCC_CHID = new char[5], CLINSTAGE = new char[16], PATHSTAGE = new char[16], POSTNEOSTAGE = new char[16], AJCC_ID = new char[5], AJCC_NAME = new char[26]
        
        int dx_year
        
        
        char[] group_cst = new char[20]
        char[] group_pst = new char[20]
        char[] group_pnst = new char[20]
        char[] short_not_the_keyword = new char[150]
        char[] short_id = new char[5]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0888", 2) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "Chapter ")
            functions.GEN_STRCAT(name, untrimmedline.ajccId, 2)
            functions.GEN_STRCAT(name, ": ")
            functions.GEN_STRCAT(name, functions.GEN_TRIM(AJCC_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME]))
            functions.GEN_STRCPY(name, "AJCC ID not identified")
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStgGrp, "1") != 0) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(untrimmedline.ajccTnmClinStageGroup, "88", 2) != 0 || functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup)) && (functions.GEN_AT(untrimmedline.ajccTnmPathStageGroup, "88", 2) != 0 || functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) && (functions.GEN_AT(untrimmedline.ajccTnmPostTherapyStageGroup, "88", 2) != 0 || functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(short_not_the_keyword, "11.111.212.112.263.163.263.363.461.161.262.162.2")
        functions.GEN_STRCAT(short_not_the_keyword, "79.079.179.279.379.479.563.163.263.363.4")
        functions.GEN_STRCAT(short_not_the_keyword, "79.679.782.182.283.083.183.283.383.4")
        
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword) != 0)
            functions.GEN_STRCPY(short_id, functions.GEN_SUBSTR(untrimmedline.ajccId, 1, 2))
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword) == 0)
            functions.GEN_STRCPY(short_id, untrimmedline.ajccId)
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "55", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C569C570", 4) != 0)
                functions.GEN_STRCPY(short_id, "55.A")
            else
                functions.GEN_STRCPY(short_id, "55.B")
        }
        if (functions.GEN_AT(untrimmedline.ajccId, "73.1") != 0) {
            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-055"))
                functions.GEN_STRCPY(short_id, "73.A")
            else
                functions.GEN_STRCPY(short_id, "73.B")
        }
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "77") != 0) {
            if (functions.GEN_AT(untrimmedline.histologyIcdO3, "8700") != 0)
                functions.GEN_STRCPY(short_id, "77.A")
            else
                functions.GEN_STRCPY(short_id, "77.B")
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup)) {
            functions.GEN_STRCPY(group_cst, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_cst, functions.GEN_TRIM(untrimmedline.ajccTnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCCLINSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCCLINSTED8_AJCC_CHIDCLINSTAGE, group_cst, ['AJCC_CHID':AJCC_CHID, 'CLINSTAGE':CLINSTAGE])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin Stage Group: ${untrimmedline.ajccTnmClinStageGroup} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) {
        
            functions.GEN_STRCPY(group_pst, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_pst, functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPATHSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPATHSTED8_AJCC_CHIDPATHSTAGE, group_pst, ['AJCC_CHID':AJCC_CHID, 'PATHSTAGE':PATHSTAGE])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path Stage Group: ${untrimmedline.ajccTnmPathStageGroup} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
        
            functions.GEN_STRCPY(group_pnst, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_pnst, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPOSTNEOSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPOSTNEOSTED8_AJCC_CHIDPOSTNEOSTAGE, group_pnst, ['AJCC_CHID':AJCC_CHID, 'POSTNEOSTAGE':POSTNEOSTAGE])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup} is not valid for AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: RQRS-00926; TAG: N2510; NAME: AJCC ID, AJCC TNM T (COC)
    public boolean rqrs00926(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] AJCC_CHID = new char[5], CLINT = new char[16], PATHT = new char[16], YPATHT = new char[16], AJCC_ID = new char[5], AJCC_NAME = new char[26]
        
        int dx_year
        
        
        char[] group_ct = new char[20]
        char[] group_pt = new char[20]
        char[] group_ypt = new char[20]
        char[] short_not_the_keyword = new char[180]
        char[] short_id = new char[5]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0888", 2) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "Chapter ")
            functions.GEN_STRCAT(name, untrimmedline.ajccId, 2)
            functions.GEN_STRCAT(name, ": ")
            functions.GEN_STRCAT(name, functions.GEN_TRIM(AJCC_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_AJCC_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_AJCC_ID_NAMES_AJCC_ID, functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.RQRS_GEN_RIGHT)), ['AJCC_ID':AJCC_ID, 'AJCC_NAME':AJCC_NAME])) {
            functions.GEN_STRCPY(name, "AJCC ID not identified")
        }
        functions.GEN_STRCPY(short_not_the_keyword, "11.111.212.112.216.116.216.318.118.243.143.261.161.262.162.2")
        functions.GEN_STRCAT(short_not_the_keyword, "73.173.279.079.179.279.379.479.5")
        functions.GEN_STRCAT(short_not_the_keyword, "79.679.782.182.283.083.183.283.383.463.163.263.363.4")
        
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword, 4) != 0)
            functions.GEN_STRCPY(short_id, functions.GEN_SUBSTR(untrimmedline.ajccId, 1, 2))
        if (functions.GEN_AT(untrimmedline.ajccId, short_not_the_keyword) == 0)
            functions.GEN_STRCPY(short_id, untrimmedline.ajccId)
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "55", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C569C570", 4) != 0)
                functions.GEN_STRCPY(short_id, "55.A")
            else
                functions.GEN_STRCPY(short_id, "55.B")
        }
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "77") != 0) {
            if (functions.GEN_AT(untrimmedline.histologyIcdO3, "8700") != 0)
                functions.GEN_STRCPY(short_id, "77.A")
            else
                functions.GEN_STRCPY(short_id, "77.B")
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT)) {
            functions.GEN_STRCPY(group_ct, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_ct, functions.GEN_TRIM(untrimmedline.ajccTnmClinT, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCCLINTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCCLINTED8_AJCC_CHIDCLINT, group_ct, ['AJCC_CHID':AJCC_CHID, 'CLINT':CLINT])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin T: ${untrimmedline.ajccTnmClinT} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT)) {
            functions.GEN_STRCPY(group_pt, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_pt, functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCPATHTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCPATHTED8_AJCC_CHIDPATHT, group_pt, ['AJCC_CHID':AJCC_CHID, 'PATHT':PATHT])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T: ${untrimmedline.ajccTnmPathT} is not valid for AJCC ID ${untrimmedline.ajccId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT)) {
            functions.GEN_STRCPY(group_ypt, functions.GEN_TRIM(short_id, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_ypt, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_COCYPATHTED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_COCYPATHTED8_AJCC_CHIDYPATHT, group_ypt, ['AJCC_CHID':AJCC_CHID, 'YPATHT':YPATHT])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy T: ${untrimmedline.ajccTnmPostTherapyT} is not valid for AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: RQRS-00927; TAG: N4930; NAME: AJCC TNM and EOD Items, Type Reporting Source-DCO (NAACCR)
    public boolean rqrs00927(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,")) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) == 0)
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin T: ${untrimmedline.ajccTnmClinT} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin N: ${untrimmedline.ajccTnmClinN} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin M: ${untrimmedline.ajccTnmClinM} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin Stage Group: ${untrimmedline.ajccTnmClinStageGroup} must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path T: ${untrimmedline.ajccTnmPathT} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path N: ${untrimmedline.ajccTnmPathN} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path M: ${untrimmedline.ajccTnmPathM} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path Stage Group: ${untrimmedline.ajccTnmPathStageGroup} must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy T must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy N must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy M must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Stage Group must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor) && functions.GEN_AT(untrimmedline.eodPrimaryTumor, "888999", 3) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: EOD Primary Tumor must = 888, 999, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) && functions.GEN_AT(untrimmedline.eodRegionalNodes, "888999", 3) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: EOD Regional Nodes must = 888, 999, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.eodMets) && functions.GEN_AT(untrimmedline.eodMets, "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: EOD Mets must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension) && functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "999") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Prostate Pathological Extension must = 999 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.summaryStage2018) && functions.GEN_AT(untrimmedline.summaryStage2018, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Summary Stage 2018 must = 8, 9 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_AT(untrimmedline.gradeClinical, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Clinical must = 8, 9 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_AT(untrimmedline.gradePathological, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Pathological must = 8, 9 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Post Therapy must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) && functions.GEN_AT(untrimmedline.lymphVascularInvasion, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Lymphovascular Invasion must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxBone) && functions.GEN_AT(untrimmedline.metsDxBone, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at DX-Bone must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxBrain) && functions.GEN_AT(untrimmedline.metsDxBrain, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at DX-Brain must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxDistantLn) && functions.GEN_AT(untrimmedline.metsDxDistantLn, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at Dx-Distant LN must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxLiver) && functions.GEN_AT(untrimmedline.metsDxLiver, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at DX-Liver must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxLung) && functions.GEN_AT(untrimmedline.metsDxLung, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at DX-Lung must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.metsDxOther) && functions.GEN_AT(untrimmedline.metsDxOther, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Mets at DX-Other must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) && functions.GEN_AT(untrimmedline.regionalNodesPositive, "99") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Regional Nodes Positive must = 99 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) && functions.GEN_AT(untrimmedline.regionalNodesExamined, "99") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Regional Nodes Examined must = 99 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.tumorSizeClinical) && functions.GEN_AT(untrimmedline.tumorSizeClinical, "999") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Tumor Size Clinical must = 999 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) && functions.GEN_AT(untrimmedline.tumorSizePathologic, "999") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Tumor Size Pathologic must = 999 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.tumorSizeSummary) && functions.GEN_AT(untrimmedline.tumorSizeSummary, "999") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Tumor Size Summary must = 999 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) && functions.GEN_AT(untrimmedline.tnmEditionNumber, "0088", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: TNM Edition Number must = 00, 88, or blank')
        return true

    }

    // ID: RQRS-00928; TAG: N2500; NAME: AJCC TNM Clin M (COC)
    public boolean rqrs00928(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
            return true
        char[] m_string = new char[476]
        
        functions.GEN_STRCPY(m_string, "cM0            cM0(i+)        cM1            cM1a           cM1a(0)        cM1a(1)        ")
        functions.GEN_STRCAT(m_string, "cM1b           cM1b(0)        cM1b(1)        cM1c           cM1c(0)        cM1c(1)        ")
        functions.GEN_STRCAT(m_string, "cM1d           cM1d(0)        cM1d(1)        pM1            pM1a           pM1a(0)        ")
        functions.GEN_STRCAT(m_string, "pM1a(1)        pM1b           pM1b(0)        pM1b(1)        pM1c           pM1c(0)        ")
        functions.GEN_STRCAT(m_string, "pM1c(1)        pM1d           pM1d(0)        pM1d(1)        88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, m_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00929; TAG: N2502; NAME: AJCC TNM Clin N (COC)
    public boolean rqrs00929(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinN))
            return true
        char[] n_string = new char[365]
        
        functions.GEN_STRCPY(n_string, "cNX            cN0            cN0a           cN0b           cN0(i+)        cN1            ")
        functions.GEN_STRCAT(n_string, "cN1mi          cN1a           cN1b           cN1c           cN2            cN2mi          ")
        functions.GEN_STRCAT(n_string, "cN2a           cN2b           cN2c           cN3            cN3a           cN3b           ")
        functions.GEN_STRCAT(n_string, "cN3c           88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmClinN, n_string, 15) == 0)
            return false
        return true

    }

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

    }

    // ID: RQRS-00931; TAG: N2804; NAME: AJCC TNM Clin N Suffix, AJCC ID (COC)
    public boolean rqrs00931(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix))
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "56798283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin N Suffix: ${untrimmedline.ajccTnmClinNSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00932; TAG: N2590; NAME: AJCC TNM Clin Stage Group (COC)
    public boolean rqrs00932(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "OccultCarcinoma0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1E             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2 bulky        2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1            3A2            3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0            3:1            3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6            3:7            3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12           3:13           3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18           3:19           3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24           3:25           4              4A             ")
        functions.GEN_STRCAT(s2_string, "4A1            4A2            4B             4C             4:0            4:1            ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4            4:5            4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10           4:11           4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16           4:17           4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22           4:23           4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmClinStageGroup, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.ajccTnmClinStageGroup, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00933; TAG: N2504; NAME: AJCC TNM Clin T (COC)
    public boolean rqrs00933(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinT))
            return true
        char[] t_string = new char[650]
        
        functions.GEN_STRCPY(t_string, "cTX            cT0            cTa            cTis           cTis(DCIS)     cTis(LAMN)     ")
        functions.GEN_STRCAT(t_string, "cTis(Paget)    cT1            cT1a           cT1a1          cT1a2          cT1b           ")
        functions.GEN_STRCAT(t_string, "cT1b1          cT1b2          cT1c           cT1c1          cT1c2          cT1c3          ")
        functions.GEN_STRCAT(t_string, "cT1d           cT1mi          cT2            cT2a           cT2a1          cT2a2          ")
        functions.GEN_STRCAT(t_string, "cT2b           cT2c           cT2d           cT3            cT3a           cT3b           ")
        functions.GEN_STRCAT(t_string, "cT3c           cT3d           cT3e           cT4            cT4a           cT4b           ")
        functions.GEN_STRCAT(t_string, "cT4c           cT4d           cT4e           88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmClinT, t_string, 15) == 0)
            return false
        return true

    }

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

    }

    // ID: RQRS-00935; TAG: N2807; NAME: AJCC TNM Clin T Suffix, AJCC ID (COC)
    public boolean rqrs00935(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ctsuff = new char[5]
        
        functions.GEN_STRCPY(ctsuff, " ")
        functions.GEN_STRCAT(ctsuff, untrimmedline.ajccTnmClinTSuffix)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix)) {
            return true
        }
        if (functions.GEN_STRCMP(ctsuff, " (s) ", 5) == 0) {
            if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "73") == 0)
                return false
        }
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45798283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin T Suffix: ${untrimmedline.ajccTnmClinTSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00936; TAG: N2820; NAME: AJCC TNM N, Suffix, Merkel Cell (COC)
    public boolean rqrs00936(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] pnsuff = new char[5]
        
        if (functions.GEN_AT(untrimmedline.ajccId, "46  ") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(pnsuff, " ")
        functions.GEN_STRCAT(pnsuff, untrimmedline.ajccTnmPathNSuffix)
        
        char[] ypnsuff = new char[5]
        
        functions.GEN_STRCPY(ypnsuff, " ")
        functions.GEN_STRCAT(ypnsuff, untrimmedline.ajccTnmPostTherapyNSuffix)
        
        if (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "pN1a(sn)") && functions.GEN_STRCMP(pnsuff, " (sn)") != 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path N Suffix: ${untrimmedline.ajccTnmPathNSuffix} not valid for AJCC TNM Path N: ${untrimmedline.ajccTnmPathN}')
        if (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "pN1a") && functions.GEN_STRCMP(pnsuff, " (sn)") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path N Suffix: ${untrimmedline.ajccTnmPathNSuffix} not valid for AJCC TNM Path N: ${untrimmedline.ajccTnmPathN}')
        if (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "pN1a(sn)") && functions.GEN_STRCMP(ypnsuff, " (sn)") != 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy N Suffix: ${untrimmedline.ajccTnmPostTherapyNSuffix} is not valid for AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN}')
        if (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "pN1a") && functions.GEN_STRCMP(ypnsuff, " (sn)") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy N Suffix: ${untrimmedline.ajccTnmPostTherapyNSuffix} is not valid for AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN}')
        return true

    }

    // ID: RQRS-00937; TAG: N2501; NAME: AJCC TNM Path M (COC)
    public boolean rqrs00937(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        char[] m_string = new char[476]
        
        functions.GEN_STRCPY(m_string, "cM0            cM0(i+)        cM1            cM1a           cM1a(0)        cM1a(1)        ")
        functions.GEN_STRCAT(m_string, "cM1b           cM1b(0)        cM1b(1)        cM1c           cM1c(0)        cM1c(1)        ")
        functions.GEN_STRCAT(m_string, "cM1d           cM1d(0)        cM1d(1)        pM1            pM1a           pM1a(0)        ")
        functions.GEN_STRCAT(m_string, "pM1a(1)        pM1b           pM1b(0)        pM1b(1)        pM1c           pM1c(0)        ")
        functions.GEN_STRCAT(m_string, "pM1c(1)        pM1d           pM1d(0)        pM1d(1)        88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPathM, m_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00938; TAG: N2582; NAME: AJCC TNM Path M1, Clin T, N, Surgery (COC)
    public boolean rqrs00938(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        char[] t_code = new char[16]
        char[] n_code = new char[16]
        char[] m_code = new char[16]
        
        functions.GEN_STRCPY(t_code, untrimmedline.ajccTnmPathT)
        functions.GEN_STRCPY(n_code, untrimmedline.ajccTnmPathN)
        functions.GEN_STRCPY(m_code, untrimmedline.ajccTnmPathM)
        
        if (functions.GEN_AT(functions.GEN_LEFT(t_code, 4), "pTispTa ", 4) != 0 && functions.GEN_AT(functions.GEN_LEFT(n_code, 3), "cN0") != 0)
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "5354", 2) != 0) {
            if (functions.GEN_STRCMP(t_code, "c", 1) == 0 || functions.GEN_STRCMP(n_code, "c", 1) == 0)
                return true
        }
        else {
            if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "3840414243446768", 2) != 0 && functions.GEN_STRCMP(t_code, "p", 1) == 0 && functions.GEN_AT(functions.GEN_LEFT(n_code, 3), "cN0") != 0)
                return true
            else {
                if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "47") != 0) {
                    if (functions.GEN_AT(functions.GEN_LEFT(t_code, 4), "pT1apT1b", 4) != 0 && functions.GEN_AT(functions.GEN_LEFT(n_code, 3), "cN0") != 0)
                        return true
                }
            }
        }
        if (functions.GEN_STRCMP(t_code, "c", 1) == 0 || functions.GEN_STRCMP(n_code, "c", 1) == 0) {
            if (functions.GEN_STRCMP(m_code, "p", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T and AJCC TNM Path N require TNM Path M1 for clinical T and N to be assigned')
            if (functions.GEN_AT(untrimmedline.ajccId, "59  ") != 0) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40-80"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T and AJCC TNM Path N require no surgery to support path staging for clinical T and N to be assigned')
            }
            else {
                if (functions.GEN_AT(untrimmedline.ajccId, "62.162.2", 4) != 0) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-80"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T and AJCC TNM Path N require no surgery to support path staging for clinical T and N to be assigned')
                }
                else {
                    if (functions.GEN_AT(untrimmedline.ajccId, "XX  ") == 0) {
                        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-80"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T and AJCC TNM Path N require no surgery to support path staging for clinical T and N to be assigned')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-00939; TAG: N2503; NAME: AJCC TNM Path N (COC)
    public boolean rqrs00939(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathN))
            return true
        char[] n_string = new char[730]
        
        functions.GEN_STRCPY(n_string, "pNX            pN0            pN0a           pN0(i+)        pN0(mol+)      ")
        functions.GEN_STRCAT(n_string, "pN1            pN1mi          pN1a(sn)       pN1a           pN1b           pN1c           ")
        functions.GEN_STRCAT(n_string, "pN2            pN2mi          pN2a           pN2b           pN2c           pN3            ")
        functions.GEN_STRCAT(n_string, "pN3a           pN3b           pN3c           ")
        functions.GEN_STRCAT(n_string, "cNX            cN0            cN0a           cN0b           cN0(i+)        cN1            ")
        functions.GEN_STRCAT(n_string, "cN1mi          cN1a           cN1b           cN1c           cN2            cN2mi          ")
        functions.GEN_STRCAT(n_string, "cN2a           cN2b           cN2c           cN3            cN3a           cN3b           ")
        functions.GEN_STRCAT(n_string, "cN3c           88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPathN, n_string, 15) == 0)
            return false
        return true

    }

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

    }

    // ID: RQRS-00941; TAG: N2805; NAME: AJCC TNM Path N Suffix, AJCC ID (COC)
    public boolean rqrs00941(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "455679818283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path N Suffix: ${untrimmedline.ajccTnmPathNSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00942; TAG: N2591; NAME: AJCC TNM Path Stage Group (COC)
    public boolean rqrs00942(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "OccultCarcinoma0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1E             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2 bulky        2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1            3A2            3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0            3:1            3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6            3:7            3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12           3:13           3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18           3:19           3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24           3:25           4              4A             ")
        functions.GEN_STRCAT(s2_string, "4B             4C             4:0            4:1            ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4            4:5            4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10           4:11           4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16           4:17           4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22           4:23           4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             3D             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPathStageGroup, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.ajccTnmPathStageGroup, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00943; TAG: N2505; NAME: AJCC TNM Path T (COC)
    public boolean rqrs00943(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathT))
            return true
        char[] t_string = new char[1300]
        
        functions.GEN_STRCPY(t_string, "pTX            pT0            pTa            pTis           pTis(DCIS)     pTis(LAMN)     ")
        functions.GEN_STRCAT(t_string, "pTis(Paget)    pT1            pT1a           pT1a1          pT1a2          pT1b           ")
        functions.GEN_STRCAT(t_string, "pT1b1          pT1b2          pT1c           pT1c1          pT1c2          pT1c3          ")
        functions.GEN_STRCAT(t_string, "pT1d           pT1mi          pT2            pT2a           pT2a1          pT2a2          ")
        functions.GEN_STRCAT(t_string, "pT2b           pT2c           pT2d           pT3            pT3a           pT3b           ")
        functions.GEN_STRCAT(t_string, "pT3c           pT3d           pT4            pT4a           pT4b           pT4c           ")
        functions.GEN_STRCAT(t_string, "pT4d           pT4e           ")
        functions.GEN_STRCAT(t_string, "cTX            cT0            cTa            cTis           cTis(DCIS)     cTis(LAMN)     ")
        functions.GEN_STRCAT(t_string, "cTis(Paget)    cT1            cT1a           cT1a1          cT1a2          cT1b           ")
        functions.GEN_STRCAT(t_string, "cT1b1          cT1b2          cT1c           cT1c1          cT1c2          cT1c3          ")
        functions.GEN_STRCAT(t_string, "cT1d           cT1mi          cT2            cT2a           cT2a1          cT2a2          ")
        functions.GEN_STRCAT(t_string, "cT2b           cT2c           cT2d           cT3            cT3a           cT3b           ")
        functions.GEN_STRCAT(t_string, "cT3c           cT3d           cT3e           cT4            cT4a           cT4b           ")
        functions.GEN_STRCAT(t_string, "cT4c           cT4d           cT4e           88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPathT, t_string, 15) == 0)
            return false
        return true

    }

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

    }

    // ID: RQRS-00945; TAG: N2808; NAME: AJCC TNM Path T Suffix, AJCC ID (COC)
    public boolean rqrs00945(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ptsuff = new char[5]
        
        functions.GEN_STRCPY(ptsuff, " ")
        functions.GEN_STRCAT(ptsuff, untrimmedline.ajccTnmPathTSuffix)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix)) {
            return true
        }
        if (functions.GEN_STRCMP(ptsuff, " (s) ", 5) == 0) {
            if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "73") == 0)
                return false
        }
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "4579818283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Path T Suffix: ${untrimmedline.ajccTnmPathTSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00946; TAG: N4901; NAME: AJCC TNM Path, AJCC TNM Clin (COC)
    public boolean rqrs00946(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN))
            return true
        char[] t_code = new char[16]
        char[] n_code = new char[16]
        
        functions.GEN_STRCPY(t_code, untrimmedline.ajccTnmPathT)
        functions.GEN_STRCPY(n_code, untrimmedline.ajccTnmPathN)
        
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT)) {
            if (functions.GEN_STRCMP(t_code, "c", 1) == 0 && functions.GEN_STRCMP(untrimmedline.ajccTnmClinT, "c", 1) == 0) {
                if (functions.GEN_STRCMP(t_code, untrimmedline.ajccTnmClinT) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin and Path categories must be equal when "c" prefix assigned to both categories')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN)) {
            if (functions.GEN_STRCMP(n_code, "c", 1) == 0 && functions.GEN_STRCMP(untrimmedline.ajccTnmClinN, "c", 1) == 0) {
                if (functions.GEN_STRCMP(n_code, untrimmedline.ajccTnmClinN) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin and Path categories must be equal when "c" prefix assigned to both categories')
            }
        }
        return true

    }

    // ID: RQRS-00947; TAG: N2587; NAME: AJCC TNM Post Therapy M (COC)
    public boolean rqrs00947(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM))
            return true
        char[] m_string = new char[476]
        
        functions.GEN_STRCPY(m_string, "cM0            cM0(i+)        cM1            cM1a           cM1a(0)        cM1a(1)        ")
        functions.GEN_STRCAT(m_string, "cM1b           cM1b(0)        cM1b(1)        cM1c           cM1c(0)        cM1c(1)        ")
        functions.GEN_STRCAT(m_string, "cM1d           cM1d(0)        cM1d(1)        pM1            pM1a           pM1a(0)        ")
        functions.GEN_STRCAT(m_string, "pM1a(1)        pM1b           pM1b(0)        pM1b(1)        pM1c           pM1c(0)        ")
        functions.GEN_STRCAT(m_string, "pM1c(1)        pM1d           pM1d(0)        pM1d(1)        88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPostTherapyM, m_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00948; TAG: N2588; NAME: AJCC TNM Post Therapy N (COC)
    public boolean rqrs00948(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN))
            return true
        char[] n_string = new char[395]
        
        functions.GEN_STRCPY(n_string, "ypNX           ypN0           ypN0a          ypN0(i+)       ypN0(mol+)     ")
        functions.GEN_STRCAT(n_string, "ypN1           ypN1mi         ypN1a(sn)      ypN1a          ypN1b          ypN1c          ")
        functions.GEN_STRCAT(n_string, "ypN2           ypN2mi         ypN2a          ypN2b          ypN2c          ypN3           ")
        functions.GEN_STRCAT(n_string, "ypN3a          ypN3b          ypN3c          88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPostTherapyN, n_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00949; TAG: N2619; NAME: AJCC TNM Post Therapy N Suffix (COC)
    public boolean rqrs00949(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ypnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(ypnsuff, " ")
        functions.GEN_STRCAT(ypnsuff, untrimmedline.ajccTnmPathNSuffix)
        
        if (functions.GEN_AT(ypnsuff, " (sn) (f) ", 5) == 0)
            return false
        return true

    }

    // ID: RQRS-00950; TAG: N2806; NAME: AJCC TNM Post Therapy N Suffix, AJCC ID (COC)
    public boolean rqrs00950(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "455679818283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy N Suffix: ${untrimmedline.ajccTnmPostTherapyNSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00951; TAG: N2592; NAME: AJCC TNM Post Therapy Stage Group (COC)
    public boolean rqrs00951(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "OccultCarcinoma0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             ")
        functions.GEN_STRCAT(s1_string, "2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1            3A2            3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0            3:1            3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6            3:7            3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12           3:13           3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18           3:19           3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24           3:25           4              4A             ")
        functions.GEN_STRCAT(s2_string, "4B             4C             4:0            4:1            ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4            4:5            4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10           4:11           4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16           4:17           4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22           4:23           4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             3D             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPostTherapyStageGroup, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.ajccTnmPostTherapyStageGroup, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-00952; TAG: N2589; NAME: AJCC TNM Post Therapy T (COC)
    public boolean rqrs00952(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT))
            return true
        char[] t_string = new char[650]
        
        functions.GEN_STRCPY(t_string, "ypTX           ypT0           ypTa           ypTis          ypTis(DCIS)    ypTis(LAMN)    ")
        functions.GEN_STRCAT(t_string, "ypTis(Paget)   ypT1           ypT1a          ypT1a1         ypT1a2         ypT1b          ")
        functions.GEN_STRCAT(t_string, "ypT1b1         ypT1b2         ypT1c          ypT1c1         ypT1c2         ypT1c3         ")
        functions.GEN_STRCAT(t_string, "ypT1d          ypT1mi         ypT2           ypT2a          ypT2a1         ypT2a2         ")
        functions.GEN_STRCAT(t_string, "ypT2b          ypT2c          ypT2d          ypT3           ypT3a          ypT3b          ")
        functions.GEN_STRCAT(t_string, "ypT3c          ypT3d          ypT4           ypT4a          ypT4b          ypT4c          ")
        functions.GEN_STRCAT(t_string, "ypT4d          ypT4e          88             ")
        
        if (functions.GEN_AT(untrimmedline.ajccTnmPostTherapyT, t_string, 15) == 0)
            return false
        return true

    }

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

    }

    // ID: RQRS-00954; TAG: N2809; NAME: AJCC TNM Post Therapy T Suffix, AJCC ID (COC)
    public boolean rqrs00954(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] yptsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix)) {
            return true
        }
        if (functions.GEN_STRCMP(yptsuff, " (s) ", 5) == 0) {
            if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "73") == 0)
                return false
        }
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "4579818283XX", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Post Therapy T Suffix: ${untrimmedline.ajccTnmPostTherapyTSuffix} not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        return true

    }

    // ID: RQRS-00955; TAG: N2819; NAME: AJCC TNM, Date of Diagnosis (COC)
    public boolean rqrs00955(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] stage88 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'All AJCC TNM fields must be blank for pre-2018 diagnoses')
        }
        functions.GEN_STRCPY(stage88, "14  16.318.238.238.340  42  45  65  66  67.169  ")
        functions.GEN_STRCAT(stage88, "70  71  72  75  81.282.182.283.083.183.383.4")
        
        if (dx_year >= 2018) {
        
        
            functions.GEN_STRCPY(stage88, "14  16.318.238.238.340  42  45  65  66  67.169  ")
            functions.GEN_STRCAT(stage88, "70  71  72  75  81.282.182.283.083.183.383.4")
        
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin Stage Group must not be blank for cases diagnosed 2018 and later')
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group must be reported for 2018+ diagnoses')
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") == 0 && functions.GEN_AT(untrimmedline.ajccId, stage88, 4) == 0) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group, but not both, must be reported for 2018+ diagnoses')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Path Stage Group is blank, all AJCC TNM Path fields must be blank')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'if AJCC TNM Post Therapy Stage Group is blank, all AJCC TNM Post Therapy fields must be blank')
            }
        }
        return true

    }

    // ID: RQRS-00956; TAG: N3045; NAME: AJCC TNM, Date of Diagnosis, AJCC ID (CCCR)
    public boolean rqrs00956(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'All AJCC TNM fields must be blank for pre-2018 diagnoses')
            }
        }
        functions.GEN_STRCPY(ID, "20  36  48.148.258  ")
        
        if (functions.GEN_AT(untrimmedline.ajccId, ID, 4) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) || functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0)
                return true
            if (dx_year >= 2018) {
                if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Clin Stage Group or NPCR Derived AJCC 8 TNM Clin Stg Grp (or both) must be reported for cases diagnosed 2018 and later')
            }
            if (dx_year >= 2018) {
                if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Path (coded and/or derived) or Post Therapy (coded and/or derived) stage group field, but not both, must be reported for 2018+ diagnoses')
            }
            if (dx_year >= 2018) {
                if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp)) && (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp)))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Path (coded and/or derived) or Post Therapy (coded and/or derived) stage group field, but not both, must be reported for 2018+ diagnoses')
            }
        }
        if (dx_year >= 2018) {
            if (functions.GEN_AT(untrimmedline.ajccId, ID, 4) == 0) {
                if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp) && functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup)) {
                    if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Clin Stage Group and NPCR Derived AJCC 8 TNM Clin Stg Grp are blank, all AJCC TNM clin fields must be blank')
                }
            }
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Path Stage Group and NPCR Derived AJCC 8 TNM Path Stg Grp are blank, all AJCC TNM Path fields must be blank')
            }
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Post Therapy Stage Group and NPCR Derived AJCC 8 TNM Post Therapy Stg Grp are blank, all AJCC TNM Post Therapy fields must be blank')
            }
        }
        return true

    }

    // ID: RQRS-00957; TAG: N2825; NAME: AJCC TNM, Date of Diagnosis, CoC Accredited Flag (NPCR)
    public boolean rqrs00957(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] stage88 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'All AJCC TNM fields must be blank for pre-2018 diagnoses')
        }
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0 && dx_year >= 2018) {
            functions.GEN_STRCPY(stage88, "14  16.318.238.238.340  42  45  65  66  67.169  ")
            functions.GEN_STRCAT(stage88, "70  71  72  75  81.282.182.283.083.183.383.4")
        
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin Stage Group must not be blank for cases diagnosed 2018 and later')
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group must be reported for 2018+ diagnoses')
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") == 0 && functions.GEN_AT(untrimmedline.ajccId, stage88, 4) == 0) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group, but not both, must be reported for 2018+ diagnoses')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Path Stage Group is blank, all AJCC TNM Path fields must be blank')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'if AJCC TNM Post Therapy Stage Group is blank, all AJCC TNM Post Therapy fields must be blank')
            }
        }
        return true

    }

    // ID: RQRS-00958; TAG: N3044; NAME: AJCC TNM, Date of Diagnosis, CoC Flag (SEER)
    public boolean rqrs00958(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] stage88 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'All AJCC TNM fields must be blank for pre-2018 diagnoses')
            }
        }
        functions.GEN_STRCPY(stage88, "14  16.318.238.238.340  42  45  65  66  67.169  ")
        functions.GEN_STRCAT(stage88, "70  71  72  75  81.282.182.283.083.183.383.4")
        
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0 && dx_year >= 2018) {
        
            functions.GEN_STRCPY(stage88, "14  16.318.238.238.340  42  45  65  66  67.169  ")
            functions.GEN_STRCAT(stage88, "70  71  72  75  81.282.182.283.083.183.383.4")
        
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin Stage Group must not be blank for cases diagnosed 2018 and later')
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group must be reported for 2018+ diagnoses')
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") == 0 && functions.GEN_AT(untrimmedline.ajccId, stage88, 4) == 0) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Either AJCC TNM Path Stage Group or AJCC TNM Post Therapy Stage Group, but not both, must be reported for 2018+ diagnoses')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Path Stage Group is blank, all AJCC TNM Path fields must be blank')
            }
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
                if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'if AJCC TNM Post Therapy Stage Group is blank, all AJCC TNM Post Therapy fields must be blank')
            }
        }
        return true

    }

    // ID: RQRS-00959; TAG: N2817; NAME: AJCC TNM, TNM Edition Number, AJCC ID (COC)
    public boolean rqrs00959(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") != 0) {
            if ((functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70,48.1,48.2") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 08, AJCC TNM fields must indicate staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'if TNM Edition Number = 88, AJCC TNM fields must indicate no staging applicable')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "99") || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 00, all AJCC TNM fields must indicate no staging assigned')
        }
        return true

    }

    // ID: RQRS-00960; TAG: N4907; NAME: AJCC TNM, TNM Edition Number, AJCC ID (SEER)
    public boolean rqrs00960(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'IF TNM Edition Number = blank, all AJCC TNM data items must be blank')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") != 0) {
            if ((functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70,48.1,48.2") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 08, AJCC TNM fields must indicate staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0) {
            if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) && !functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && !functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && !functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'if TNM Edition Number = 88, AJCC TNM fields must indicate no staging applicable')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 00, all AJCC TNM fields must indicate no staging assigned')
        }
        return true

    }

    // ID: RQRS-00961; TAG: N4908; NAME: AJCC TNM, TNM Edition Number, AJCC ID, CoC Flag (NPCR)
    public boolean rqrs00961(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") != 0) {
            if ((functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70,48.1,48.2") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83,XX")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,XX")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 08, AJCC TNM fields must indicate staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'if TNM Edition Number = 88, AJCC TNM fields must indicate no staging applicable')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "99") || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 00, all AJCC TNM fields must indicate no staging assigned')
        }
        return true

    }

    // ID: RQRS-00962; TAG: N0902; NAME: Ambig Term DX, Date Conclusive DX (SEER IF162)
    public boolean rqrs00962(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: RQRS-00963; TAG: N1381; NAME: Ambiguous Terminology DX, Date of DX (CCCR)
    public boolean rqrs00963(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00964; TAG: N2742; NAME: Anemia, Date DX (NAACCR)
    public boolean rqrs00964(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.anemia))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Anemia must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.anemia))
            return true
        if (functions.GEN_AT(untrimmedline.anemia, "01679", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.anemia} not valid code for Anemia')
        return true

    }

    // ID: RQRS-00965; TAG: N2874; NAME: Anemia, Schema ID, Required (NAACCR)
    public boolean rqrs00965(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00795", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.anemia))
                return false
        }
        return true

    }

    // ID: RQRS-00966; TAG: N0831; NAME: Autopsy Only, RX (NPCR)
    public boolean rqrs00966(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2006 || dx_year > 2018)
            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.histologyIcdO3, "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.rxSummSystemicSurgSeq, "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: RQRS-00967; TAG: N2939; NAME: B Symptoms, Date DX (NAACCR)
    public boolean rqrs00967(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.bSymptoms))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'B Symptoms must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.bSymptoms))
            return true
        if (functions.GEN_AT(untrimmedline.bSymptoms, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.bSymptoms} not valid code for B Symptoms')
        return true

    }

    // ID: RQRS-00968; TAG: N2951; NAME: B Symptoms, Schema ID, Required (NAACCR)
    public boolean rqrs00968(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.bSymptoms) || functions.GEN_AT(untrimmedline.bSymptoms, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00969; TAG: N0624; NAME: Behav ICDO2, Date of DX, ICDO2 Conv Flag (SEER IF85)
    public boolean rqrs00969(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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
        }
        if (dx_year > 2000) {
            if (!functions.GEN_EMPTY(untrimmedline.behaviorIcdO2)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO2ConversionFlag, "0,5,6"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-00970; TAG: N0626; NAME: Behav ICDO3, Date of DX, ICDO3 Conv Flag (SEER IF87)
    public boolean rqrs00970(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year > 2000)) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
                return false
        }
        if (dx_year < 2001) {
            if (!functions.GEN_EMPTY(untrimmedline.behaviorIcdO3)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "1,3"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-00971; TAG: N0638; NAME: Behavior (73-91) ICD-O-1 (SEER)
    public boolean rqrs00971(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: RQRS-00972; TAG: N0653; NAME: Behavior Code ICDO3, Seq Num--Central (SEER IF114)
    public boolean rqrs00972(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.behaviorIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8442,8451,8462,8472,8473")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,99", "(\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1"))
                    return true
            }
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9589") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,98,99", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3"))
                return true
            else
                return false
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-00973; TAG: N0492; NAME: Behavior ICDO2, Histology ICDO2 (NAACCR)
    public boolean rqrs00973(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.RQRS_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.RQRS_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: RQRS-00974; TAG: N0365; NAME: Behavior ICDO2, Summary Stage 1977 (NAACCR)
    public boolean rqrs00974(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: RQRS-00975; TAG: N0837; NAME: Behavior ICDO3 Conversion (NAACCR)
    public boolean rqrs00975(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0-3")

    }

    // ID: RQRS-00976; TAG: N0654; NAME: Behavior ICDO3, Site, Histology ICDO3 (NAACCR)
    public boolean rqrs00976(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.behaviorIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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.behaviorIcdO3, "1")) {
            if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8442,8451,8462,8472,8473"))
                return true
        }
        return false

    }

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

    }

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

    }

    // ID: RQRS-00979; TAG: N2652; NAME: Bilirubin Pretreatment Total Lab Value, Date DX (NAACCR)
    public boolean rqrs00979(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] bili = new char[5]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Bilirubin Pretreatment Total Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.bilirubinPretreatmentTotalLabValue, 4, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Bilirubin Pretreatment Total Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(bili, functions.GEN_SUBSTR(untrimmedline.bilirubinPretreatmentTotalLabValue, 1, 3))
        functions.GEN_STRCAT(bili, functions.GEN_SUBSTR(untrimmedline.bilirubinPretreatmentTotalLabValue, 5, 1))
        
        if (functions.GEN_AT(bili, "XXX1XXX7XXX8XXX9", 4) == 0 && !functions.GEN_MATCH(bili, "(\\s\\s\\d\\d)") && !functions.GEN_MATCH(bili, "(\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(bili, "((([1-9]))\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.bilirubinPretreatmentTotalLabValue} not valid code for Bilirubin Pretreatment Total Lab Value')
        return true

    }

    // ID: RQRS-00980; TAG: N2950; NAME: Bilirubin Pretreatment Total Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs00980(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue) || functions.GEN_AT(untrimmedline.bilirubinPretreatmentTotalLabValue, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00981; TAG: N3908; NAME: Bilirubin Pretreatment Total Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00981(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue) || functions.GEN_AT(untrimmedline.bilirubinPretreatmentTotalLabValue, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00982; TAG: N2722; NAME: Bilirubin Pretreatment Unit of Measure, Date DX (NAACCR)
    public boolean rqrs00982(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Bilirubin Pretreatment Unit of Measure must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure))
            return true
        if (functions.GEN_AT(untrimmedline.bilirubinPretreatmentUnitOfMeasure, "12789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.bilirubinPretreatmentUnitOfMeasure} not valid code for Bilirubin Pretreatment Unit of Measure')
        return true

    }

    // ID: RQRS-00983; TAG: N2975; NAME: Bilirubin Pretreatment Unit of Measure, Schema ID, Required (NAACCR)
    public boolean rqrs00983(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure) || functions.GEN_AT(untrimmedline.bilirubinPretreatmentUnitOfMeasure, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00984; TAG: N3909; NAME: Bilirubin Pretreatment Unit of Measure, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs00984(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure) || functions.GEN_AT(untrimmedline.bilirubinPretreatmentUnitOfMeasure, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00985; TAG: N0002; NAME: Birthplace (SEER POB)
    public boolean rqrs00985(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.RQRS_BPLACE, context.RQRS_BPLACE_CODE, [:])

    }

    // ID: RQRS-00986; TAG: N1668; NAME: Birthplace--Country (NAACCR)
    public boolean rqrs00986(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00987; TAG: N1672; NAME: Birthplace--Country, Birthplace--State (NAACCR)
    public boolean rqrs00987(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00988; TAG: N1690; NAME: Birthplace--Country, Date of Diagnosis (NAACCR)
    public boolean rqrs00988(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00989; TAG: N1673; NAME: Birthplace--Geocode, Country, State (NAACCR)
    public boolean rqrs00989(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_GEOCNTRYST, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00990; TAG: N1671; NAME: Birthplace--State (NAACCR)
    public boolean rqrs00990(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.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_STATE, [:]))
            return false
        
        return true

    }

    // ID: RQRS-00991; TAG: N1693; NAME: Birthplace--State, Date of Diagnosis (NAACCR)
    public boolean rqrs00991(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-00992; TAG: N2697; NAME: Bone Invasion, Date DX (NAACCR)
    public boolean rqrs00992(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.boneInvasion))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Bone Invasion must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.boneInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.boneInvasion, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.boneInvasion} not valid code for Bone Invasion')
        return true

    }

    // ID: RQRS-00993; TAG: N2875; NAME: Bone Invasion, Schema ID, Required (NAACCR)
    public boolean rqrs00993(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[50]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00400 00410 00421 00422 00440 00450 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.boneInvasion) || functions.GEN_AT(untrimmedline.boneInvasion, "8") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Bone Invasion must not be blank or not applicable for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-00996; TAG: N3022; NAME: Brain Molecular Markers, Schema ID, Required (NAACCR)
    public boolean rqrs00996(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) || functions.GEN_AT(untrimmedline.brainMolecularMarkers, "88") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-00997; TAG: N2655; NAME: Breslow Tumor Thickness, Date DX (NAACCR)
    public boolean rqrs00997(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] Breslow = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.breslowTumorThickness)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.breslowTumorThickness, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(Breslow, functions.GEN_SUBSTR(untrimmedline.breslowTumorThickness, 1, 2))
        functions.GEN_STRCAT(Breslow, functions.GEN_SUBSTR(untrimmedline.breslowTumorThickness, 4, 1))
        
        if (functions.GEN_AT(Breslow, "AX0XX1XX8XX9", 3) == 0 && !functions.GEN_MATCH(Breslow, "(((A))\\d\\d)") && !functions.GEN_MATCH(Breslow, "(\\s\\d\\d)") && !functions.GEN_MATCH(Breslow, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.breslowTumorThickness} not valid code for Breslow Tumor Thickness')
        return true

    }

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

    }

    // ID: RQRS-00999; TAG: N2855; NAME: Breslow Tumor Thickness, Schema ID, Required (NAACCR)
    public boolean rqrs00999(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        char[] Breslow = new char[4]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(Breslow, functions.GEN_SUBSTR(untrimmedline.breslowTumorThickness, 1, 2))
        functions.GEN_STRCAT(Breslow, functions.GEN_SUBSTR(untrimmedline.breslowTumorThickness, 4, 1))
        
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(Breslow) || functions.GEN_AT(Breslow, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01000; TAG: N2644; NAME: CA-125 Pretreatment Interpretation, Date DX (NAACCR)
    public boolean rqrs01000(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CA-125 Pretreatment Interpretation must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation))
            return true
        if (functions.GEN_AT(untrimmedline.ca125PretreatmentInterpretation, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ca125PretreatmentInterpretation} not valid code for CA-125 Pretreatment Interpretation')
        return true

    }

    // ID: RQRS-01001; TAG: N2943; NAME: CA-125 Pretreatment Interpretation, Schema ID, Required (NAACCR)
    public boolean rqrs01001(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00551 00552 00553 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation) || functions.GEN_AT(untrimmedline.ca125PretreatmentInterpretation, "8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01004; TAG: N0793; NAME: Casefinding Source, Date of DX (SEER IF153)
    public boolean rqrs01004(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_EMPTY(untrimmedline.casefindingSource))
                return false
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.casefindingSource))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Casefinding Source must be blank')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01007; TAG: N2691; NAME: CEA Pretreatment Interpretation, Date DX (NAACCR)
    public boolean rqrs01007(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CEA Pretreatment Interpretation must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation))
            return true
        if (functions.GEN_AT(untrimmedline.ceaPretreatmentInterpretation, "0123789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ceaPretreatmentInterpretation} not valid code for CEA Pretreatment Interpretation')
        return true

    }

    // ID: RQRS-01008; TAG: N2998; NAME: CEA Pretreatment Interpretation, Schema ID, Required (NAACCR)
    public boolean rqrs01008(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00190 00200 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation) || functions.GEN_AT(untrimmedline.ceaPretreatmentInterpretation, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01009; TAG: N2649; NAME: CEA Pretreatment Lab Value, Date DX (NAACCR)
    public boolean rqrs01009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] CEA = new char[6]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CEA Pretreatment Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ceaPretreatmentLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.ceaPretreatmentLabValue, 5, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'CEA Pretreatment Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(CEA, functions.GEN_SUBSTR(untrimmedline.ceaPretreatmentLabValue, 1, 4))
        functions.GEN_STRCAT(CEA, functions.GEN_SUBSTR(untrimmedline.ceaPretreatmentLabValue, 6, 1))
        
        if (functions.GEN_AT(CEA, "XXXX1XXXX7XXXX8XXXX9", 5) == 0 && !functions.GEN_MATCH(CEA, "(\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(CEA, "(\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(CEA, "(\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(CEA, "((([1-9]))\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ceaPretreatmentLabValue} not valid code for CEA Pretreatment Lab Value')
        return true

    }

    // ID: RQRS-01010; TAG: N2999; NAME: CEA Pretreatment Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01010(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00190 00200 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ceaPretreatmentLabValue) || functions.GEN_AT(untrimmedline.ceaPretreatmentLabValue, "XXXX.8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01013; TAG: N2844; NAME: Census Block Group 2020 (NAACCR)
    public boolean rqrs01013(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusBlockGroup2020))
            return true
        return functions.GEN_INLIST(untrimmedline.censusBlockGroup2020, "0-9")

    }

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

    }

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

    }

    // ID: RQRS-01016; TAG: N0310; NAME: Census Cod Sys 1970/80/90, Date of Diag (SEER IF49)
    public boolean rqrs01016(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.censusCodingSys708090))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "29,33,37,42,43,44,51", "(00000015\\d\\d)", 9, 2))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "22", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "017,049,181")) {
            if ((dx_year > 1972) && (dx_year < 1978)) {
                if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "0"))
                    return true
                else
                    return false
            }
            else {
                if ((dx_year > 1977) && (dx_year < 1988)) {
                    if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "0,2"))
                        return true
                    else
                        return false
                }
                else {
                    if (dx_year > 1987) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "3"))
                            return true
                        else
                            return false
                    }
                    else
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.registryId, "23", "(00000015\\d\\d)", 9, 2)) {
                if ((dx_year > 1972) && (dx_year < 1978)) {
                    if (functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "001, 043")) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "1"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "0"))
                            return true
                        else
                            return false
                    }
                }
                else {
                    if ((dx_year > 1977) && (dx_year < 1988)) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "2"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (dx_year > 1987) {
                            if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "3"))
                                return true
                            else
                                return false
                        }
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.registryId, "01,02,20,21,23,27,31,35", "(00000015\\d\\d)", 9, 2) || (functions.GEN_INLIST(untrimmedline.registryId, "22", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "013,061,103,113,153,155,163,193")) || (functions.GEN_INLIST(untrimmedline.registryId, "25", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "033,035,053,061,067,073")) || (functions.GEN_INLIST(untrimmedline.registryId, "26", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "057,011,035,049")) || (functions.GEN_INLIST(untrimmedline.registryId, "26", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "045") && (dx_year > 1977))) {
                    if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "0"))
                        return false
                    else {
                        if ((dx_year > 1972) && (dx_year < 1978)) {
                            if (!(functions.GEN_INLIST(untrimmedline.registryId, "25", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "035,067,073"))) {
                                if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "1"))
                                    return true
                                else
                                    return false
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "2"))
                                    return true
                                else
                                    return false
                            }
                        }
                        else {
                            if ((dx_year > 1977) && (dx_year < 1988)) {
                                if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "2"))
                                    return true
                                else
                                    return false
                            }
                            else {
                                if (dx_year > 1987) {
                                    if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "2,3"))
                                        return true
                                    else
                                        return false
                                }
                            }
                        }
                    }
                }
                else {
                    if (dx_year > 1987) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "3"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.censusCodingSys708090, "0"))
                            return true
                        else
                            return false
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01017; TAG: N0163; NAME: Census Ind Code 1970-2000 vs. Coding System (NPCR)
    public boolean rqrs01017(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.occupationIndustryCodingSys, "3")) {
            if (functions.GEN_EMPTY(untrimmedline.industryCodeCensus))
                return true
            if (!functions.GEN_LOOKUP(untrimmedline.industryCodeCensus, context.RQRS_IND_1990, context.RQRS_IND_1990_CODE, [:]))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.occupationIndustryCodingSys, "4")) {
                if (functions.GEN_EMPTY(untrimmedline.industryCodeCensus))
                    return true
                if (!functions.GEN_LOOKUP(untrimmedline.industryCodeCensus, context.RQRS_IND_2000, context.RQRS_IND_2000_CODE, [:]))
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-01018; TAG: N1676; NAME: Census Ind Code 2010 CDC (NPCR)
    public boolean rqrs01018(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusIndCode2010))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusIndCode2010, "0000-9999", "(\\d\\d\\d\\d)"))
            return false
        if (!functions.GEN_LOOKUP(untrimmedline.censusIndCode2010, context.RQRS_IND_2010, context.RQRS_IND_2010_CODE, [:]))
            return false
        
        return true

    }

    // ID: RQRS-01019; TAG: N0166; NAME: Census Occ Code 1970-2000 vs. Coding System (NPCR)
    public boolean rqrs01019(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.occupationIndustryCodingSys, "3")) {
            if (functions.GEN_EMPTY(untrimmedline.occupationCodeCensus))
                return true
            if (!functions.GEN_LOOKUP(untrimmedline.occupationCodeCensus, context.RQRS_OCC_1990, context.RQRS_OCC_1990_CODE, [:]))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.occupationIndustryCodingSys, "4")) {
                if (functions.GEN_EMPTY(untrimmedline.occupationCodeCensus))
                    return true
                if (!functions.GEN_LOOKUP(untrimmedline.occupationCodeCensus, context.RQRS_OCC_2000, context.RQRS_OCC_2000_CODE, [:]))
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-01020; TAG: N1677; NAME: Census Occ Code 2010 CDC (NPCR)
    public boolean rqrs01020(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusOccCode2010))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusOccCode2010, "0000-9999", "(\\d\\d\\d\\d)"))
            return false
        if (!functions.GEN_LOOKUP(untrimmedline.censusOccCode2010, context.RQRS_OCC_2010, context.RQRS_OCC_2010_CODE, [:]))
            return false
        
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01024; TAG: N0734; NAME: Census Tr Certainty 2000, Date of DX (SEER IF112)
    public boolean rqrs01024(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001533", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000))
                return true
        }
        if ((dx_year > 1995) && (dx_year < 2001)) {
            if (functions.GEN_EMPTY(untrimmedline.censusCertainty2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return true
            }
        }
        if ((dx_year > 2000) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusCertainty2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        if ((dx_year > 1995) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusCertainty2000)) {
                if (!functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        else
            return true
        
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01028; TAG: N1801; NAME: Census Tr Poverty Indictr, Date of DX (NPCR)
    public boolean rqrs01028(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2013) {
            if (functions.GEN_EMPTY(untrimmedline.censusPovertyIndictr))
                return false
        }
        
        return true

    }

    // ID: RQRS-01029; TAG: N1691; NAME: Census Tr Poverty Indictr, Date of DX (SEER)
    public boolean rqrs01029(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.censusPovertyIndictr))
                return false
        }
        
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01033; TAG: N0733; NAME: Census Tract 2000, Date of DX (SEER IF111)
    public boolean rqrs01033(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year > 1995) && (dx_year < 2001)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return true
            }
        }
        if ((dx_year > 2000) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        if ((dx_year > 1995) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (!functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        else
            return true
        
        return true

    }

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

    }

    // ID: RQRS-01035; TAG: N2440; NAME: Census Tract 2000, State, County GC 2000 (NAACCR)
    public boolean rqrs01035(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2000) || functions.GEN_INLIST(untrimmedline.censusTract2000, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addressAtDxState) || functions.GEN_EMPTY(untrimmedline.countyDxGeocode2000) || functions.GEN_INLIST(untrimmedline.countyDxGeocode2000, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addressAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyDxGeocode2000)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2000)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.RQRS_TRAC2000, context.RQRS_TRAC2000_STCNTYTRAC, [:]))
            return false
        return true

    }

    // ID: RQRS-01036; TAG: N1938; NAME: Census Tract 2000, State, County, 2000-2009 (NPCR)
    public boolean rqrs01036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if ((dx_year < 2000) || (dx_year > 2009))
            return true
        if (functions.GEN_EMPTY(untrimmedline.censusTract2000) || functions.GEN_INLIST(untrimmedline.censusTract2000, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addressAtDxState) || functions.GEN_EMPTY(untrimmedline.addressAtDxCounty) || functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addressAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.addressAtDxCounty)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2000)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.RQRS_TRAC2000, context.RQRS_TRAC2000_STCNTYTRAC, [:]))
            return false
        return true

    }

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

    }

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

    }

    // ID: RQRS-01039; TAG: N2441; NAME: Census Tract 2010, State, County GC 2010 (NAACCR)
    public boolean rqrs01039(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2010) || functions.GEN_INLIST(untrimmedline.censusTract2010, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addressAtDxState) || functions.GEN_EMPTY(untrimmedline.countyDxGeocode2010) || functions.GEN_INLIST(untrimmedline.countyDxGeocode2010, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addressAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyDxGeocode2010)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2010)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.RQRS_TRAC2010, context.RQRS_TRAC2010_STCNTYTRAC, [:]))
            return false
        return true

    }

    // ID: RQRS-01040; TAG: N1937; NAME: Census Tract 2010, State, County, 2010-2019 (NPCR)
    public boolean rqrs01040(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if ((dx_year < 2010) || (dx_year > 2019))
            return true
        if (functions.GEN_EMPTY(untrimmedline.censusTract2010) || functions.GEN_INLIST(untrimmedline.censusTract2010, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addressAtDxState) || functions.GEN_EMPTY(untrimmedline.addressAtDxCounty) || functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addressAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.addressAtDxCounty)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2010)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.RQRS_TRAC2010, context.RQRS_TRAC2010_STCNTYTRAC, [:]))
            return false
        return true

    }

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

    }

    // ID: RQRS-01042; TAG: N0630; NAME: Cervix In Situ ICDO3 (SEER IF88)
    public boolean rqrs01042(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.behaviorIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (((dx_year > 1995) && (dx_year < 2003)) && functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2") && functions.GEN_VAL(untrimmedline.histologyIcdO3) < 9590) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "98"))
                return true
            else
                return false
        }
        if (functions.GEN_VAL(untrimmedline.sequenceNumberCentral) == 98) {
            if (((dx_year > 1995) && (dx_year < 2003)) && functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2") && functions.GEN_VAL(untrimmedline.histologyIcdO3) < 9590)
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01043; TAG: N2623; NAME: Chromosome 19q: Loss of Heterozygosity (LOH), Date DX (NAACCR)
    public boolean rqrs01043(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 19q: Loss of Heterozygosity (LOH) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity))
            return true
        if (functions.GEN_AT(untrimmedline.chromosome19qLossOfHeterozygosity, "016789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.chromosome19qLossOfHeterozygosity} not valid code for Chromosome 19q: Loss of Heterozygosity (LOH)')
        return true

    }

    // ID: RQRS-01044; TAG: N2942; NAME: Chromosome 19q: Loss of Heterozygosity (LOH), Schema ID, Required (NAACCR)
    public boolean rqrs01044(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity) || functions.GEN_AT(untrimmedline.chromosome19qLossOfHeterozygosity, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01045; TAG: N2622; NAME: Chromosome 1p: Loss of Heterozygosity (LOH), Date DX (NAACCR)
    public boolean rqrs01045(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 1p: Loss of Heterozygosity (LOH) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity))
            return true
        if (functions.GEN_AT(untrimmedline.chromosome1pLossOfHeterozygosity, "016789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.chromosome1pLossOfHeterozygosity} not valid code for Chromosome 1p: Loss of Heterozygosity (LOH)')
        return true

    }

    // ID: RQRS-01046; TAG: N2941; NAME: Chromosome 1p: Loss of Heterozygosity (LOH), Schema ID, Required (NAACCR)
    public boolean rqrs01046(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity) || functions.GEN_AT(untrimmedline.chromosome1pLossOfHeterozygosity, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01047; TAG: N2665; NAME: Chromosome 3 Status, Date DX (NAACCR)
    public boolean rqrs01047(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 3 Status must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.chromosome3Status))
            return true
        if (functions.GEN_AT(untrimmedline.chromosome3Status, "0123789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.chromosome3Status} not valid code for Chromosome 3 Status')
        return true

    }

    // ID: RQRS-01048; TAG: N2952; NAME: Chromosome 3 Status, Schema ID, Required (NAACCR)
    public boolean rqrs01048(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome3Status) || functions.GEN_AT(untrimmedline.chromosome3Status, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01049; TAG: N3910; NAME: Chromosome 3 Status, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01049(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome3Status) || functions.GEN_AT(untrimmedline.chromosome3Status, "8") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 3 Status must not be blank or not applicable for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01050; TAG: N2666; NAME: Chromosome 8q Status, Date DX (NAACCR)
    public boolean rqrs01050(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome8qStatus))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 8q Status must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.chromosome8qStatus))
            return true
        if (functions.GEN_AT(untrimmedline.chromosome8qStatus, "01789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.chromosome8qStatus} not valid code for Chromosome 8q Status')
        return true

    }

    // ID: RQRS-01051; TAG: N2953; NAME: Chromosome 8q Status, Schema ID, Required (NAACCR)
    public boolean rqrs01051(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome8qStatus) || functions.GEN_AT(untrimmedline.chromosome8qStatus, "8") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 8q Status must not be blank or not applicable for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01052; TAG: N3911; NAME: Chromosome 8q Status, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.chromosome8qStatus) || functions.GEN_AT(untrimmedline.chromosome8qStatus, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01053; TAG: N2693; NAME: Circumferential Resection Margin (CRM), Date DX (NAACCR)
    public boolean rqrs01053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] CRM = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.circumferentialResectionMargin, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM) must be right justified with one decimal place')
        functions.GEN_STRCPY(CRM, functions.GEN_SUBSTR(untrimmedline.circumferentialResectionMargin, 1, 2))
        functions.GEN_STRCAT(CRM, functions.GEN_SUBSTR(untrimmedline.circumferentialResectionMargin, 4, 1))
        
        if (functions.GEN_AT(CRM, "XX0XX1XX2XX3XX4XX5XX6XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(CRM, "(\\s\\d\\d)") && !functions.GEN_MATCH(CRM, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.circumferentialResectionMargin} not valid code for Circumferential Resection Margin (CRM)')
        return true

    }

    // ID: RQRS-01054; TAG: N2989; NAME: Circumferential Resection Margin (CRM), Schema ID, Required (NAACCR)
    public boolean rqrs01054(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin) || functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01058; TAG: N0353; NAME: Class, Date Diag, Date Last Cont, Vit Stat (COC)
    public boolean rqrs01058(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38,49")) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "38"))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastContact, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        if (dtcmp != 0)
            return false
        return true
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact))
                functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp == 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-01060; TAG: N2985; NAME: CoC Accredited Flag, Class of Case (NPCR)
    public boolean rqrs01060(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag) || functions.GEN_AT(untrimmedline.cocAccreditedFlag, "0") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.classOfCase) || functions.GEN_AT(untrimmedline.classOfCase, "49", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.classOfCase, "1011121314202122", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.classOfCase, "003031323334353637384041424399", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "2") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-01061; TAG: N2811; NAME: CoC Accredited Flag, Type Report Source (NPCR)
    public boolean rqrs01061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01062; TAG: N0548; NAME: COC Coding Sys--Current (NAACCR)
    public boolean rqrs01062(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: RQRS-01063; TAG: N0367; NAME: COC Coding Sys--Current, Date of Diagnosis (NAACCR)
    public boolean rqrs01063(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-01064; TAG: N0861; NAME: COC Coding Sys--Original, Date of DX (NAACCR)
    public boolean rqrs01064(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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: RQRS-01065; TAG: N0121; NAME: Coding System for EOD (SEER EODSYST)
    public boolean rqrs01065(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodCodingSys)) {
            return true
        }
        return functions.GEN_INLIST(untrimmedline.eodCodingSys, "0-4", "(\\d)")

    }

    // ID: RQRS-01066; TAG: N0214; NAME: CompEthn, Date of Diag (SEER IF71)
    public boolean rqrs01066(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1993) {
            if (functions.GEN_EMPTY(untrimmedline.computedEthnicity))
                return false
            else
                return true
        }
        
        return true

    }

    // ID: RQRS-01067; TAG: N0215; NAME: Computed Ethnicity (SEER COMPETHN)
    public boolean rqrs01067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.computedEthnicity, "0-7") || functions.GEN_EMPTY(untrimmedline.computedEthnicity))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01068; TAG: N0216; NAME: Computed Ethnicity Source (SEER ETHNSRC)
    public boolean rqrs01068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.computedEthnicitySource, "0-9") || functions.GEN_EMPTY(untrimmedline.computedEthnicitySource))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01069; TAG: N0311; NAME: County (SEER IFCOUNTY)
    public boolean rqrs01069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] reg_county = new char[8]
        
        functions.GEN_STRCPY(reg_county, functions.GEN_SUBSTR(untrimmedline.registryId, 9, 2))
        
        functions.GEN_STRCAT(reg_county, untrimmedline.addressAtDxCounty, 3)
        return functions.GEN_ILOOKUP(reg_county, context.RQRS_SEERCNTY, context.RQRS_SEERCNTY_SEERCNTY, [:])

    }

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

    }

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

    }

    // ID: RQRS-01072; TAG: N2060; NAME: County at DX Geocode2000 (NAACCR)
    public boolean rqrs01072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyDxGeocode2000))
            return true
        return functions.GEN_INLIST(untrimmedline.countyDxGeocode2000, "001-997, 998, 999", "(\\d\\d\\d)")

    }

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

    }

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

    }

    // ID: RQRS-01075; TAG: N0151; NAME: County at DX Reported (COC)
    public boolean rqrs01075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty))
            return true
        return functions.GEN_MATCH(untrimmedline.addressAtDxCounty, "(\\d\\d\\d)")

    }

    // ID: RQRS-01076; TAG: N0354; NAME: County at DX Reported (NAACCR)
    public boolean rqrs01076(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.addressAtDxCounty, "(\\d\\d\\d)")

    }

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

    }

    // ID: RQRS-01078; TAG: N0368; NAME: County at DX Reported, Addr at DX--State (NAACCR)
    public boolean rqrs01078(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cnty_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty) || functions.GEN_EMPTY(untrimmedline.addressAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "CD,US,XX,YY,ZZ"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addressAtDxState, "AA,AE,AP"))
            return true
        functions.GEN_STRCPY(cnty_state, untrimmedline.addressAtDxCounty)
        functions.GEN_STRCAT(cnty_state, untrimmedline.addressAtDxState)
        
        if (functions.GEN_LOOKUP(cnty_state, context.RQRS_CNTYALL, context.RQRS_CNTYALL_CNTYSTAT, [:]))
            return true
        return false

    }

    // ID: RQRS-01079; TAG: N0343; NAME: County at DX Reported, Date of Diagnosis (COC)
    public boolean rqrs01079(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty))
                return false
        }
        return true

    }

    // ID: RQRS-01080; TAG: N2651; NAME: Creatinine Pretreatment Lab Value, Date DX (NAACCR)
    public boolean rqrs01080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] creatinine = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Creatinine Pretreatment Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.creatininePretreatmentLabValue, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Creatinine Pretreatment Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(creatinine, functions.GEN_SUBSTR(untrimmedline.creatininePretreatmentLabValue, 1, 2))
        functions.GEN_STRCAT(creatinine, functions.GEN_SUBSTR(untrimmedline.creatininePretreatmentLabValue, 4, 1))
        
        if (functions.GEN_AT(creatinine, "XX1XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(creatinine, "(\\s\\d\\d)") && !functions.GEN_MATCH(creatinine, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.creatininePretreatmentLabValue} not valid code for Creatinine Pretreatment Lab Value')
        return true

    }

    // ID: RQRS-01081; TAG: N2949; NAME: Creatinine Pretreatment Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue) || functions.GEN_AT(untrimmedline.creatininePretreatmentLabValue, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01082; TAG: N3912; NAME: Creatinine Pretreatment Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01082(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue) || functions.GEN_AT(untrimmedline.creatininePretreatmentLabValue, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01083; TAG: N2721; NAME: Creatinine Pretreatment Unit of Measure, Date DX (NAACCR)
    public boolean rqrs01083(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Creatinine Pretreatment Unit of Measure must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure))
            return true
        if (functions.GEN_AT(untrimmedline.creatininePretreatmentUnitOfMeasure, "12789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.creatininePretreatmentUnitOfMeasure} not valid code for Creatinine Pretreatment Unit of Measure')
        return true

    }

    // ID: RQRS-01084; TAG: N2976; NAME: Creatinine Pretreatment Unit of Measure, Schema ID, Required (NAACCR)
    public boolean rqrs01084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure) || functions.GEN_AT(untrimmedline.creatininePretreatmentUnitOfMeasure, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01085; TAG: N4933; NAME: Creatinine Pretreatment Unit of Measure, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure) || functions.GEN_AT(untrimmedline.creatininePretreatmentUnitOfMeasure, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01086; TAG: N0908; NAME: CS Eval Items, Type of Reporting Source (CS)
    public boolean rqrs01086(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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: RQRS-01087; TAG: N1744; NAME: CS Ext, Surg, TS/Ext Eval, Prostate (CS)
    public boolean rqrs01087(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01088; TAG: N2409; NAME: CS Extension Required 2016plus (NAACCR)
    public boolean rqrs01088(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
            functions.GEN_ERROR_TEXT(binding, 'CS Extension cannot be blank')
            return false
        }
        return true

    }

    // ID: RQRS-01089; TAG: N1024; NAME: CS Extension, Brain Schema (CS)
    public boolean rqrs01089(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-01090; TAG: N1173; NAME: CS Extension, CS Tumor Size, Breast Schema (CS)
    public boolean rqrs01090(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                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, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-01091; TAG: N1572; NAME: CS Extension, Hist, Grade, EsophagusGEJunction (CS)
    public boolean rqrs01091(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.histologyIcdO3, "8000-8046, 8051-8131, 8148-8152, 8154-8157, 8170-8175") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "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, '_schema_ms')
                    return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01092; TAG: N1778; NAME: CS Extension, SSF 1, MelanomaConjunctiva (CS)
    public boolean rqrs01092(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-01093; TAG: N1710; NAME: CS Extension, SSF 2, MelanomaCiliaryBody (CS)
    public boolean rqrs01093(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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: RQRS-01094; TAG: N1389; NAME: CS Items - CCCR Required - Non-SSF (CS)
    public boolean rqrs01094(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2017)
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.csVersionOriginal)) {
                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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01095; TAG: N1483; NAME: CS Items - CCCR Required - SSF 1 (CS)
    public boolean rqrs01095(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01096; TAG: N1492; NAME: CS Items - CCCR Required - SSF 10 (CS)
    public boolean rqrs01096(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01097; TAG: N1493; NAME: CS Items - CCCR Required - SSF 11 (CS)
    public boolean rqrs01097(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01098; TAG: N1494; NAME: CS Items - CCCR Required - SSF 12 (CS)
    public boolean rqrs01098(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01099; TAG: N1495; NAME: CS Items - CCCR Required - SSF 13 (CS)
    public boolean rqrs01099(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01100; TAG: N1496; NAME: CS Items - CCCR Required - SSF 14 (CS)
    public boolean rqrs01100(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01101; TAG: N1497; NAME: CS Items - CCCR Required - SSF 15 (CS)
    public boolean rqrs01101(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01102; TAG: N1498; NAME: CS Items - CCCR Required - SSF 16 (CS)
    public boolean rqrs01102(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01103; TAG: N1499; NAME: CS Items - CCCR Required - SSF 17 (CS)
    public boolean rqrs01103(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01104; TAG: N1462; NAME: CS Items - CCCR Required - SSF 18 (CS)
    public boolean rqrs01104(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor18 must not be blank')
        }
        return true

    }

    // ID: RQRS-01105; TAG: N1463; NAME: CS Items - CCCR Required - SSF 19 (CS)
    public boolean rqrs01105(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: RQRS-01106; TAG: N1484; NAME: CS Items - CCCR Required - SSF 2 (CS)
    public boolean rqrs01106(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01107; TAG: N1464; NAME: CS Items - CCCR Required - SSF 20 (CS)
    public boolean rqrs01107(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: RQRS-01108; TAG: N1465; NAME: CS Items - CCCR Required - SSF 21 (CS)
    public boolean rqrs01108(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor21 must not be blank')
        }
        return true

    }

    // ID: RQRS-01109; TAG: N1466; NAME: CS Items - CCCR Required - SSF 22 (CS)
    public boolean rqrs01109(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor22 must not be blank')
        }
        return true

    }

    // ID: RQRS-01110; TAG: N1467; NAME: CS Items - CCCR Required - SSF 23 (CS)
    public boolean rqrs01110(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor23 must not be blank')
        }
        return true

    }

    // ID: RQRS-01111; TAG: N1468; NAME: CS Items - CCCR Required - SSF 24 (CS)
    public boolean rqrs01111(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: RQRS-01112; TAG: N1485; NAME: CS Items - CCCR Required - SSF 3 (CS)
    public boolean rqrs01112(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01113; TAG: N1486; NAME: CS Items - CCCR Required - SSF 4 (CS)
    public boolean rqrs01113(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01114; TAG: N1487; NAME: CS Items - CCCR Required - SSF 5 (CS)
    public boolean rqrs01114(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01115; TAG: N1488; NAME: CS Items - CCCR Required - SSF 6 (CS)
    public boolean rqrs01115(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01116; TAG: N1489; NAME: CS Items - CCCR Required - SSF 7 (CS)
    public boolean rqrs01116(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01117; TAG: N1490; NAME: CS Items - CCCR Required - SSF 8 (CS)
    public boolean rqrs01117(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01118; TAG: N1491; NAME: CS Items - CCCR Required - SSF 9 (CS)
    public boolean rqrs01118(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01119; TAG: N2376; NAME: CS Items - CoC Required - Non-SSF 2016 (CS)
    public boolean rqrs01119(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2016)
            return true
        if (dx_year > 2017)
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Tumor Size must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Extension must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "988,999")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Lymph Nodes must be blank, 988, or 999')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98,99")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX must be blank, 98, or 99')
                err_flag = 1
            }
        }
        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.csTumorSizeExtEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Tumor Size/Ext Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Lymph Nodes Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsEval, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets Eval must be blank or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Bone must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Brain must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Liver must be blank, 8, or 9')
                err_flag = 1
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8,9")) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Lung must be blank, 8 or 9')
                err_flag = 1
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Penis,Testis")) {
            if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Lymphovascular Invasion cannot be blank for this schema')
                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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01120; TAG: N1593; NAME: CS Items - NPCR Required - Non-SSF (CS)
    public boolean rqrs01120(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.csVersionOriginal)) {
                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.csVersionOriginal)) {
                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: RQRS-01121; TAG: N2063; NAME: CS Items - NPCR Required - SSF 1 (CS) - 2015
    public boolean rqrs01121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF1_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if (dx_year < 2016 && dx_year > 2003 && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF1_NPCR':SSF1_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
        
            if (!functions.GEN_INLIST(SSF1_NPCR, "R")) {
                return true
            }
            if ((dx_year > 2010)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor 1 must not be 988 for this schema')
                }
            }
            if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
            if ((dx_year == 2010)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor 1 must not be 988 for this schema')
                }
            }
            if (functions.GEN_INLIST(t_schema_name, "Breast,Lung")) {
                return true
            }
            if ((dx_year > 2003)) {
                if (functions.GEN_INLIST(t_schema_name, "Pleura")) {
                    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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 1 must not be 988')
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast,Brain,CNSOther,IntracranialGland")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor 1 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01122; TAG: N2064; NAME: CS Items - NPCR Required - SSF 1 (CS) - 2016+
    public boolean rqrs01122(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF1_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2015) {
            if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))) && (functions.GEN_INLIST(t_schema_name, "Prostate,Placenta,MycosisFungoides,Breast,Brain,CNSOther,IntracranialGland")))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 1 cannot be 988 or blank')
        }
        if (dx_year > 2015) {
            if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) && (functions.GEN_INLIST(t_schema_name, "Prostate,Placenta,MycosisFungoides,Breast,Brain,CNSOther,IntracranialGland")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
                return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        }
        if (dx_year > 2015) {
            if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) && (functions.GEN_INLIST(t_schema_name, "Prostate,Placenta,MycosisFungoides,Breast,Brain,CNSOther,IntracranialGland")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
                return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        }
        
        return true

    }

    // ID: RQRS-01123; TAG: N2065; NAME: CS Items - NPCR Required - SSF 10 (CS) - 2015
    public boolean rqrs01123(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF10_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF10_NPCR':SSF10_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF10_NPCR, "N,R"))
                return true
            if (((dx_year < 2016) && (dx_year > 2013)) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20550))
                return true
            if ((dx_year > 2009 && dx_year < 2016)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
            if (((dx_year < 2016) && (dx_year > 2013)) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20550)) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                    return true
                }
            }
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor10 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01124; TAG: N2066; NAME: CS Items - NPCR Required - SSF 10 (CS) - 2016+
    public boolean rqrs01124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF10_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum,Prostate")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor10 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum,Prostate")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum,Prostate")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01125; TAG: N2067; NAME: CS Items - NPCR Required - SSF 11 (CS) - 2015
    public boolean rqrs01125(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF11_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF11_NPCR':SSF11_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF11_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2009)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor11 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor11 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01126; TAG: N2068; NAME: CS Items - NPCR Required - SSF 11 (CS) - 2016+
    public boolean rqrs01126(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF11_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))) && (functions.GEN_INLIST(t_schema_name, "Appendix,Breast,GISTAppendix,GISTColon,GISTRectum")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor11 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) && (functions.GEN_INLIST(t_schema_name, "Appendix,Breast,GISTAppendix,GISTColon,GISTRectum")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) && (functions.GEN_INLIST(t_schema_name, "Appendix,Breast,GISTAppendix,GISTColon,GISTRectum")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01127; TAG: N2069; NAME: CS Items - NPCR Required - SSF 12 (CS)
    public boolean rqrs01127(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF12_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF12_NPCR':SSF12_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF12_NPCR, "N,R"))
                return true
            if (((dx_year < 2016) && (dx_year > 2013)) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20550))
                return true
            if (dx_year > 2009 && dx_year < 2014) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor12 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
            if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20550)) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                    return true
                }
            }
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor12 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01128; TAG: N2071; NAME: CS Items - NPCR Required - SSF 13 (CS) - 2015
    public boolean rqrs01128(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF13_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF13_NPCR':SSF13_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF13_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2009)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor13 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor13 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01129; TAG: N2070; NAME: CS Items - NPCR Required - SSF 13 (CS) - 2016+
    public boolean rqrs01129(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF13_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13))) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor13 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01130; TAG: N2073; NAME: CS Items - NPCR Required - SSF 14 (CS) - 2015
    public boolean rqrs01130(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF14_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF14_NPCR':SSF14_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF14_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2009)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor14 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988") && !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor14 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01131; TAG: N2072; NAME: CS Items - NPCR Required - SSF 14 (CS) - 2016+
    public boolean rqrs01131(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF14_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14))) && (functions.GEN_INLIST(t_schema_name, "Breast")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor14 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01132; TAG: N2075; NAME: CS Items - NPCR Required - SSF 15 (CS) - 2015
    public boolean rqrs01132(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF15_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF15_NPCR':SSF15_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF15_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2010)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor15 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor15 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01133; TAG: N2074; NAME: CS Items - NPCR Required - SSF 15 (CS) - 2016+
    public boolean rqrs01133(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF15_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15))) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor15 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01134; TAG: N2077; NAME: CS Items - NPCR Required - SSF 16 (CS) - 2015
    public boolean rqrs01134(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF16_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF16_NPCR':SSF16_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF16_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2010)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor16 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor16 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01135; TAG: N2076; NAME: CS Items - NPCR Required - SSF 16 (CS) - 2016+
    public boolean rqrs01135(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF16_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16))) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor16 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) && (functions.GEN_INLIST(t_schema_name, "Breast,Testis")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01136; TAG: N2078; NAME: CS Items - NPCR Required - SSF 17 (CS)
    public boolean rqrs01136(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor17 must not be blank')
        }
        return true

    }

    // ID: RQRS-01137; TAG: N2079; NAME: CS Items - NPCR Required - SSF 18 (CS)
    public boolean rqrs01137(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor18 must not be blank')
        }
        return true

    }

    // ID: RQRS-01138; TAG: N2080; NAME: CS Items - NPCR Required - SSF 19 (CS)
    public boolean rqrs01138(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: RQRS-01139; TAG: N2081; NAME: CS Items - NPCR Required - SSF 2 (CS) - 2015
    public boolean rqrs01139(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF2_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if (dx_year < 2016 && dx_year > 2003 && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF2_NPCR':SSF2_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
        
            if (!functions.GEN_INLIST(SSF2_NPCR, "R")) {
                return true
            }
            if ((dx_year > 2009 && dx_year < 2016)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor 2 must not be 988 for this schema')
                }
            }
            if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 20000)) {
                if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                    if (functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma")) {
                        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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor 2 must not be blank or 988')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-01140; TAG: N2082; NAME: CS Items - NPCR Required - SSF 2 (CS) - 2016+
    public boolean rqrs01140(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF1_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2015) {
            if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))) && (functions.GEN_INLIST(t_schema_name, "Breast")))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 2 cannot be 988 or blank')
        }
        if (dx_year > 2015) {
            if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
                return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        }
        if (dx_year > 2015) {
            if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
                return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        }
        
        return true

    }

    // ID: RQRS-01141; TAG: N2083; NAME: CS Items - NPCR Required - SSF 20 (CS)
    public boolean rqrs01141(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: RQRS-01142; TAG: N2084; NAME: CS Items - NPCR Required - SSF 21 (CS)
    public boolean rqrs01142(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor21 must not be blank')
        }
        return true

    }

    // ID: RQRS-01143; TAG: N2085; NAME: CS Items - NPCR Required - SSF 22 (CS)
    public boolean rqrs01143(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor22 must not be blank')
        }
        return true

    }

    // ID: RQRS-01144; TAG: N2086; NAME: CS Items - NPCR Required - SSF 23 (CS)
    public boolean rqrs01144(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor23 must not be blank')
        }
        return true

    }

    // ID: RQRS-01145; TAG: N2087; NAME: CS Items - NPCR Required - SSF 24 (CS)
    public boolean rqrs01145(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: RQRS-01146; TAG: N2088; NAME: CS Items - NPCR Required - SSF 25 (CS) - 2016+
    public boolean rqrs01146(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF25_NPCR = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C481,C482,C488"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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_LOOKUP((t_schema_name), context.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF25_NPCR':SSF25_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        }
        if ((functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) && (functions.GEN_INLIST(SSF25_NPCR, "R")))
            return false
        
        return true

    }

    // ID: RQRS-01147; TAG: N2089; NAME: CS Items - NPCR Required - SSF 3 (CS)
    public boolean rqrs01147(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 3 must not be blank')
        }
        return true

    }

    // ID: RQRS-01148; TAG: N2090; NAME: CS Items - NPCR Required - SSF 4 (CS)
    public boolean rqrs01148(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 4 must not be blank')
        }
        return true

    }

    // ID: RQRS-01149; TAG: N2091; NAME: CS Items - NPCR Required - SSF 5 (CS) - 2015
    public boolean rqrs01149(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 5 must not be blank')
        }
        return true

    }

    // ID: RQRS-01150; TAG: N2092; NAME: CS Items - NPCR Required - SSF 5 (CS) - 2016+
    public boolean rqrs01150(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        else {
            if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 5 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) && (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        return true

    }

    // ID: RQRS-01151; TAG: N2093; NAME: CS Items - NPCR Required - SSF 6 (CS) - 2015
    public boolean rqrs01151(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 6 must not be blank')
        }
        return true

    }

    // ID: RQRS-01152; TAG: N2094; NAME: CS Items - NPCR Required - SSF 6 (CS) - 2016+
    public boolean rqrs01152(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 6 cannot be 988 or blank')
        }
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) && (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) && (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01153; TAG: N2095; NAME: CS Items - NPCR Required - SSF 7 (CS)
    public boolean rqrs01153(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
        }
        return true

    }

    // ID: RQRS-01154; TAG: N2096; NAME: CS Items - NPCR Required - SSF 8 (CS) - 2015
    public boolean rqrs01154(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF8_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF8_NPCR':SSF8_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF8_NPCR, "R"))
                return true
            if ((dx_year > 2009) && (dx_year < 2016)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor 8 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") && !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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor 8 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01155; TAG: N2097; NAME: CS Items - NPCR Required - SSF 8 (CS) - 2016+
    public boolean rqrs01155(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF1_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8))) && (functions.GEN_INLIST(t_schema_name, "Breast,Prostate")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 8 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) && (functions.GEN_INLIST(t_schema_name, "Breast,Prostate")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) && (functions.GEN_INLIST(t_schema_name, "Breast,Prostate")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01156; TAG: N2098; NAME: CS Items - NPCR Required - SSF 9 (CS) - 2015
    public boolean rqrs01156(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF9_NPCR = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year < 2016) && (dx_year > 2003) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF9_NPCR':SSF9_NPCR])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            functions.GEN_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (!functions.GEN_INLIST(SSF9_NPCR, "R"))
                return true
            if ((dx_year < 2016) && (dx_year > 2009)) {
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor 9 must not be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
        
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") && !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, then CS Site-Specific Factor 9 must not be blank or 988')
                }
            }
        }
        return true

    }

    // ID: RQRS-01157; TAG: N2099; NAME: CS Items - NPCR Required - SSF 9 (CS) - 2016+
    public boolean rqrs01157(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF9_NPCR = new char[100]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || 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.histologyIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9))) && (functions.GEN_INLIST(t_schema_name, "Breast")))
            return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, CS Site-Specific Factor 9 cannot be 988 or blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionOriginal)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Original cannot be left blank')
        if ((!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) && (functions.GEN_INLIST(t_schema_name, "Breast")) && (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)))
            return functions.GEN_ERROR_MSG(binding, 'CS Version Input Current cannot be left blank')
        
        return true

    }

    // ID: RQRS-01158; TAG: N1500; NAME: CS Items - Required for Staging - SSF 1 (NAACCR)
    public boolean rqrs01158(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01159; TAG: N1520; NAME: CS Items - Required for Staging - SSF 10 (NAACCR)
    public boolean rqrs01159(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                                return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must not be blank')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01160; TAG: N1521; NAME: CS Items - Required for Staging - SSF 11 (NAACCR)
    public boolean rqrs01160(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01161; TAG: N1522; NAME: CS Items - Required for Staging - SSF 12 (NAACCR)
    public boolean rqrs01161(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01162; TAG: N1524; NAME: CS Items - Required for Staging - SSF 13 (NAACCR)
    public boolean rqrs01162(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01163; TAG: N1511; NAME: CS Items - Required for Staging - SSF 14 (NAACCR)
    public boolean rqrs01163(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor14 must not be blank')
        }
        return true

    }

    // ID: RQRS-01164; TAG: N1526; NAME: CS Items - Required for Staging - SSF 15 (NAACCR)
    public boolean rqrs01164(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01165; TAG: N1528; NAME: CS Items - Required for Staging - SSF 16 (NAACCR)
    public boolean rqrs01165(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01166; TAG: N1527; NAME: CS Items - Required for Staging - SSF 17 (NAACCR)
    public boolean rqrs01166(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01167; TAG: N1512; NAME: CS Items - Required for Staging - SSF 18 (NAACCR)
    public boolean rqrs01167(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor18 must not be blank')
        }
        return true

    }

    // ID: RQRS-01168; TAG: N1513; NAME: CS Items - Required for Staging - SSF 19 (NAACCR)
    public boolean rqrs01168(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: RQRS-01169; TAG: N1501; NAME: CS Items - Required for Staging - SSF 2 (NAACCR)
    public boolean rqrs01169(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01170; TAG: N1514; NAME: CS Items - Required for Staging - SSF 20 (NAACCR)
    public boolean rqrs01170(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: RQRS-01171; TAG: N1515; NAME: CS Items - Required for Staging - SSF 21 (NAACCR)
    public boolean rqrs01171(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor21 must not be blank')
        }
        return true

    }

    // ID: RQRS-01172; TAG: N1516; NAME: CS Items - Required for Staging - SSF 22 (NAACCR)
    public boolean rqrs01172(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor22 must not be blank')
        }
        return true

    }

    // ID: RQRS-01173; TAG: N1517; NAME: CS Items - Required for Staging - SSF 23 (NAACCR)
    public boolean rqrs01173(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor23 must not be blank')
        }
        return true

    }

    // ID: RQRS-01174; TAG: N1518; NAME: CS Items - Required for Staging - SSF 24 (NAACCR)
    public boolean rqrs01174(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: RQRS-01175; TAG: N1503; NAME: CS Items - Required for Staging - SSF 3 (NAACCR)
    public boolean rqrs01175(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01176; TAG: N1504; NAME: CS Items - Required for Staging - SSF 4 (NAACCR)
    public boolean rqrs01176(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01177; TAG: N1506; NAME: CS Items - Required for Staging - SSF 5 (NAACCR)
    public boolean rqrs01177(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01178; TAG: N1507; NAME: CS Items - Required for Staging - SSF 6 (NAACCR)
    public boolean rqrs01178(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01179; TAG: N1508; NAME: CS Items - Required for Staging - SSF 7 (NAACCR)
    public boolean rqrs01179(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01180; TAG: N1509; NAME: CS Items - Required for Staging - SSF 8 (NAACCR)
    public boolean rqrs01180(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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF_2, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must not be blank')
                }
            }
        }
        return true

    }

    // ID: RQRS-01181; TAG: N1510; NAME: CS Items - Required for Staging - SSF 9 (NAACCR)
    public boolean rqrs01181(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_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.behaviorIcdO3, "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, '_schema_ms')
            return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor 9 must not be blank')
        }
        return true

    }

    // ID: RQRS-01182; TAG: N2353; NAME: CS Items - SEER Required - Non-SSF (CS)
    public boolean rqrs01182(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.csVersionOriginal)) {
                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.csVersionOriginal) >= 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) {
            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, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01183; TAG: N2355; NAME: CS Items - SEER Required - SSF 1 (CS)
    public boolean rqrs01183(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.csVersionOriginal) && (dx_year < 2016))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) > 20000) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01184; TAG: N2370; NAME: CS Items - SEER Required - SSF 10 (CS)
    public boolean rqrs01184(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
                else
                    return true
            }
        }
        if (((functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionOriginal, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01185; TAG: N2155; NAME: CS Items - SEER Required - SSF 11 (CS)
    public boolean rqrs01185(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016)) {
            return true
        }
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01186; TAG: N2156; NAME: CS Items - SEER Required - SSF 12 (CS)
    public boolean rqrs01186(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01187; TAG: N2157; NAME: CS Items - SEER Required - SSF 13 (CS)
    public boolean rqrs01187(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01188; TAG: N2158; NAME: CS Items - SEER Required - SSF 14 (CS)
    public boolean rqrs01188(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor14 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01189; TAG: N2159; NAME: CS Items - SEER Required - SSF 15 (CS)
    public boolean rqrs01189(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                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.csVersionOriginal, "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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                                return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01190; TAG: N2160; NAME: CS Items - SEER Required - SSF 16 (CS)
    public boolean rqrs01190(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01191; TAG: N2161; NAME: CS Items - SEER Required - SSF 17 (CS)
    public boolean rqrs01191(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01192; TAG: N2162; NAME: CS Items - SEER Required - SSF 18 (CS)
    public boolean rqrs01192(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor18 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor18 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01193; TAG: N2163; NAME: CS Items - SEER Required - SSF 19 (CS)
    public boolean rqrs01193(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor19 must not be blank')
            }
        }
        return true

    }

    // ID: RQRS-01194; TAG: N2368; NAME: CS Items - SEER Required - SSF 2 (CS)
    public boolean rqrs01194(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent) && (dx_year < 2016))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionOriginal) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                        }
                        else
                            return true
                    }
                }
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                            return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01195; TAG: N2167; NAME: CS Items - SEER Required - SSF 20 (CS)
    public boolean rqrs01195(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor20 must not be blank')
            }
        }
        return true

    }

    // ID: RQRS-01196; TAG: N2168; NAME: CS Items - SEER Required - SSF 21 (CS)
    public boolean rqrs01196(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor21 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor21 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01197; TAG: N2169; NAME: CS Items - SEER Required - SSF 22 (CS)
    public boolean rqrs01197(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor22 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor22 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01198; TAG: N2170; NAME: CS Items - SEER Required - SSF 23 (CS)
    public boolean rqrs01198(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) > 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor23 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor23 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01199; TAG: N2171; NAME: CS Items - SEER Required - SSF 24 (CS)
    public boolean rqrs01199(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2003, CS Site-Specific Factor24 must not be blank')
            }
        }
        return true

    }

    // ID: RQRS-01200; TAG: N2294; NAME: CS Items - SEER Required - SSF 25 (CS)
    public boolean rqrs01200(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF25_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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            return true
        }
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if ((t_schema_number < 0) && (dx_year < 2016)) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if ((t_schema_number > t_max_schemas) && (dx_year < 2016)) {
                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_LOOKUP((t_schema_name), context.RQRS_CS_SSF, context.RQRS_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF25_SEER':SSF25_SEER])) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "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.csSiteSpecificFactor25))
                return false
        }
        if (((dx_year > 2015) || (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20550)) && (!functions.GEN_EMPTY(untrimmedline.csExtension))) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C481,C482,C488"))) {
                if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576,8590-8671,8930-8934,8940,9110"))) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "988"))
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor25 must not be blank or 988 for this schema')
                }
            }
            if (functions.GEN_INLIST(SSF25_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "988")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor25 must not be blank or 988 for this schema')
                }
                else
                    return true
            }
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension))) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C481,C482,C488"))) {
                if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576,8590-8671,8930-8934,8940,9110"))) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "988"))
                        return true
                }
            }
            if (functions.GEN_INLIST(SSF25_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "988")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Site-Specific Factor25 must not be blank or 988 for this schema')
                }
                else
                    return true
            }
        }
        return true

    }

    // ID: RQRS-01201; TAG: N2369; NAME: CS Items - SEER Required - SSF 3 (CS)
    public boolean rqrs01201(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.csVersionOriginal) && (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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
                }
                else
                    return true
            }
            else {
                return true
            }
        }
        if (((functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionOriginal, "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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01202; TAG: N2177; NAME: CS Items - SEER Required - SSF 4 (CS)
    public boolean rqrs01202(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
                }
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01203; TAG: N2178; NAME: CS Items - SEER Required - SSF 5 (CS)
    public boolean rqrs01203(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01204; TAG: N2179; NAME: CS Items - SEER Required - SSF 6 (CS)
    public boolean rqrs01204(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For CS Version Input Original of ${untrimmedline.csVersionOriginal} 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.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01205; TAG: N2180; NAME: CS Items - SEER Required - SSF 7 (CS)
    public boolean rqrs01205(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01206; TAG: N2181; NAME: CS Items - SEER Required - SSF 8 (CS)
    public boolean rqrs01206(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: RQRS-01207; TAG: N2182; NAME: CS Items - SEER Required - SSF 9 (CS)
    public boolean rqrs01207(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.csVersionOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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, '_schema_ms')
                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.RQRS_CS_SSF, context.RQRS_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, '_schema_ms')
            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.csVersionOriginal) >= 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, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, 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.csVersionOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionOriginal}, CS Site-Specific Factor 9 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionOriginal) < 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, '_schema_ms')
                        return functions.GEN_ERROR_MSG(binding, 'For DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01208; TAG: N2838; NAME: CS Items, DX Post 2017 (CS)
    public boolean rqrs01208(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Tumor Size must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Extension must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Tumor Size/Ext Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Lymph Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Reg Nodes Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets at DX must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets at DX-Bone must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets at DX-Brain must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets at DX-Liver must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets at DX-Lung must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Mets Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 1 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 2 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 3 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 4 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 5 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 6 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 7 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 8 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor 9 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor10 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor11 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor12 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor13 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor14 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor15 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor16 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor17 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor18 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor19 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor20 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor21 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor22 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor23 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor24 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Site-Specific Factor25 must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01209; TAG: N0697; NAME: CS Items, DX Pre-2004 (CS)
    public boolean rqrs01209(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_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.csVersionOriginal)) {
                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: RQRS-01210; TAG: N2438; NAME: CS Items, DX Pre-2004 (SEER)
    public boolean rqrs01210(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        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.csVersionOriginal)) {
                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: RQRS-01211; TAG: N1537; NAME: CS Items, Type Reporting Source-DCO (CS)
    public boolean rqrs01211(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.behaviorIcdO3, "2"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.behaviorIcdO3, "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: RQRS-01212; TAG: N2414; NAME: CS Items, Type Reporting Source-DCO (SEER)
    public boolean rqrs01212(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "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.behaviorIcdO3, "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: RQRS-01213; TAG: N1768; NAME: CS LN, RNP, Nodes Eval, SSF 3, MelanomaSkin (CS)
    public boolean rqrs01213(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,125,155")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "110-118,122-123,125-128,152-153")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
        
                    if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                        }
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,97,98")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010-100")) {
                            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-95,99")) {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,050,100")) {
                                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,125,158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98")) {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "125,155") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                                            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,122-123,125,152-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97,99")) {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "124") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01,95,97,99")) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "124") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "02-90")) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,050,100")) {
                                                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,121-128,152-153") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010")) {
                            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,100-118,121-128,152-153,155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97")) {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,100-118,121-128,152-153") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99")) {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
                                        functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01217; TAG: N1723; NAME: CS Lymph Nodes, SSF 17, Penis (CS)
    public boolean rqrs01217(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Penis"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000"))
                    return functions.GEN_ERROR_MSG(binding, 'Penis schema: If CS Lymph Nodes = 000, CS Site-Specific Factor17 must = 000')
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01223; TAG: N1714; NAME: CS Mets at DX, SSF 4, MelanomaChor/Cil/Iris (CS)
    public boolean rqrs01223(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10,40,50,52,54,56,60")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        return true

    }

    // ID: RQRS-01224; TAG: N2116; NAME: CS Over-ride CS 20, Date of Diagnosis (NPCR)
    public boolean rqrs01224(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.RQRS_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        }
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year < 2004)) {
            if (!functions.GEN_EMPTY(untrimmedline.overrideCs20))
                return functions.GEN_ERROR_MSG(binding, 'If DX Year less than 2004 or blank, Over-ride CS 20 must be blank')
        }
        else {
            if (dx_year < 2012) {
                if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")) {
                    if (!functions.GEN_EMPTY(untrimmedline.overrideCs20))
                        return false
                }
            }
            else {
                if (dx_year > 2015) {
                    if (!functions.GEN_EMPTY(untrimmedline.overrideCs20))
                        return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, Over-ride CS 20 must be blank')
                }
            }
        }
        return true

    }

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

    }

    // ID: RQRS-01226; TAG: N1595; NAME: CS Over-rides (NPCR)
    public boolean rqrs01226(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.overrideCs1) || !functions.GEN_EMPTY(untrimmedline.overrideCs2) || !functions.GEN_EMPTY(untrimmedline.overrideCs3) || !functions.GEN_EMPTY(untrimmedline.overrideCs4) || !functions.GEN_EMPTY(untrimmedline.overrideCs5) || !functions.GEN_EMPTY(untrimmedline.overrideCs6) || !functions.GEN_EMPTY(untrimmedline.overrideCs7) || !functions.GEN_EMPTY(untrimmedline.overrideCs8) || !functions.GEN_EMPTY(untrimmedline.overrideCs9) || !functions.GEN_EMPTY(untrimmedline.overrideCs10) || !functions.GEN_EMPTY(untrimmedline.overrideCs11) || !functions.GEN_EMPTY(untrimmedline.overrideCs12) || !functions.GEN_EMPTY(untrimmedline.overrideCs13) || !functions.GEN_EMPTY(untrimmedline.overrideCs14) || !functions.GEN_EMPTY(untrimmedline.overrideCs15) || !functions.GEN_EMPTY(untrimmedline.overrideCs16) || !functions.GEN_EMPTY(untrimmedline.overrideCs17) || !functions.GEN_EMPTY(untrimmedline.overrideCs18) || !functions.GEN_EMPTY(untrimmedline.overrideCs19))
            return functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Over-ride fields 1-19 must be blank')
        if (functions.GEN_EMPTY(untrimmedline.overrideCs20) || functions.GEN_INLIST(untrimmedline.overrideCs20, "1"))
            return true
        else
            return functions.GEN_SAVE_ERROR_TEXT(binding, 'Over-ride CS 20 must be blank or = 1')
        
        return true

    }

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

    }

    // ID: RQRS-01228; TAG: N2410; NAME: CS Site-Specific Factor 1, Schema (SEER)
    public boolean rqrs01228(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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 (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)) && (functions.GEN_INLIST(t_schema_name, "Retinoblastoma,Esophagus,EsophagusGEJunction,NETStomach,Stomach"))) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor1)
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 10, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01229; TAG: N2411; NAME: CS Site-Specific Factor 2, Schema (SEER)
    public boolean rqrs01229(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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 (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension)) && (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum,SmallIntestine"))) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor2)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 11, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01230; TAG: N2412; NAME: CS Site-Specific Factor 3, Schema (SEER)
    public boolean rqrs01230(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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 (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension)) && ((functions.GEN_INLIST(t_schema_name, "LacrimalGland,MelanomaSkin,MerkelCellPenis,MerkelCellScrotum,")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin,MerkelCellVulva,Prostate,SkinEyelid")))) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor3)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 12, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            return false
        }
        
        return true

    }

    // ID: RQRS-01231; TAG: N2413; NAME: CS Site-Specific Factor10, Schema (SEER)
    public boolean rqrs01231(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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 (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension)) && (functions.GEN_INLIST(t_schema_name, "BileDuctsIntrahepatic"))) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor10)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 19, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, '_schema_ms')
            return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-01233; TAG: N2374; NAME: CS SSF 1, RX Summ--Surg, Retinoblastoma (SEER)
    public boolean rqrs01233(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40,41")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "970")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
            else
                return true
        }
        return true

    }

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

    }

    // ID: RQRS-01235; TAG: N1765; NAME: CS SSF 1, SSF 2, SSF 15, SSF 16, Breast (CS)
    public boolean rqrs01235(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "111"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 111')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "110"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 110')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "101"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 101')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "100"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 100')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "011"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 011')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "010"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 010')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "001"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 001')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 000')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "030,996,997,998,999") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030,996,997,998,999") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "030,997,998,999")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "999"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 999')
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01255; TAG: N2373; NAME: CS SSF 25, PeritoneumFemaleGen (SEER)
    public boolean rqrs01255(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        if (functions.GEN_INLIST(untrimmedline.sex, "2,6") && functions.GEN_INLIST(untrimmedline.primarySite, "481,482,488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8590-8671, 8930-8934,8940-9110")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002,100"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01258; TAG: N2375; NAME: CS SSF 3, RX Summ--Surg, Prostate (SEER)
    public boolean rqrs01258(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
        
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "50,70")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960,970,980,985"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return false
                }
            }
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01267; TAG: N2389; NAME: CS SSF 9, Surgery, HeadNeck Schemas (CS)
    public boolean rqrs01267(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,8,9") || functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_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.RQRS_SCHEM_HN, context.RQRS_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,8,9"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        if (functions.GEN_VAL(untrimmedline.csVersionOriginal) >= 20500) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                    return functions.GEN_ERROR_MSG(binding, 'Head and Neck: If CS Version Input Original = 020500 or higher and RX Summ--Scope Reg LN Sur = 1, CS Site-Specific Factor 9 must = 998 or 999')
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01272; TAG: N1317; NAME: CS Validate Schema (CS)
    public boolean rqrs01272(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: RQRS-01273; TAG: N1797; NAME: CS Validate Schema (NPCR)
    public boolean rqrs01273(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1") && (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: RQRS-01274; TAG: N1095; NAME: Date 1st Crs RX COC, Date Flag (COC)
    public boolean rqrs01274(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date 1st Crs RX COC is blank, corresponding Date 1st Crs RX COC Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01275; TAG: N1096; NAME: Date 1st Crs RX COC, Date Flag (NPCR)
    public boolean rqrs01275(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) && functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date 1st Crs RX COC is blank, Date 1st Crs RX COC Flag must = 10, 11, 12, or blank')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01276; TAG: N0798; NAME: Date 1st Crs RX COC, Date Initial RX SEER (NPCR)
    public boolean rqrs01276(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) && functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag) && functions.GEN_EMPTY(untrimmedline.dateOfInitialRxFlag) && functions.GEN_EMPTY(untrimmedline.dateOfInitialRx))
            return false
        return true

    }

    // ID: RQRS-01277; TAG: N1811; NAME: Date 1st Crs RX COC, Dates of RX (NAACCR)
    public boolean rqrs01277(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10,11,12,20,30,40,82,85,86,87,88"))
            return true
        int earliest_dt
        char[] rx_flag = new char[2]
        int dtcmp
        
        if ((functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc) && functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCocFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag)) || (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag)))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11") && functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "11,15") && functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "11,15"))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "10,12")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,12") || functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,12"))
                return true
            else
                return functions.GEN_ERROR_TEXT(binding, 'Verify Date 1st Crs RX Flag with all other treatment flags')
        }
        if (!functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "11") || !functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.dateOf1stCrsRxCocFlag, "11"))
                return functions.GEN_ERROR_TEXT(binding, 'Verify Date 1st Crs RX Flag with all other treatment flags')
        }
        if (functions.GEN_VAL(untrimmedline.rxDateSurgery) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateRadiation) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateBrm) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateChemo) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateHormone) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc) || functions.GEN_VAL(untrimmedline.rxDateOther) == functions.GEN_VAL(untrimmedline.dateOf1stCrsRxCoc))
            functions.GEN_NOOP()
        else {
            return false
        }
        if (functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0 || functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN)) < 0)
            return false
        return true

    }

    // ID: RQRS-01278; TAG: N0827; NAME: Date Case Completed (NAACCR DATEEDIT)
    public boolean rqrs01278(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseCompleted))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseCompleted))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Case Completed: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01279; TAG: N0828; NAME: Date Case Completed, Date of Diagnosis (NAACCR)
    public boolean rqrs01279(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseCompleted) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateCaseCompleted, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseCompleted))
                functions.GEN_ERROR_TEXT(binding, 'Date Case Completed is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01280; TAG: N1056; NAME: Date Case Completed--CoC (COC)
    public boolean rqrs01280(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseCompletedCoc))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseCompletedCoc))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Completed--CoC: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01281; TAG: N1057; NAME: Date Case Completed--CoC, Date of Diagnosis (COC)
    public boolean rqrs01281(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "00-22"))
            return true
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.dateCaseCompletedCoc))
                return false
        }
        return true

    }

    // ID: RQRS-01282; TAG: N1135; NAME: Date Case Initiated (NAACCR)
    public boolean rqrs01282(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseInitiated))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseInitiated))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Case Case Initiated: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01283; TAG: N0612; NAME: Date Case Report Exported (NAACCR DATEEDIT)
    public boolean rqrs01283(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseReportExported))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseReportExported))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Report Exported: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01284; TAG: N0613; NAME: Date Case Report Loaded (NAACCR DATEEDIT)
    public boolean rqrs01284(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateCaseReportLoaded))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseReportLoaded))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Report Loaded: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01285; TAG: N0489; NAME: Date Case Report Received (NAACCR DATEEDIT)
    public boolean rqrs01285(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateCaseReportReceived))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Case Report Received: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01286; TAG: N1481; NAME: Date Conclusive DX, Date of DX (CCCR)
    public boolean rqrs01286(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int days_diff
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.dateConclusiveDx) && functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = 2008-2012, then Date Conclusive DX and Date Conclusive DX Flag cannot both be blank')
        }
        if (dx_year < 2008) {
            if (!functions.GEN_EMPTY(untrimmedline.dateConclusiveDx) || !functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Date Conclusive DX and Date Conclusive DX Flag must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx))
            return true
        days_diff = (functions.GEN_DAYDIFF_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateConclusiveDx, ((Integer)context.RQRS_GEN_DT_MAX)))
        
        if (days_diff == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Conclusive DX: %DC')
        if (days_diff > 60)
            return true
        else
            return false
        return true

    }

    // ID: RQRS-01287; TAG: N0075; NAME: Date Initial RX SEER (NAACCR)
    public boolean rqrs01287(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRx))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfInitialRx))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01288; TAG: N1080; NAME: Date Initial RX SEER Flag (NAACCR)
    public boolean rqrs01288(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRxFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01289; TAG: N0896; NAME: Date Initial RX SEER, Ca Dir RX 2003 (SEER IF180)
    public boolean rqrs01289(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int scope_flag
        int dx_year
        int seer_init_year
        
        scope_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2003 || dx_year > 2018)
            return true
        seer_init_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfInitialRx)
        
        if (seer_init_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
        if (dx_year < 2012) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6") || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
                if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                    return false
                else
                    return true
            }
        }
        if (dx_year > 2011) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98")) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6") || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
                if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                    return false
                else
                    return true
            }
        }
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                scope_flag = 1
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0"))
                scope_flag = 1
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011) {
                    scope_flag = 1
                }
            }
        }
        if (seer_init_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (scope_flag == 1) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,7,8") && functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8"))
                return false
        }
        return true

    }

    // ID: RQRS-01290; TAG: N0895; NAME: Date Initial RX SEER, Ca Dir RX 98-02 (SEER IF179)
    public boolean rqrs01290(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int scope_flag
        int dx_year
        int seer_init_year
        
        scope_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year < 1998) || (dx_year > 2002))
            return true
        if ((dx_year < 2000) && functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        seer_init_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfInitialRx)
        
        if (seer_init_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "1-8") || functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "1-8") || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6") || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "9"))
                scope_flag = 1
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0")) {
                scope_flag = 1
            }
        }
        if (seer_init_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00") && (scope_flag == 1) && functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "0") && functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,7,8") && functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8"))
                return false
        }
        return true

    }

    // ID: RQRS-01291; TAG: N0894; NAME: Date Initial RX SEER, Ca Dir RX Pre-98 (SEER IF34)
    public boolean rqrs01291(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int Surg_Flag, RadCNS_Flag, dx_year, seer_init_year
        
        Surg_Flag = 0
        RadCNS_Flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        seer_init_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfInitialRx)
        
        if (seer_init_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
        }
        if (dx_year >= 1998)
            return true
        if ((dx_year < 1988) && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541,0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if ((dx_year < 1988) && (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "00") || (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "09") && functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "6,8"))))
            Surg_Flag = 1
        if ((dx_year > 1987) && (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "00-09") && functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1-8")))
            Surg_Flag = 1
        if ((dx_year > 1987) && (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "00-09") && functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1-8")))
            Surg_Flag = 1
        if (Surg_Flag == 0) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "10-98") || functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                Surg_Flag = 2
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "09") && functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
            Surg_Flag = 3
        if ((dx_year > 1987) && (functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9941"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "0,7,8"))
                RadCNS_Flag = 1
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "1"))
                    RadCNS_Flag = 2
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "9")) {
                        RadCNS_Flag = 3
                    }
                }
            }
        }
        if ((Surg_Flag == 1) && functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,7,8") && ((RadCNS_Flag == 0) || (RadCNS_Flag == 1)) && functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                return true
            else
                return false
        }
        else {
            if ((Surg_Flag == 2) || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6") || (RadCNS_Flag == 2) || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
                if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                    return false
                else
                    return true
            }
            else {
                if ((Surg_Flag == 3) || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "9") || (RadCNS_Flag == 3) || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9")) {
                    if (seer_init_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01292; TAG: N1098; NAME: Date Initial RX SEER, Date Flag (NAACCR)
    public boolean rqrs01292(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRx)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date Initial RX SEER is blank, corresponding Date Initial RX SEER Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfInitialRxFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01293; TAG: N1099; NAME: Date Initial RX SEER, Date Flag (NPCR)
    public boolean rqrs01293(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRx) && functions.GEN_EMPTY(untrimmedline.dateOfInitialRxFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRx)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date Initial RX SEER is blank, Date Initial RX SEER Flag must = 10, 11, 12, or blank')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfInitialRxFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01294; TAG: N0096; NAME: Date Initial RX SEER, Date Last Cont (NAACCR IF35)
    public boolean rqrs01294(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (dx_year < 2000)
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.dateOfInitialRx))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfInitialRx, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfInitialRx)) {
                functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01295; TAG: N0095; NAME: Date Initial RX SEER, Date of DX (NAACCR IF18)
    public boolean rqrs01295(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, seer_year, seer_month, seer_day
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (dx_year < 2000)
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.dateOfInitialRx) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfInitialRx))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfInitialRx, ((Integer)context.RQRS_GEN_DT_EXACT))
        
        if (dtcmp <= 0)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        seer_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfInitialRx)
        seer_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfInitialRx)
        seer_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfInitialRx)
        
        if (dx_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY) || seer_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) {
            if (dx_year <= seer_year)
                return true
            else
                return false
        }
        else {
            if (dx_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY) || seer_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY)) {
                if (dx_year < seer_year)
                    return true
                else {
                    if (dx_year == seer_year && dx_month <= seer_month)
                        return true
                    else
                        return false
                }
            }
            else
                return false
        }
        return false

    }

    // ID: RQRS-01296; TAG: N1093; NAME: Date of 1st Contact, Date Flag (NAACCR)
    public boolean rqrs01296(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOf1stContactFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOf1stContactFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01297; TAG: N1097; NAME: Date of Death Canada, Date Flag (CCCR)
    public boolean rqrs01297(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada) && functions.GEN_EMPTY(untrimmedline.dateOfDeathCanadaFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfDeathCanadaFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Death--Canada is blank, Date of Death--CanadaFlag must = 10, 11, 12, or blank')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfDeathCanadaFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

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

    }

    // ID: RQRS-01299; TAG: N1028; NAME: Date of Death--Canada, Vital Status (NAACCR)
    public boolean rqrs01299(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.vitalStatus))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada) && functions.GEN_EMPTY(untrimmedline.dateOfDeathCanadaFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfDeathCanadaFlag, "11"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.dateOfDeathCanadaFlag, "11"))
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-01300; TAG: N1081; NAME: Date of Death--CanadaFlag (NAACCR)
    public boolean rqrs01300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDeathCanadaFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfDeathCanadaFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01301; TAG: N0968; NAME: Date of Diagnosis Flag (NAACCR)
    public boolean rqrs01301(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosisFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfDiagnosisFlag, "12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01302; TAG: N0970; NAME: Date of Diagnosis, Date Flag (NAACCR)
    public boolean rqrs01302(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfDiagnosisFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfDiagnosisFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01303; TAG: N2041; NAME: Date of Diagnosis, EOD Coding Sys, EOD (SEER IF33)
    public boolean rqrs01303(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        err_flag = 0
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((functions.GEN_INLIST(untrimmedline.registryId, "0000001535") && dx_year < 1992))
            return true
        if ((functions.GEN_INLIST(untrimmedline.registryId, "0000001544") && dx_year < 2000)) {
            if (functions.GEN_EMPTY(untrimmedline.eodCodingSys))
                return true
        }
        if (dx_year < 1983) {
            if (functions.GEN_INLIST(untrimmedline.eodCodingSys, "0,1")) {
                if (functions.GEN_EMPTY(untrimmedline.eodOld13Digit) && functions.GEN_EMPTY(untrimmedline.eodOld4Digit) && functions.GEN_EMPTY(untrimmedline.extentOfDisease10Digit))
                    return true
                else
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.eodCodingSys, "2")) {
                if (functions.GEN_EMPTY(untrimmedline.eodOld2Digit) && functions.GEN_EMPTY(untrimmedline.eodOld4Digit) && functions.GEN_EMPTY(untrimmedline.extentOfDisease10Digit) && (functions.GEN_MATCH(untrimmedline.eodOld13Digit, "([^ \\t\\r\\n\\v\\f]((\\d)|(\\-)|(&))*((\\s))*)") && functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.eodOld13Digit, ((Integer)context.RQRS_GEN_BOTH))) == 13))
                    return true
                else
                    return false
            }
            else
                return false
        }
        if (dx_year < 1988 && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
                if (functions.GEN_EMPTY(untrimmedline.eodOld2Digit) && functions.GEN_EMPTY(untrimmedline.eodOld13Digit) && functions.GEN_EMPTY(untrimmedline.extentOfDisease10Digit) && functions.GEN_MATCH(untrimmedline.eodOld4Digit, "(\\d\\d\\d\\d)"))
                    return true
                else
                    return false
            }
            else
                return false
        }
        if (dx_year < 2004) {
            if (functions.GEN_INLIST(untrimmedline.eodCodingSys, "4")) {
                if (functions.GEN_EMPTY(untrimmedline.eodOld2Digit) && functions.GEN_EMPTY(untrimmedline.eodOld13Digit) && functions.GEN_EMPTY(untrimmedline.eodOld4Digit) && (functions.GEN_MATCH(untrimmedline.extentOfDisease10Digit, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)") || functions.GEN_MATCH(untrimmedline.extentOfDisease10Digit, "(\\d\\d\\d\\d\\d  \\d\\d\\d\\d\\d)")))
                    return true
                else
                    return false
            }
            else
                return false
        }
        if (dx_year > 2003) {
            if (!functions.GEN_EMPTY(untrimmedline.eodCodingSys)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Coding System for EOD must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodOld2Digit)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Old 2 Digit must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodOld13Digit)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Old 13 Digit must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodOld4Digit)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Old 4 Digit must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Tumor Size must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Extension must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Lymph Node Involv must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.eodExtensionProstPath)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, EOD--Extension Prost Path must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01304; TAG: N1102; NAME: Date of Inpt Adm (NAACCR)
    public boolean rqrs01304(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptAdm))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfInptAdm))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Inpatient Adm: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01305; TAG: N1082; NAME: Date of Inpt Adm Flag (NAACCR)
    public boolean rqrs01305(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptAdmFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfInptAdmFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01306; TAG: N1100; NAME: Date of Inpt Adm, Date Flag (NAACCR)
    public boolean rqrs01306(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptAdm) && functions.GEN_EMPTY(untrimmedline.dateOfInptAdmFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptAdm)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfInptAdmFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Inpt Adm is blank, Date of Inpt Adm Flag must = 10, 11, 12, or blank')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfInptAdmFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01307; TAG: N1103; NAME: Date of Inpt Disch (NAACCR)
    public boolean rqrs01307(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptDisch))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfInptDisch))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Inpatient Disch: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01308; TAG: N1083; NAME: Date of Inpt Disch Flag (NAACCR)
    public boolean rqrs01308(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptDischFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.dateOfInptDischFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01309; TAG: N1101; NAME: Date of Inpt Disch, Date Flag (NAACCR)
    public boolean rqrs01309(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptDisch) && functions.GEN_EMPTY(untrimmedline.dateOfInptDischFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfInptDisch)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfInptDischFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Inpt Disch is blank, Date of Inpt Disch Flag must = 10, 11, 12, or blank')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfInptDischFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01310; TAG: N2524; NAME: Date of Last Cancer (tumor) Status (COC)
    public boolean rqrs01310(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastCancerStatus))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Last Cancer (tumor) Status: %DC')
            return false
        }
        return true

    }

    // ID: RQRS-01311; TAG: N2525; NAME: Date of Last Cancer (tumor) Status Flag (COC)
    public boolean rqrs01311(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatusFlag))
            return true
        if (functions.GEN_AT(untrimmedline.dateOfLastCancerStatusFlag, "12") == 0)
            return false
        else
            return true
        
        return true

    }

    // ID: RQRS-01312; TAG: N2603; NAME: Date of Last Cancer (tumor) Status, Date 1st Crs RX COC (COC)
    public boolean rqrs01312(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) || functions.GEN_EMPTY(untrimmedline.dateOf1stCrsRxCoc))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastCancerStatus, untrimmedline.dateOf1stCrsRxCoc, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01313; TAG: N2526; NAME: Date of Last Cancer (tumor) Status, Date Flag (COC)
    public boolean rqrs01313(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) && functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatusFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus)) {
            if (functions.GEN_AT(untrimmedline.dateOfLastCancerStatusFlag, "12") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Last Cancer (tumor) Status Flag must be blank or = 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatusFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01314; TAG: N2527; NAME: Date of Last Cancer (tumor) Status, Date Flag, Class, Date DX (COC)
    public boolean rqrs01314(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.classOfCase, "1011121314202122", 2) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) && functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatusFlag))
                return functions.GEN_ERROR_MSG(binding, 'Date of Last Cancer (tumor) Status and Date of Last Cancer (tumor) Status Flag cannot both be blank for analytic case')
        }
        return true

    }

    // ID: RQRS-01315; TAG: N2528; NAME: Date of Last Cancer (tumor) Status, Date Last Contact (COC)
    public boolean rqrs01315(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastCancerStatus, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01316; TAG: N2605; NAME: Date of Last Cancer (tumor) Status, Date of 1st Contact (COC)
    public boolean rqrs01316(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) || functions.GEN_EMPTY(untrimmedline.dateOf1stContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastCancerStatus, untrimmedline.dateOf1stContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01317; TAG: N2529; NAME: Date of Last Cancer (tumor) Status, Date of Diagnosis (COC)
    public boolean rqrs01317(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastCancerStatus, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01318; TAG: N2606; NAME: Date of Last Cancer (tumor) Status, Recurrence Date--1st (COC)
    public boolean rqrs01318(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastCancerStatus) || functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastCancerStatus, untrimmedline.recurrenceDate1st, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01319; TAG: N0312; NAME: Date of Last Contact, Cause of Death (SEER IF12)
    public boolean rqrs01319(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dolc_year
        
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dolc_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dolc_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        }
        if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "0420-0449", "(\\d\\d\\d\\d)")) {
            if ((dolc_year <= 1986) || (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) || (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")))
                return false
        }
        return true

    }

    // ID: RQRS-01320; TAG: N1094; NAME: Date of Last Contact, Date Flag (NAACCR)
    public boolean rqrs01320(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfLastContactFlag, "12"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = 12, indicating unknown date')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfLastContactFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

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

    }

    // ID: RQRS-01322; TAG: N1620; NAME: Date of Mult Tum, Lymphoma/Leukem/Unk Site (NAACCR)
    public boolean rqrs01322(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
            return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751-9758,9765-9769,9970"))
                return true
        }
        if (dx_year == 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9732-9733,9735-9738,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
        }
        if (dx_year == 2011) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (!functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3)))
                return true
        }
        if (dx_year > 2010) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C809")) || ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3))) || (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732-9733,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992"))) {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must = 11')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Date of Mult Tumors Flag must not = 11')
            }
        }
        
        return true

    }

    // ID: RQRS-01323; TAG: N1134; NAME: Date of Mult Tumors, Date Flag (NAACCR)
    public boolean rqrs01323(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors)) {
            if (!functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Mult Tumors is blank, Date of Mult Tumors Flag must = blank, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01324; TAG: N1482; NAME: Date of Mult Tumors, Date of DX (CCCR)
    public boolean rqrs01324(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = 2008-2012, then Date of Mult Tumors and Date of Mult Tumors Flag cannot both be blank')
        }
        if (dx_year < 2008) {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) || !functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Date of Mult Tumors and Date of Mult Tumors Flag must be blank')
        }
        return true

    }

    // ID: RQRS-01325; TAG: N2512; NAME: Date of Sentinel Lymph Node Biopsy (COC)
    public boolean rqrs01325(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfSentinelLymphNodeBiopsy))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Sentinel Lymph Node Biopsy: %DC')
            return false
        }
        return true

    }

    // ID: RQRS-01326; TAG: N2513; NAME: Date of Sentinel Lymph Node Biopsy Flag (COC)
    public boolean rqrs01326(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
            return true
        if (functions.GEN_AT(untrimmedline.dateSentinelLymphNodeBiopsyFlag, "101112", 2) == 0)
            return false
        else
            return true
        
        return true

    }

    // ID: RQRS-01327; TAG: N2514; NAME: Date of Sentinel Lymph Node Biopsy, Date Flag (COC)
    public boolean rqrs01327(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) && functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy)) {
            if (functions.GEN_AT(untrimmedline.dateSentinelLymphNodeBiopsyFlag, "101112", 2) == 0)
                return functions.GEN_ERROR_MSG(binding, 'Date of Sentinel Lymph Node Biopsy Flag must be blank, 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01328; TAG: N2516; NAME: Date of Sentinel Lymph Node Biopsy, Date Last Contact (COC)
    public boolean rqrs01328(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfSentinelLymphNodeBiopsy, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01329; TAG: N2607; NAME: Date of Sentinel Lymph Node Biopsy, Date of 1st Contact, Class of Case (COC)
    public boolean rqrs01329(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || functions.GEN_EMPTY(untrimmedline.dateOf1stContact))
            return true
        if (functions.GEN_AT(untrimmedline.classOfCase, "001314", 2) != 0) {
        
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfSentinelLymphNodeBiopsy, untrimmedline.dateOf1stContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
            if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
                return true
            else {
                if (dtcmp >= 0)
                    return true
                else
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-01330; TAG: N2517; NAME: Date of Sentinel Lymph Node Biopsy, Date of Diagnosis (COC)
    public boolean rqrs01330(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int dtcmp
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfSentinelLymphNodeBiopsy, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01331; TAG: N2515; NAME: Date of Sentinel Lymph Node Biopsy, Schema ID, Date DX (COC)
    public boolean rqrs01331(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)
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || !functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Sentinel Lymph Node Biopsy and Date of Sentinel Lymph Node Biopsy Flag must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year > 2017) {
            if (functions.GEN_AT(code, ID, 6) != 0) {
                if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) && functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis 2018+ and Schema ID: ${untrimmedline.schemaId}, either Date of Sentinel Lymph Node Biopsy or Date of Sentinel Lymph Node Biopsy Flag must be reported.')
            }
            if (functions.GEN_AT(code, ID, 6) == 0) {
                if (!functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || !functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
                    return functions.GEN_ERROR_MSG(binding, 'Date of Sentinel Lymph Node Biopsy and Date of Sentinel Lymph Node Biopsy Flag must be reported only for Melanoma of Skin and Breast')
            }
        }
        return true

    }

    // ID: RQRS-01332; TAG: N3970; NAME: Date of Sentinel Lymph Node Biopsy, Schema ID, Date DX (SEER)
    public boolean rqrs01332(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)
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) || !functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Sentinel Lymph Node Biopsy and Date of Sentinel Lymph Node Biopsy Flag must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year > 2017) {
        
            if (functions.GEN_AT(code, ID, 6) != 0) {
                if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) && functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis 2018+ and Schema ID: ${untrimmedline.schemaId}, either Date of Sentinel Lymph Node Biopsy or Date of Sentinel Lymph Node Biopsy Flag must be reported.')
            }
        }
        return true

    }

    // ID: RQRS-01333; TAG: N2518; NAME: Date Regional Lymph Node Dissection (COC)
    public boolean rqrs01333(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateRegionalLymphNodeDissection))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Regional Lymph Node Dissection: %DC')
            return false
        }
        return true

    }

    // ID: RQRS-01334; TAG: N2519; NAME: Date Regional Lymph Node Dissection Flag (COC)
    public boolean rqrs01334(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
            return true
        if (functions.GEN_AT(untrimmedline.dateRegionalLymphNodeDissectionFlag, "101112", 2) == 0)
            return false
        else
            return true
        
        return true

    }

    // ID: RQRS-01335; TAG: N2520; NAME: Date Regional Lymph Node Dissection, Date Flag (COC)
    public boolean rqrs01335(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) && functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection)) {
            if (functions.GEN_AT(untrimmedline.dateRegionalLymphNodeDissectionFlag, "101112", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date Regional Lymph Node Dissection Flag must be blank, 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: RQRS-01336; TAG: N2521; NAME: Date Regional Lymph Node Dissection, Date Flag, Date DX (COC)
    public boolean rqrs01336(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || !functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date Regional Lymph Node Dissection and Date Regional Lymph Node Dissection Flag must be blank for cases diagnosed before 2018')
        }
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) && functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis 2018 and later, Date Regional Lymph Node Dissection or Date Regional Lymph Node Dissection Flag must be reported')
        }
        return true

    }

    // ID: RQRS-01337; TAG: N3949; NAME: Date Regional Lymph Node Dissection, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01337(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || !functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date Regional Lymph Node Dissection and Date Regional Lymph Node Dissection Flag must be blank for cases diagnosed before 2018')
        }
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) && functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis 2018 and later and CoC Accredited Flag = 1, Date Regional Lymph Node Dissection or Date Regional Lymph Node Dissection Flag must be reported')
        }
        return true

    }

    // ID: RQRS-01338; TAG: N2522; NAME: Date Regional Lymph Node Dissection, Date Last Contact (COC)
    public boolean rqrs01338(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLymphNodeDissection, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01339; TAG: N2608; NAME: Date Regional Lymph Node Dissection, Date of 1st Contact, Class of Case (COC)
    public boolean rqrs01339(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.dateOf1stContact))
            return true
        if (functions.GEN_AT(untrimmedline.classOfCase, "001314", 2) != 0) {
        
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLymphNodeDissection, untrimmedline.dateOf1stContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
            if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
                return true
            else {
                if (dtcmp >= 0)
                    return true
                else
                    return false
            }
        }
        
        return true

    }

    // ID: RQRS-01340; TAG: N2523; NAME: Date Regional Lymph Node Dissection, Date of Diagnosis (COC)
    public boolean rqrs01340(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int dtcmp
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLymphNodeDissection, untrimmedline.dateOfDiagnosis, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01341; TAG: N0614; NAME: Date Tumor Record Availbl (NAACCR DATEEDIT)
    public boolean rqrs01341(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateTumorRecordAvailbl))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateTumorRecordAvailbl))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date Tumor Record Availbl: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01342; TAG: N0237; NAME: DC State File Number, Vital Status (NAACCR)
    public boolean rqrs01342(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
            if (functions.GEN_EMPTY(untrimmedline.dcStateFileNumber))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01343; TAG: N0830; NAME: Death Certificate Only, RX (NPCR)
    public boolean rqrs01343(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        err_flag = 0
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2006)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98,99", "(\\d\\d)")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg Prim Site')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Scope Reg LN Sur')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg Oth Reg/Dis')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Reason for No Surgery')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "99")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--BRM')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "99")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Chemo')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "99")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Hormone')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Other')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Transplnt/Endocr')
            err_flag = 1
        }
        if (dx_year < 2018) {
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "99")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Rad--Regional RX Modality')
                err_flag = 1
            }
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Phase I Radiation Treatment Modality')
                err_flag = 1
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg/Rad Seq')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurgSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Systemic/Sur Seq ')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01344; TAG: N0708; NAME: Derived AJCC--Flag, Derived AJCC (SEER)
    public boolean rqrs01344(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new 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 err_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        err_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.derivedAjccFlag)) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 Stage Group')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M Descriptor')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 Stage Group')
                err_flag = 1
            }
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 Stage Group')
                err_flag = 1
            }
            if (dx_year > 2007) {
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 T Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 N Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-6 M Descriptor')
                    err_flag = 1
                }
            }
            if (dx_year > 2009) {
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 T Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 N Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 M Descriptor')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Derived AJCC--Flag and Derived AJCC-7 Stage Group')
                    err_flag = 1
                }
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01345; TAG: N1469; NAME: Derived CS Items, Date of DX (CCCR)
    public boolean rqrs01345(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 Stage Group cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS1977 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS2000 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Derived cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 Stage Group cannot be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01346; TAG: N0699; NAME: Derived CS Items, Date of DX (COC)
    public boolean rqrs01346(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2015)
            return true
        if (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived AJCC-6 Stage Group cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS1977 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Derived SS2000 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Derived cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 T Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 N Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 M Descriptor cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Derived AJCC-7 Stage Group cannot be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01347; TAG: N2351; NAME: Derived CS Items, Date of DX (NPCR)
    public boolean rqrs01347(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003 && dx_year < 2016) && functions.GEN_EMPTY(untrimmedline.overrideCs20)) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2016, Derived SS2000 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2016, CS Version Derived cannot be blank')
                err_flag = 1
            }
            if (err_flag == 1)
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Conflict between Over-ride CS 20 (${untrimmedline.overrideCs20}) and Derived items')
        if (functions.GEN_INLIST(untrimmedline.overrideCs20, "1")) {
            if (!functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, CS Version Derived must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived SS1977 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived SS2000 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-6 Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived AJCC-7 Stage Group must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01348; TAG: N2408; NAME: Derived CS Items, Date of DX (SEER)
    public boolean rqrs01348(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (((dx_year > 2003) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 T cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 N cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 M cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 Stage Group cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived SS1977 cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived SS2000 cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'CS Version Derived cannot be blank for this DX year')
                err_flag = 1
            }
        }
        if (((dx_year > 2007) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, ' Derived AJCC-6 T Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 N Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-6 M Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
        }
        if (((dx_year > 2009) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 T cannot be blank for this dx year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 T Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 N cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 N Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 M cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 M Descriptor cannot be blank for this DX year')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'Derived AJCC-7 Stage Group cannot be blank for this DX year')
                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, '_schema_ms')
            return false
        }
        return true

    }

    // ID: RQRS-01349; TAG: N2839; NAME: Derived CS Items, DX Post 2017 (CS)
    public boolean rqrs01349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        err_flag = 0
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-6 Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC-7 Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjccFlag)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived AJCC--Flag must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived SS1977 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs1977Flag)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived SS1977--Flag must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived SS2000 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000Flag)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Derived SS2000--Flag must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Version Input Original must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Version Input Current must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, CS Version Derived must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01350; TAG: N0702; NAME: Derived CS Items, DX Pre-2004 (CS)
    public boolean rqrs01350(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        err_flag = 0
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2004) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc6StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-6 Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7T)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7TDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 T Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7N)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7NDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 N Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7M)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7MDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 M Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedAjcc7StageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived AJCC-7 Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs1977)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived SS1977 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, Derived SS2000 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionOriginal)) {
                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_EMPTY(untrimmedline.csVersionDerived)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Version Derived must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01351; TAG: N3016; NAME: Derived EOD 2018 M (SEER)
    public boolean rqrs01351(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedEod2018M))
            return true
        char[] m_string = new char[250]
        
        functions.GEN_STRCPY(m_string, "M0             M0(i+)         M1             M1a            M1a(0)         M1a(1)         ")
        functions.GEN_STRCAT(m_string, "M1b            M1b(0)         M1b(1)         M1c            M1c(0)         M1c(1)         ")
        functions.GEN_STRCAT(m_string, "M1d            M1d(0)         M1d(1)         88             ")
        
        if (functions.GEN_AT(untrimmedline.derivedEod2018M, m_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01352; TAG: N3015; NAME: Derived EOD 2018 N (SEER)
    public boolean rqrs01352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedEod2018N))
            return true
        char[] n_string = new char[350]
        
        functions.GEN_STRCPY(n_string, "NX             N0             N0a            N0b            N0(i+)         N0(mol+)       ")
        functions.GEN_STRCAT(n_string, "N1             N1mi           N1a(sn)        N1a            N1b            N1c            ")
        functions.GEN_STRCAT(n_string, "N2             N2mi           N2a            N2b            N2c            N3             ")
        functions.GEN_STRCAT(n_string, "N3a            N3b            N3c            88             ")
        
        if (functions.GEN_AT(untrimmedline.derivedEod2018N, n_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01353; TAG: N3017; NAME: Derived EOD 2018 Stage Group (SEER)
    public boolean rqrs01353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedEod2018StageGroup))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "OC             0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1E             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2 bulky        2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1            3A2            3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0            3:1            3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6            3:7            3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12           3:13           3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18           3:19           3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24           3:25           4              4A             ")
        functions.GEN_STRCAT(s2_string, "4A1            4A2            4B             4C             4:0            4:1            ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4            4:5            4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10           4:11           4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16           4:17           4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22           4:23           4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             3D             ")
        
        if (functions.GEN_AT(untrimmedline.derivedEod2018StageGroup, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.derivedEod2018StageGroup, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01354; TAG: N3014; NAME: Derived EOD 2018 T (SEER)
    public boolean rqrs01354(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedEod2018T))
            return true
        char[] t_string = new char[650]
        
        functions.GEN_STRCPY(t_string, "TX             T0             Ta             Tis            Tis(DCIS)      Tis(LAMN)      ")
        functions.GEN_STRCAT(t_string, "Tis(Paget)     T1             T1a            T1a1           T1a2           T1b            ")
        functions.GEN_STRCAT(t_string, "T1b1           T1b2           T1c            T1c1           T1c2           T1c3           ")
        functions.GEN_STRCAT(t_string, "T1d            T1mi           T2             T2a            T2a1           T2a2           ")
        functions.GEN_STRCAT(t_string, "T2b            T2c            T2d            T3             T3a            T3b            ")
        functions.GEN_STRCAT(t_string, "T3c            T3d            T3e            T4             T4a            T4b            ")
        functions.GEN_STRCAT(t_string, "T4c            T4d            T4e            88             ")
        
        if (functions.GEN_AT(untrimmedline.derivedEod2018T, t_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01355; TAG: N4904; NAME: Derived EOD 2018, Date of DX (SEER)
    public boolean rqrs01355(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedEod2018T) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018N) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018M) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018StageGroup))
                return false
        }
        return true

    }

    // ID: RQRS-01356; TAG: N2117; NAME: Derived SEER Clin Stg Grp (SEER)
    public boolean rqrs01356(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerClinStgGrp))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerClinStgGrp, "0-4", "(\\d\\s\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerClinStgGrp, "0A,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerClinStgGrp, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        return false

    }

    // ID: RQRS-01357; TAG: N2118; NAME: Derived SEER Cmb M Src (SEER)
    public boolean rqrs01357(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedMSrc))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedMSrc, "1,2,3,9"))
            return true
        return false

    }

    // ID: RQRS-01358; TAG: N2119; NAME: Derived SEER Cmb N Src (SEER)
    public boolean rqrs01358(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedNSrc))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedNSrc, "1,2,3,9"))
            return true
        return false

    }

    // ID: RQRS-01359; TAG: N2120; NAME: Derived SEER Cmb Stg Grp (SEER)
    public boolean rqrs01359(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedStgGrp))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedStgGrp, "0-4", "(\\d\\s\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedStgGrp, "0A,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedStgGrp, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        return false

    }

    // ID: RQRS-01360; TAG: N2121; NAME: Derived SEER Cmb T Src (SEER)
    public boolean rqrs01360(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedTSrc))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedTSrc, "1,2,3,9"))
            return true
        return false

    }

    // ID: RQRS-01361; TAG: N2122; NAME: Derived SEER Combined M (SEER)
    public boolean rqrs01361(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedM)) {
            return true
        }
        if (!functions.GEN_JUSTIFIED(untrimmedline.derivedSeerCombinedM, ((Integer)context.RQRS_GEN_LEFT)))
            return false
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedM, "88,c0,c0I+,c1,c1A,c1B,c1C,c1D,c1E,p1,p1A,p1B,p1C,p1D,p1E"))
            return true
        return false

    }

    // ID: RQRS-01362; TAG: N2123; NAME: Derived SEER Combined N (SEER)
    public boolean rqrs01362(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedN)) {
            return true
        }
        if (!functions.GEN_JUSTIFIED(untrimmedline.derivedSeerCombinedN, ((Integer)context.RQRS_GEN_LEFT))) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.derivedSeerCombinedN, "(((c)|(p))0((I)|(M))((\\+)|(\\-))\\s)") || functions.GEN_MATCH(untrimmedline.derivedSeerCombinedN, "(((c)|(p))1MI\\s)")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedN, "cX,c0,c1MI,c0A,c0B,c1,c1A,c1B,c1C,c2,c2A") || functions.GEN_INLIST(untrimmedline.derivedSeerCombinedN, "c2B,c2C,c3,c3A,c3B,c3C,c4,pX,p0,p1MI,p0A") || functions.GEN_INLIST(untrimmedline.derivedSeerCombinedN, "p0B,p1,p1A,p1B,p1C,p2,p2A,p2B,p2C,p3,p3A,p3B,p3C,p4,88"))
            return true
        return false

    }

    // ID: RQRS-01363; TAG: N2124; NAME: Derived SEER Combined T (SEER)
    public boolean rqrs01363(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedT))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "X,0-4", "(c[A-Za-z0-9]\\s\\s\\s)", 2, 4))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E", "(c[A-Za-z0-9][A-Za-z0-9]\\s\\s)", 2, 4))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "1A1,1A2,1B1,1B2,1MI,2A1,2A2", "(c[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)", 2, 4))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "X,A,0-4", "(p[A-Za-z0-9]\\s\\s\\s)", 2, 4))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "IS,1A,1B,1C,1D,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E", "(p[A-Za-z0-9][A-Za-z0-9]\\s\\s)", 2, 4))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerCombinedT, "1A1,1A2,1B1,1B2,1MI,2A1,2A2, ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)", 2, 4))
            return true
        return false

    }

    // ID: RQRS-01364; TAG: N2125; NAME: Derived SEER Path Stg Grp (SEER)
    public boolean rqrs01364(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSeerPathStgGrp))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerPathStgGrp, "0-4", "(\\d\\s\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerPathStgGrp, "0A,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSeerPathStgGrp, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        return false

    }

    // ID: RQRS-01365; TAG: N2813; NAME: Derived Summary Stage 2018 (SEER)
    public boolean rqrs01365(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "01234789", 1) != 0)
            return true
        return false

    }

    // ID: RQRS-01366; TAG: N2827; NAME: Derived Summary Stage 2018, Date of DX (SEER)
    public boolean rqrs01366(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Derived Summary Stage 2018 must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Derived Summary Stage 2018 must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01367; TAG: N4910; NAME: Derived Summary Stage 2018, Schema ID (SEER)
    public boolean rqrs01367(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], SS2018 = new char[2]
        
        int dx_year
        
        
        char[] group_SS2018 = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        functions.GEN_STRCPY(group_SS2018, untrimmedline.schemaId)
        functions.GEN_STRCAT(group_SS2018, untrimmedline.derivedSummaryStage2018)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SUMST2018, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SUMST2018_SCHEMA_IDSS2018, group_SS2018, ['SCHEMA_ID':SCHEMA_ID, 'SS2018':SS2018])) {
            functions.GEN_SAVE_TEXT(binding, 'am')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Derived Summary Stage 2018: ${untrimmedline.derivedSummaryStage2018} not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

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

    }

    // ID: RQRS-01369; TAG: N0044; NAME: Diagnostic Confirmation, Behavior ICDO2 (SEER IF31)
    public boolean rqrs01369(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
        if (functions.GEN_MATCH(untrimmedline.overRideHistology, "(2)|(3)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.behaviorIcdO2, "(2)")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01371; TAG: N0313; NAME: Diagnostic Confirmation, Date of Diag (SEER IF55)
    public boolean rqrs01371(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1988)
            return functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4,6-9")
        else {
            if (dx_year < 2010)
                return functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4-9")
            else
                return functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1-9")
        }
        
        return true

    }

    // ID: RQRS-01372; TAG: N0004; NAME: Diagnostic Confirmation, Histology ICDO2 (SEER IF48)
    public boolean rqrs01372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideLeukLymphoma, "1"))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9717", "(\\d\\d\\d\\d)") && functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6,8")))
            return false
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720-9941", "(\\d\\d\\d\\d)") && functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6")))
            return false
        return true

    }

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

    }

    // ID: RQRS-01374; TAG: N0314; NAME: Diagnostic Proc 73-87 (SEER DXINFO)
    public boolean rqrs01374(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00-91", "(\\d\\d)|(\\s\\s)")

    }

    // ID: RQRS-01375; TAG: N0488; NAME: Edit Over-rides (NAACCR)
    public boolean rqrs01375(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHistology, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAgeSiteMorph, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSeqNoDxConf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatSeqNo, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSurgDxConf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideReportSource, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideIllDefineSite, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideLeukLymphoma, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDate, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatEod, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSsNodesPos, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSsTnmN, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSsTnmM, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAcsnClassSeq, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHospSeqDxConf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHospSeqSite, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteTnmStgGrp, "(1)|(\\s)"))
            return true
        else
            return false
        
        return true

    }

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

    }

    // ID: RQRS-01377; TAG: N1976; NAME: EDP MDE Link (NPCR)
    public boolean rqrs01377(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkVariable))
            return true
        return functions.GEN_INLIST(untrimmedline.edpMdeLinkVariable, "0,1")

    }

    // ID: RQRS-01378; TAG: N1975; NAME: EDP MDE Link Date (NPCR)
    public boolean rqrs01378(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.edpMdeLinkData))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'EDP MDE Link Date: %DC')
            return false
        }
        
        return true

    }

    // ID: RQRS-01379; TAG: N1977; NAME: EDP MDE Link, Date, Primary Site (NPCR)
    public boolean rqrs01379(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,530-539,180-209,260", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.edpMdeLinkVariable, "1")) {
                if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
                    return functions.GEN_ERROR_MSG(binding, 'If MDELink = 1, then MDEDate must not be blank')
            }
            if (functions.GEN_INLIST(untrimmedline.edpMdeLinkVariable, "0") || functions.GEN_EMPTY(untrimmedline.edpMdeLinkVariable)) {
                if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
                    return functions.GEN_ERROR_MSG(binding, 'If MDELink = 0 or blank, then MDEDate must be blank')
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509,530-539,180-209,260", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkVariable))
                return false
            if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
                return false
        }
        return true

    }

    // ID: RQRS-01380; TAG: N1978; NAME: EDP MDE Link, EDP MDE Link Date (NPCR)
    public boolean rqrs01380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.edpMdeLinkVariable, "1")) {
            if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
                return functions.GEN_ERROR_MSG(binding, 'If MDELink = 1, then MDEDate must not be blank')
        }
        if (functions.GEN_INLIST(untrimmedline.edpMdeLinkVariable, "0") || functions.GEN_EMPTY(untrimmedline.edpMdeLinkVariable)) {
            if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkData))
                return functions.GEN_ERROR_MSG(binding, 'If MDELink = 0 or blank, then MDEDate must be blank')
        }
        
        return true

    }

    // ID: RQRS-01381; TAG: N2995; NAME: EOD Mets (SEER)
    public boolean rqrs01381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        char[] m_string = new char[40]
        char[] code = new char[4]
        
        
        functions.GEN_STRCPY(m_string, "00 05 10 20 30 40 50 60 70 88 99 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.eodMets)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, m_string, 3) == 0)
            return false
        return true

    }

    // ID: RQRS-01382; TAG: N2993; NAME: EOD Primary Tumor (SEER)
    public boolean rqrs01382(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        char[] t_string = new char[160]
        char[] code = new char[4]
        
        
        functions.GEN_STRCPY(t_string, "000 050 070 100 110 120 125 130 150 170 175 200 210 220 225 250 275 300 325 ")
        functions.GEN_STRCAT(t_string, "350 370 375 400 425 450 475 500 525 550 600 650 700 720 750 800 888 980 999 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.eodPrimaryTumor)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, t_string, 4) == 0)
            return false
        return true

    }

    // ID: RQRS-01383; TAG: N2994; NAME: EOD Regional Nodes (SEER)
    public boolean rqrs01383(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        char[] n_string = new char[100]
        char[] code = new char[4]
        
        
        functions.GEN_STRCPY(n_string, "000 030 050 070 100 150 200 250 300 350 400 450 500 550 600 650 ")
        functions.GEN_STRCAT(n_string, "700 750 800 888 987 999 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.eodRegionalNodes)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, n_string, 4) == 0)
            return false
        return true

    }

    // ID: RQRS-01384; TAG: N2987; NAME: EOD2018, Date of Diagnosis (SEER)
    public boolean rqrs01384(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor) || !functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) || !functions.GEN_EMPTY(untrimmedline.eodMets))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Primary Tumor, EOD Regional Nodes, and EOD Mets must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor) || functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) || functions.GEN_EMPTY(untrimmedline.eodMets))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Primary Tumor, EOD Regional Nodes, and EOD Mets must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01385; TAG: N0731; NAME: EOD--Ext Prost Path,RX Summ--Surg Prim Site (SEER)
    public boolean rqrs01385(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtensionProstPath) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || !functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30,50,70,80,90")) {
            if (!functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "90,98,99"))
                return false
        }
        return true

    }

    // ID: RQRS-01386; TAG: N0775; NAME: EOD--Ext Prost Path,RX Summ--Surg Sit 98-02 (SEER)
    public boolean rqrs01386(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtensionProstPath) || functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802) || !functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "30,40,50,70,80,90")) {
            if (!functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "90,98,99"))
                return false
        }
        return true

    }

    // ID: RQRS-01387; TAG: N0232; NAME: EOD--Extension (SEER)
    public boolean rqrs01387(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtension))
            return true
        return functions.GEN_MATCH(untrimmedline.eodExtension, "(\\d\\d)")

    }

    // ID: RQRS-01388; TAG: N0615; NAME: EOD--Extension Prost Path (SEER)
    public boolean rqrs01388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtensionProstPath))
            return true
        return functions.GEN_MATCH(untrimmedline.eodExtensionProstPath, "(\\d\\d)")

    }

    // ID: RQRS-01389; TAG: N0420; NAME: EOD--Extension Prost Path, Prim Site, ICDO2 (NAACCR)
    public boolean rqrs01389(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.eodExtensionProstPath) || functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true /* Note: blank dates are > 1998 */
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C619)")))
            return functions.GEN_ERROR_MSG(binding, 'EOD--Extension Prost Path must be blank for non-prostate cases')
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if (functions.GEN_VAL(untrimmedline.eodExtensionProstPath) == 90)
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Extension Prost Path must = 90')
        }
        if (functions.GEN_VAL(untrimmedline.behaviorIcdO2) == 3) {
            if (functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "20,23,30-34,40-43,45,48,50,60,70,85,90,98,99"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Malignant EOD--Extension Prost Path is invalid')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "00,99"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'In Situ EOD--Extension Prost Path is invalid')
        }
        return true

    }

    // ID: RQRS-01390; TAG: N0474; NAME: EOD--Extension Prost Path, Prim Site, ICDO3 (NAACCR)
    public boolean rqrs01390(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.eodExtensionProstPath) || functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998)
            return true /* Note: blank dates are > 1998 */
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3"))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C619)")))
            return functions.GEN_ERROR_MSG(binding, 'EOD--Extension Prost Path must be blank for non-prostate cases')
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if (functions.GEN_VAL(untrimmedline.eodExtensionProstPath) == 90)
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Extension Prost Path must = 90')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,3")) {
            if (functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "20,23,30-34,40-43,45,48,50,60,70,85,90,98,99"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Malignant EOD--Extension Prost Path is invalid')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.eodExtensionProstPath, "00,99"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'In Situ EOD--Extension Prost Path is invalid')
        }
        return true

    }

    // ID: RQRS-01391; TAG: N2362; NAME: EOD--Extension, Primary Site, ICDO3 (NAACCR)
    public boolean rqrs01391(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, extflg
        
        char[] W_SiteExt = new char[7], W_HistExt = new char[7]
        
        extflg = 0
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtension) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year < 1998) || (dx_year > 2003))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.eodExtension, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'EOD--Extension must be a two-digit number')
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3"))
            return true
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "C619")) {
                if (functions.GEN_INLIST(untrimmedline.eodExtension, "99"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Extension for this site must = 99')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.eodExtension, "90"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Extension for prostate must = 90')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729,9731-9989")) {
                if (!functions.GEN_EMPTY(untrimmedline.eodExtension))
                    extflg = 1
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632,690, 691-694,698-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodExtension, "00"))
                        extflg = 1
                    else
                        return true
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                        if (!functions.GEN_EMPTY(untrimmedline.eodExtension))
                            extflg = 1
                        else
                            return true
                    }
                    else {
                        functions.GEN_STRCPY(W_SiteExt, untrimmedline.primarySite)
                        functions.GEN_STRCAT(W_SiteExt, untrimmedline.eodExtension)
                        if (!functions.GEN_ILOOKUP(W_SiteExt, context.RQRS_EXT03INS, context.RQRS_EXT03INS_SITEEXT, [:]))
                            extflg = 1
                        else
                            return true
                    }
                }
            }
            if (extflg == 1)
                return functions.GEN_ERROR_MSG(binding, 'In Situ EOD--Extension (${untrimmedline.eodExtension}) invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,3")) {
        
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140")) {
                if (!functions.GEN_INLIST(untrimmedline.eodExtension, "11,12,13,21,22,23,24,25,26,27,29,99"))
                    extflg = 1
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729")) {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.eodExtension, "10,11"))
                        extflg = 1
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,11,20,21,30,31,32,33,80,99"))
                            extflg = 1
                        else
                            return true
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992")) {
                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,80,99"))
                            extflg = 1
                        else {
                            if (functions.GEN_INLIST(untrimmedline.eodExtension, "10") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731,9734,9740,9750-9752,9755-9758,9764,9930"))
                                extflg = 1
                            else {
                                if (functions.GEN_INLIST(untrimmedline.eodExtension, "80") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751,9752"))
                                    extflg = 1
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.eodExtension, "99") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731,9734,9740,9750-9758,9764,9930"))
                                        extflg = 1
                                    else
                                        return true
                                }
                            }
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                            if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,11,20,21,30,31,40,41,50,51,60,62,64,70,80,85,87,99"))
                                extflg = 1
                            else
                                return true
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,20,30,70,80,85,99"))
                                    extflg = 1
                                else
                                    return true
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "691-694,698,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                    if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,17,20,25,30,40,43,44,45,50,55,56,70,80,85,99"))
                                        extflg = 1
                                    else
                                        return true
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,30,40,45,48,50,55,60,70,72,75,80,85,99"))
                                            extflg = 1
                                        else
                                            return true
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                                            if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,20,25,30,50,70,85,99"))
                                                extflg = 1
                                            else
                                                return true
                                        }
                                        else {
                                            functions.GEN_STRCPY(W_SiteExt, untrimmedline.primarySite)
                                            functions.GEN_STRCAT(W_SiteExt, untrimmedline.eodExtension)
                                            if (!functions.GEN_ILOOKUP(W_SiteExt, context.RQRS_EXT3SITM, context.RQRS_EXT3SITM_SITEEXT, [:]))
                                                extflg = 1
                                            else
                                                return true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (extflg == 1)
            return functions.GEN_ERROR_MSG(binding, 'Malignant EOD--Extension (${untrimmedline.eodExtension}) invalid for this site/histology/behavior')
        return true

    }

    // ID: RQRS-01392; TAG: N0233; NAME: EOD--Lymph Node Involv (SEER)
    public boolean rqrs01392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
            return true
        return functions.GEN_MATCH(untrimmedline.eodLymphNodeInvolv, "(\\d)")

    }

    // ID: RQRS-01393; TAG: N2363; NAME: EOD--Lymph Node Involv, Prim Site, ICDO3 (NAACCR)
    public boolean rqrs01393(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, LNflg
        
        char[] W_SiteLN = new char[7]
        
        if (functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year < 1998) || (dx_year > 2003))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3"))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.eodLymphNodeInvolv, "(\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'EOD--Lymph Node Involv must be a one-digit number')
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if (functions.GEN_VAL(untrimmedline.eodLymphNodeInvolv) == 9)
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Lymph Node Involv must = 9')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729,9731-9989")) {
                if (!functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
                    LNflg = 1
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632,690,691-694,698-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0"))
                        LNflg = 1
                    else
                        return true
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                        if (!functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
                            LNflg = 1
                        else
                            return true
                    }
                    else {
                        functions.GEN_STRCPY(W_SiteLN, untrimmedline.primarySite)
                        functions.GEN_STRCAT(W_SiteLN, untrimmedline.eodLymphNodeInvolv)
                        if (!functions.GEN_ILOOKUP(W_SiteLN, context.RQRS_LN03INS, context.RQRS_LN03INS_SITE_LN, [:]))
                            LNflg = 1
                        else
                            return true
                    }
                }
            }
            if (LNflg == 1)
                return functions.GEN_ERROR_MSG(binding, 'In Situ EOD--Lymph Node Involv (${untrimmedline.eodLymphNodeInvolv}) invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,3")) {
        
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729")) {
                if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,2,3,9"))
                    LNflg = 1
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "9"))
                        LNflg = 1
                    else
                        return true
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                        if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0-5,7-9"))
                            LNflg = 1
                        else
                            return true
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                            if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                LNflg = 1
                            else
                                return true
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "691-694,698,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                    LNflg = 1
                                else
                                    return true
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                        LNflg = 1
                                    else
                                        return true
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                                        if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0-3,9"))
                                            LNflg = 1
                                        else
                                            return true
                                    }
                                    else {
                                        functions.GEN_STRCPY(W_SiteLN, untrimmedline.primarySite)
                                        functions.GEN_STRCAT(W_SiteLN, untrimmedline.eodLymphNodeInvolv)
                                        if (!functions.GEN_ILOOKUP(W_SiteLN, context.RQRS_LN03MAL, context.RQRS_LN03MAL_SITE_LN, [:]))
                                            LNflg = 1
                                        else
                                            return true
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (LNflg == 1)
            return functions.GEN_ERROR_MSG(binding, 'Malignant EOD--Lymph Node Involv (${untrimmedline.eodLymphNodeInvolv}) invalid for this site/histology/behavior')
        return true

    }

    // ID: RQRS-01394; TAG: N0422; NAME: EOD--Lymph Node Involv, Reg Nodes Pos,ICDO2 (NAACCR)
    public boolean rqrs01394(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int hist4, rnp, year
        boolean kaposi, hematop, lympho, mycosis, brain, othcns, othill
        char[] hist4c = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year < 1998) || (dx_year > 2000)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO2, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO2')
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        functions.GEN_STRCPY(hist4c, untrimmedline.histologyIcdO2)
        hist4 = functions.GEN_VAL(hist4c)
        
        
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesPositive, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must be numeric (00-90, 95-99)')
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9720,9722,9723,9731,9732,9760-9768,9800-9941,9950-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9595,9650-9698,9702-9717")
        mycosis = functions.GEN_INLIST(hist4c, "9700,9701")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if (!(kaposi || hematop || lympho || mycosis || brain || othcns || othill)) {
            if (rnp >= 1 && rnp <= 97) {
                if (!(functions.GEN_MATCH(untrimmedline.eodLymphNodeInvolv, "([1-8])")))
                    return functions.GEN_ERROR_MSG(binding, 'If Regional Nodes Positive = 01-97, EOD--Lymph Node Involv must = 1-8')
            }
        }
        return true

    }

    // ID: RQRS-01395; TAG: N0462; NAME: EOD--Lymph Node Involv, Reg Nodes Pos,ICDO3 (NAACCR)
    public boolean rqrs01395(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int hist4, rnp, year
        boolean kaposi, hematop, lympho, mycosis, brain, othcns, othill
        char[] hist4c = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if ((dx_year < 1998) || (dx_year > 2003)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        functions.GEN_STRCPY(hist4c, untrimmedline.histologyIcdO3)
        hist4 = functions.GEN_VAL(hist4c)
        
        
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesPositive, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must be numeric (00-90, 95-99)')
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9731-9734, 9740-9758, 9760-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9699,9702-9729")
        mycosis = functions.GEN_INLIST(hist4c, "9700,9701")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if (!(kaposi || hematop || lympho || mycosis || brain || othcns || othill)) {
            if (rnp >= 1 && rnp <= 97) {
                if (!(functions.GEN_MATCH(untrimmedline.eodLymphNodeInvolv, "([1-8])")))
                    return functions.GEN_ERROR_MSG(binding, 'If Regional Nodes Positive = 01-97, EOD--Lymph Node Involv must = 1-8')
            }
        }
        return true

    }

    // ID: RQRS-01396; TAG: N0616; NAME: EOD--Old 13 digit (SEER)
    public boolean rqrs01396(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodOld13Digit))
            return true
        if (!functions.GEN_MATCH(untrimmedline.eodOld13Digit, "(((\\d)|(\\s)|(&)|(\\-))*)"))
            return false
        
        return true

    }

    // ID: RQRS-01397; TAG: N0317; NAME: EOD--Old 13 digit, Primary Site (SEER IF2613DG)
    public boolean rqrs01397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int j, k, l, m, skip2, cc, t
        char[] c1 = new char[2], idxi = new char[5], cl212 = new char[3]
        char[] idxa = new char[4], fillerb = new char[100], idxb1 = new char[100], idxb2 = new char[100], idxb3 = new char[100], idxb4 = new char[100], field13i = new char[100]
        
        if (functions.GEN_STRCMP(untrimmedline.eodCodingSys, "2") != 0) {
            return true
        }
        if (functions.GEN_MATCH(untrimmedline.primarySite, "(C44[0-7])|(C51[0-2])|(C51[8-9])|(C60[0-1])|(C60[8-9])") && !(functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799", "(\\d\\d\\d\\d)"))) {
            return functions.GEN_ERROR_MSG(binding, 'EOD_2dig & Site conflict')
        }
        if (functions.GEN_MATCH(untrimmedline.primarySite, "(C77[0-5])|(C77[8-9])|(C024)|(C09[8-9])|(C142)|(C379)|(C422)") && !(functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717", "(\\d\\d\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'EOD_2dig & Site conflict')
        if (!(functions.GEN_LOOKUP(untrimmedline.primarySite, context.RQRS_IF2613A1, context.RQRS_IF2613A1_AFIELD1, ['IDXA':idxa]))) {
            return functions.GEN_ERROR_MSG(binding, 'EOD_2dig & Site conflict')
        }
        cc = 8191
        skip2 = 0
        l = 1
        t = 1
        functions.GEN_STRCPY(cl212, functions.GEN_LEFT(untrimmedline.eodOld13Digit, 2), 2)
        
        
        functions.GEN_STRCPY(idxi, functions.GEN_RIGHT(idxa, 2), 2)
        functions.GEN_STRCAT(idxi, functions.GEN_SUBSTR("01020304050607080910111213", l, 2), 2)
        
        functions.GEN_LOOKUP(idxi, context.RQRS_IF2613X, context.RQRS_IF2613X_BFIELD1, ['FILLERB':fillerb, 'IDXB1':idxb1, 'IDXB2':idxb2, 'IDXB3':idxb3, 'IDXB4':idxb4])
        if (functions.GEN_INLIST(fillerb, "C")) {
            if ((functions.GEN_MATCH(cl212, "(\\d\\d)") && functions.GEN_VAL(cl212) < 99) || functions.GEN_STRCMP(idxb1, cl212, 2) == 0 || functions.GEN_STRCMP(idxb2, cl212, 2) == 0 || functions.GEN_STRCMP(idxb3, cl212, 2) == 0 || functions.GEN_STRCMP(idxb4, cl212, 2) == 0) {
                cc = cc - 1
                cc = cc - 2
                t = t * 2
                t = t * 2
                skip2 = 1
            }
            else
                skip2 = 1
        }
        if (skip2 == 0)
            l = 1
        else
            l = 3
        while (l < 9) {
            functions.GEN_STRCPY(c1, functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, l, 1), 1)
            if (functions.GEN_MATCH(c1, "(\\d)"))
                k = functions.GEN_VAL(c1) + 1
            else {
                if (functions.GEN_STRCMP(c1, "-", 1) == 0)
                    k = 11
                else
                    k = 12
            }
            functions.GEN_STRCPY(idxi, functions.GEN_RIGHT(idxa, 2), 2)
            m = ((l - 1) * 2) + 1
            idxi[2] = (char)0
            functions.GEN_STRCAT(idxi, functions.GEN_SUBSTR("01020304050607080910111213", m, 2), 2)
            idxi[4] = (char)0
            functions.GEN_LOOKUP(idxi, context.RQRS_IF2613ST, context.RQRS_IF2613ST_FIELD13, ['FIELD13I':field13i])
            m = functions.GEN_VAL(c1)
            m = functions.GEN_VAL(functions.GEN_SUBSTR(field13i, k, 1))
            if (functions.GEN_STRCMP(c1, functions.GEN_SUBSTR(field13i, k, 1), 1) == 0) {
                cc = cc - t
                t = t * 2
            }
            l = l + 1
        }
        skip2 = 0
        l = 9
        
        functions.GEN_STRCPY(cl212, functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 9, 2), 2)
        
        
        functions.GEN_STRCPY(idxi, functions.GEN_RIGHT(idxa, 2), 2)
        idxi[2] = (char)0
        functions.GEN_STRCAT(idxi, functions.GEN_SUBSTR("01020304050607080910111213", 17, 2), 2)
        idxi[4] = (char)0
        
        functions.GEN_LOOKUP(idxi, context.RQRS_IF2613X, context.RQRS_IF2613X_BFIELD1, ['FILLERB':fillerb, 'IDXB1':idxb1, 'IDXB2':idxb2, 'IDXB3':idxb3, 'IDXB4':idxb4])
        if (functions.GEN_INLIST(fillerb, "C")) {
            if ((functions.GEN_MATCH(cl212, "(\\d\\d)") && functions.GEN_VAL(cl212) < 99) || functions.GEN_STRCMP(idxb1, cl212, 2) == 0 || functions.GEN_STRCMP(idxb2, cl212, 2) == 0 || functions.GEN_STRCMP(idxb3, cl212, 2) == 0 || functions.GEN_STRCMP(idxb4, cl212, 2) == 0) {
                cc = cc - t
                t = t * 2
                cc = cc - t
                t = t * 2
                skip2 = 1
            }
            else
                skip2 = 1
        }
        if (skip2 == 0)
            l = 9
        else
            l = 11
        while (l < 14) {
            functions.GEN_STRCPY(c1, functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, l, 1), 1)
            if (functions.GEN_MATCH(c1, "(\\d)"))
                k = functions.GEN_VAL(c1) + 1
            else {
                if (functions.GEN_STRCMP(c1, "-", 1) == 0)
                    k = 11
                else
                    k = 12
            }
            functions.GEN_STRCPY(idxi, functions.GEN_RIGHT(idxa, 2), 2)
            m = ((l - 1) * 2) + 1
            idxi[2] = (char)0
            functions.GEN_STRCAT(idxi, functions.GEN_SUBSTR("01020304050607080910111213", m, 2), 2)
            idxi[4] = (char)0
            functions.GEN_LOOKUP(idxi, context.RQRS_IF2613ST, context.RQRS_IF2613ST_FIELD13, ['FIELD13I':field13i])
            m = functions.GEN_VAL(c1)
            m = functions.GEN_VAL(functions.GEN_SUBSTR(field13i, k, 1))
            if (functions.GEN_STRCMP(c1, functions.GEN_SUBSTR(field13i, k, 1), 1) == 0) {
                cc = cc - t
                t = t * 2
            }
            l = l + 1
        }
        if (cc > 0) {
            return false
        }
        if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C77[0-5])|(C77[8-9])|(C024)|(C09[8-9])|(C142)|(C379)|(C422)")) && !(functions.GEN_MATCH(untrimmedline.primarySite, "(C34[0-3])|(C34[8-9])")) && !(functions.GEN_MATCH(untrimmedline.primarySite, "(C44[0-7])|(C51[0-2])|(C51[8-9])|(C60[0-1])|(C60[8-9])") && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799", "(\\d\\d\\d\\d)"))) {
            if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2", 1) == 0) {
                if (!(functions.GEN_STRCMP(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 5, 1), "0", 1) == 0))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
            else {
                if ((functions.GEN_STRCMP(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 5, 1), "0", 1) == 0))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
        }
        if (functions.GEN_MATCH(untrimmedline.primarySite, "(C34[0-3])|(C34[8-9])")) {
            if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2", 1) == 0) {
                if (!(functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 4, 2), "01,10")))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
            else {
                if ((functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 4, 2), "(00)")))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
        }
        if (functions.GEN_MATCH(untrimmedline.primarySite, "(C44[0-7])|(C51[0-2])|(C51[8-9])|(C60[0-1])|(C60[8-9])")) {
            if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2", 1) == 0) {
                if (!(functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 5, 1), "1")))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
            else {
                if ((functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.eodOld13Digit, 5, 1), "1")))
                    return functions.GEN_ERROR_MSG(binding, 'InSitu Behavior & EOD13dig conflict')
            }
        }
        return true

    }

    // ID: RQRS-01398; TAG: N0318; NAME: EOD--Old 13 digit, Primary Site, Hist (SEER IF01)
    public boolean rqrs01398(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, dx_month
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return true
        }
        if ((dx_year < 1975) || (dx_year > 1982) || (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")))
            return true
        if (dx_year == 1975) {
            if ((functions.GEN_INLIST(untrimmedline.registryId, "01", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.addressAtDxCounty, "075,081")) || !functions.GEN_INLIST(untrimmedline.registryId, "01", "(00000015\\d\\d)", 9, 2)) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180,182-187,199,209", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 2)
                        return true
                    else
                        return false
                }
            }
        }
        if ((dx_year > 1975) && (dx_year < 1983)) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180,182-187,199,209", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 2)
                    return true
                else
                    return false
            }
        }
        if (((dx_year >= 1978) || ((dx_year == 1977) && (dx_month >= 5) && (dx_month != ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)))) && ((functions.GEN_INLIST(untrimmedline.primarySite, "770-779,024,099,111,142,379,422", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698")) || (functions.GEN_INLIST(untrimmedline.primarySite, "440-447,510-519,600-601,608-609", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790")))) {
            if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 2)
                return true
            else
                return false
        }
        if (((dx_year >= 1978) || ((dx_year == 1977) && (dx_month >= 11) && (dx_month != ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)))) && functions.GEN_INLIST(untrimmedline.primarySite, "161-169,341-349,530-539,540-548,619,670-676,678-679", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 2)
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01399; TAG: N0617; NAME: EOD--Old 2 digit (SEER)
    public boolean rqrs01399(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodOld2Digit))
            return true
        if (!functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(((\\d)|(\\s)|(&)|(\\-))*)"))
            return false
        
        return true

    }

    // ID: RQRS-01400; TAG: N0319; NAME: EOD--Old 2 digit, Morphology (SEER IF26NSPC)
    public boolean rqrs01400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_STRCMP(untrimmedline.eodCodingSys, "0") != 0) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(((0)|([4-9])|(&)|(\\-))\\-)")) {
            return functions.GEN_ERROR_MSG(binding, 'EOD_2dig & Site conflict')
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2") == 0 && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "0-") != 0)
            return false /* Error flag 362 */
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "3") == 0 && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "0-") == 0)
            return false /* Error flag 362 */
        return true

    }

    // ID: RQRS-01401; TAG: N3084; NAME: EOD--Old 2 digit, Primary Site (SEER IF262DIG)
    public boolean rqrs01401(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_EOD_Melanoma = new char[3]
        char[] t_PrimarySite_EOD = new char[7]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.eodOld2Digit)) {
            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: EOD--Old 2 Digit (${untrimmedline.eodOld2Digit}) cannot be blank')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "024,099,111,142,379,422,770-779", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-447,510-519,600,601,608,609", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790")) {
            functions.GEN_STRCPY(t_EOD_Melanoma, functions.GEN_TRIM(untrimmedline.eodOld2Digit, ((Integer)context.RQRS_GEN_RIGHT)))
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD_OLD_2_DIGIT_MELANOMA, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD_OLD_2_DIGIT_MELANOMA_EOD_OLD_2_DIG_CODE, t_EOD_Melanoma, [:]))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Melanoma - Conflict among Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
            else
                functions.GEN_NOOP()
        }
        else {
            functions.GEN_STRCPY(t_PrimarySite_EOD, untrimmedline.primarySite)
            functions.GEN_STRCAT(t_PrimarySite_EOD, functions.GEN_TRIM(untrimmedline.eodOld2Digit, ((Integer)context.RQRS_GEN_RIGHT)))
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD_OLD_2_DIGIT, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD_OLD_2_DIGIT_SITEEOD_OLD_2_DIG_CODE, t_PrimarySite_EOD, [:]))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Conflict between Primary Site (${untrimmedline.primarySite}) and EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "171,172,180-189,199,209", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(01)|(02)|(0\\-)"))
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Conflict among Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
            }
            else {
                if (!functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0\\-)"))
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Conflict among Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "171,172,180-189,199,209", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(01)|(02)|(0\\-)"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Conflict among Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
                }
                else {
                    if (functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0\\-)"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 2 Digit: Conflict among Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 2 Digit (${untrimmedline.eodOld2Digit})')
                }
            }
        }
        return true

    }

    // ID: RQRS-01402; TAG: N3106; NAME: EOD--Old 4 digit (SEER IF264DIG_P1)
    public boolean rqrs01402(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.eodOld4Digit, "(((\\s\\s)|(\\d\\d))((\\s)|(\\d))((\\s)|(\\d)))")

    }

    // ID: RQRS-01403; TAG: N3101; NAME: EOD--Old 4 digit_2, Size (SEER IF264DIG_P2)
    public boolean rqrs01403(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] EOD4TumorSize = new char[3]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3")) {
            return true
        }
        functions.GEN_STRCPY(EOD4TumorSize, functions.GEN_SUBSTR(untrimmedline.eodOld4Digit, 1, 2))
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(EOD4TumorSize, "99"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: DCO, EOD-4 Tumor Size must be 99')
        }
        if (!functions.GEN_INLIST(EOD4TumorSize, "00-99", "(\\d\\d)")) {
            return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9714,9740-9741,9800-9970", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(EOD4TumorSize, "99"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between leukemia/lymphoma Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "189", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8219,8221-9999")) {
                if (!functions.GEN_INLIST(EOD4TumorSize, "00-97,99"))
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8220")) {
                    if (!functions.GEN_INLIST(EOD4TumorSize, "00-98,99"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    else
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-424", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-9999")) {
                    if (!functions.GEN_INLIST(EOD4TumorSize, "99"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    else
                        return true
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-9699,9702-9999")) {
                        if (!functions.GEN_INLIST(EOD4TumorSize, "00-97,99"))
                            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                        else
                            return true
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9700-9701")) {
                            if (!functions.GEN_INLIST(EOD4TumorSize, "99"))
                                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                            else
                                return true
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-148,170-259,300-340,379-388,400-479,490-499,510-559,570-759", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(EOD4TumorSize, "00-97,99"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-169,341-349,500-509", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_INLIST(EOD4TumorSize, "00-98,99"))
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "569", "(C\\d\\d\\d)", 2, 3)) {
                    if (!functions.GEN_INLIST(EOD4TumorSize, "00-03,99"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    else
                        return true
                }
                else {
                    if (!functions.GEN_INLIST(EOD4TumorSize, "99"))
                        return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    else
                        return true
                }
            }
        }
        
        return true

    }

    // ID: RQRS-01404; TAG: N3102; NAME: EOD--Old 4 digit_3, Extension-In Situ (SEER IF264DIG_P3)
    public boolean rqrs01404(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_sitelowhigh_histlow = new char[20]
        char[] EOD4Extension = new char[2]
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], EXT_INSITU = new char[2], EXT = new char[21]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
            return true
        }
        functions.GEN_STRCPY(EOD4Extension, functions.GEN_SUBSTR(untrimmedline.eodOld4Digit, 3, 1))
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(EOD4Extension, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: DCO, EOD-4 Extension must be 9')
        }
        if (!functions.GEN_INLIST(EOD4Extension, "0-9", "(\\d)")) {
            return false
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_EXT, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_EXT_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'EXT_INSITU':EXT_INSITU])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(t_sitelowhigh_histlow, SITELOW)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, SITEHIGH)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, untrimmedline.histologyIcdO2)
        
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_EXT, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_EXT_SITELOWSITEHIGHHISTLOW, t_sitelowhigh_histlow, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'EXT_INSITU':EXT_INSITU])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                        if (functions.GEN_AT(EOD4Extension, EXT_INSITU) != 0)
                            return true
                        else
                            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    }
                }
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITE_EXT_INSITU, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITE_EXT_INSITU_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'EXT':EXT])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                if (functions.GEN_AT(EOD4Extension, EXT) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        return true

    }

    // ID: RQRS-01405; TAG: N3103; NAME: EOD--Old 4 digit_4, Extension-Malig (SEER IF264DIG_P4)
    public boolean rqrs01405(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_sitelowhigh_histlow = new char[20]
        char[] EOD4Extension = new char[2]
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], EXT_MALIG = new char[21], EXT = new char[21]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
            return true
        }
        functions.GEN_STRCPY(EOD4Extension, functions.GEN_SUBSTR(untrimmedline.eodOld4Digit, 3, 1))
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(EOD4Extension, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: DCO, EOD-4 Extension must be 9')
        }
        if (!functions.GEN_INLIST(EOD4Extension, "0-9")) {
            return false
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_LEUK_HIST_EXT_MALIG, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_LEUK_HIST_EXT_MALIG_HISTLOW, untrimmedline.histologyIcdO2, ['HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'EXT_MALIG':EXT_MALIG])) {
            if (functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                if (functions.GEN_AT(EOD4Extension, EXT_MALIG) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between leukemia/lymphoma Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_EXT, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_EXT_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'EXT_MALIG':EXT_MALIG])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(t_sitelowhigh_histlow, SITELOW)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, SITEHIGH)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, untrimmedline.histologyIcdO2)
        
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_EXT, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_EXT_SITELOWSITEHIGHHISTLOW, t_sitelowhigh_histlow, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'EXT_MALIG':EXT_MALIG])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                        if (functions.GEN_AT(EOD4Extension, EXT_MALIG) != 0)
                            return true
                        else
                            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    }
                }
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITE_EXT_MALIG, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITE_EXT_MALIG_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'EXT':EXT])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                if (functions.GEN_AT(EOD4Extension, EXT) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        return true

    }

    // ID: RQRS-01406; TAG: N3104; NAME: EOD--Old 4 digit_5, LymphNodes-In Situ (SEER IF264DIG_P5)
    public boolean rqrs01406(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_sitelowhigh_histlow = new char[20]
        char[] EOD4LymphNodes = new char[2]
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], LN_INSITU = new char[2], LN = new char[2]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
            return true
        }
        functions.GEN_STRCPY(EOD4LymphNodes, functions.GEN_SUBSTR(untrimmedline.eodOld4Digit, 4, 1))
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(EOD4LymphNodes, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: DCO, EOD-4 Lymph Nodes must be 9')
        }
        if (!functions.GEN_INLIST(EOD4LymphNodes, "0-9", "(\\d)")) {
            return false
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_LN, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_LN_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'LN_INSITU':LN_INSITU])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(t_sitelowhigh_histlow, SITELOW)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, SITEHIGH)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, untrimmedline.histologyIcdO2)
        
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_LN, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_LN_SITELOWSITEHIGHHISTLOW, t_sitelowhigh_histlow, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'LN_INSITU':LN_INSITU])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                        if (functions.GEN_AT(EOD4LymphNodes, LN_INSITU) != 0)
                            return true
                        else
                            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    }
                }
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITE_LN_INSITU, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITE_LN_INSITU_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'LN':LN])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                if (functions.GEN_AT(EOD4LymphNodes, LN) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        return true

    }

    // ID: RQRS-01407; TAG: N3105; NAME: EOD--Old 4 digit_6, LymphNodes-Malig (SEER IF264DIG_P6)
    public boolean rqrs01407(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_sitelowhigh_histlow = new char[20]
        char[] EOD4LymphNodes = new char[2]
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], LN_MALIG = new char[21], LN = new char[21]
        
        if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "3")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
            return true
        }
        functions.GEN_STRCPY(EOD4LymphNodes, functions.GEN_SUBSTR(untrimmedline.eodOld4Digit, 4, 1))
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(EOD4LymphNodes, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: DCO, EOD-4 Lymph Nodes must be 9')
        }
        if (!functions.GEN_INLIST(EOD4LymphNodes, "0-9")) {
            return false
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_LEUK_HIST_LN_MALIG, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_LEUK_HIST_LN_MALIG_HISTLOW, untrimmedline.histologyIcdO2, ['HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'LN_MALIG':LN_MALIG])) {
            if (functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                if (functions.GEN_AT(EOD4LymphNodes, LN_MALIG) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between leukemia/lymphoma Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}) and EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_LN, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_LN_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'LN_MALIG':LN_MALIG])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(t_sitelowhigh_histlow, SITELOW)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, SITEHIGH)
                functions.GEN_STRCAT(t_sitelowhigh_histlow, untrimmedline.histologyIcdO2)
        
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITEHIST_LN, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITEHIST_LN_SITELOWSITEHIGHHISTLOW, t_sitelowhigh_histlow, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'LN_MALIG':LN_MALIG])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, HISTHIGH) <= 0) {
                        if (functions.GEN_AT(EOD4LymphNodes, LN_MALIG) != 0)
                            return true
                        else
                            return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Histology (92-00) ICD-O-2 (${untrimmedline.histologyIcdO2}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
                    }
                }
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EOD4_SITE_LN_MALIG, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EOD4_SITE_LN_MALIG_SITELOW, untrimmedline.primarySite, ['SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'LN':LN])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                if (functions.GEN_AT(EOD4LymphNodes, LN) != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'EOD--Old 4 Digit: Conflict between Primary Site (${untrimmedline.primarySite}), Behavior (92-00) ICD-O-2 (${untrimmedline.behaviorIcdO2}), EOD--Old 4 Digit (${untrimmedline.eodOld4Digit})')
            }
        }
        return true

    }

    // ID: RQRS-01408; TAG: N0431; NAME: EOD--Reg Nodes Ex,ReNodes Pos, Site, ICDO2 (NAACCR)
    public boolean rqrs01408(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int beh, lymflg, rnp, rne, year
        boolean kaposi, hematop, lympho, brain, othcns, othill
        char[] hist4c = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year < 1998) || (dx_year > 2000))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesPositive, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must be numeric (00-90, 95-99)')
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesExamined, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Examined must be a two-digit number')
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO2, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO2')
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        beh = functions.GEN_VAL(untrimmedline.behaviorIcdO2)
        
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, Regional Nodes Positive and Examined must both = 99')
            else
                return true
        }
        functions.GEN_STRCPY(hist4c, untrimmedline.histologyIcdO2)
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9720-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9698,9702-9717")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if ((brain || othcns || othill || hematop || lympho) && (!kaposi)) {
            if ((rnp != 99) || (rne != 99))
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive and Examined must both = 99 for this site/histology')
        }
        if (beh == 2) {
            if (rnp != 0 && rnp != 98)
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must = 00 or 98 for in situ cases')
        }
        if (beh == 2) {
            if (rne > 98)
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Examined cannot be greater than 98 for in situ cases')
        }
        if (rne == 0 && rnp != 98)
            return false
        else {
            if (rne >= 1 && rne <= 89) {
                if (rnp == 97 || rnp == 99 || rnp <= rne)
                    return true
                else
                    return false
            }
            else {
                if (rne == 96 || rne == 97 || rne == 98) {
                    if ((rnp >= 0 && rnp <= 97) || (rnp == 99))
                        return true
                    else
                        return false
                }
                else {
                    if (rne == 90) {
                        if (rnp == 97 || rnp == 99 || rnp <= 96)
                            return true
                        else
                            return false
                    }
                    else {
                        if (rne == 99) {
                            if (rnp == 99)
                                return true
                            else
                                return false
                        }
                        else {
                            if (rne == 95) {
                                if (rnp == 0 || rnp == 95 || rnp == 99)
                                    return true
                                else
                                    return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01409; TAG: N0461; NAME: EOD--Reg Nodes Ex,ReNodes Pos, Site, ICDO3 (NAACCR)
    public boolean rqrs01409(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int beh, lymflg, rnp, rne, year
        boolean kaposi, hematop, lympho, brain, othcns, othill
        char[] hist4c = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998 || dx_year > 2003)
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3"))
            return true
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesPositive, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must be numeric (00-90, 95-99)')
        if (!(functions.GEN_MATCH(untrimmedline.regionalNodesExamined, "(\\d\\d)")))
            return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Examined must be a two-digit number')
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        beh = functions.GEN_VAL(untrimmedline.behaviorIcdO3)
        
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, Regional Nodes Positive and Examined must both = 99')
            else
                return true
        }
        functions.GEN_STRCPY(hist4c, untrimmedline.histologyIcdO3)
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9731-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9699,9702-9729")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if ((brain || othcns || othill || hematop || lympho) && (!kaposi)) {
            if ((rnp != 99) || (rne != 99))
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive and Examined must both = 99 for this site/histology')
        }
        if (beh == 2) {
            if (rnp != 0 && rnp != 98)
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive must = 00 or 98 for in situ cases')
        }
        if (beh == 2) {
            if (rne > 98)
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Examined cannot be greater than 98 for in situ cases')
        }
        if (rne == 0 && rnp != 98)
            return false
        else {
            if (rne >= 1 && rne <= 89) {
                if (rnp == 97 || rnp == 99 || rnp <= rne)
                    return true
                else
                    return false
            }
            else {
                if (rne == 96 || rne == 97 || rne == 98) {
                    if ((rnp >= 0 && rnp <= 97) || (rnp == 99))
                        return true
                    else
                        return false
                }
                else {
                    if (rne == 90) {
                        if (rnp == 97 || rnp == 99 || rnp <= 96)
                            return true
                        else
                            return false
                    }
                    else {
                        if (rne == 99) {
                            if (rnp == 99)
                                return true
                            else
                                return false
                        }
                        else {
                            if (rne == 95) {
                                if (rnp == 0 || rnp == 95 || rnp == 99)
                                    return true
                                else
                                    return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01410; TAG: N2364; NAME: EOD--Tumor Size, Primary Site, ICDO3 (NAACCR)
    public boolean rqrs01410(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.eodTumorSize) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year < 1998) || (dx_year > 2003))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3"))
            return true
        if (!functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Primary Site not valid')
        if (!functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(\\d\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "999"))
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, EOD--Tumor Size must = 999')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "001-002,999", "(\\d\\d\\d)"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9734,9760-9989")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "999"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-003,999", "(\\d\\d\\d)"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-506,508-509", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,997-999", "(\\d\\d\\d)"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "150-155,158-159,160-166,168-169,340-343,348-349", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,998-999", "(\\d\\d\\d)"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8220-8221")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,998-999", "(\\d\\d\\d)"))
                return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            else
                return true
        }
        if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,999", "(\\d\\d\\d)"))
            return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
        else
            return true
        return true

    }

    // ID: RQRS-01411; TAG: N2732; NAME: Esophagus and EGJ Tumor Epicenter, Date DX (NAACCR)
    public boolean rqrs01411(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Esophagus and EGJ Tumor Epicenter must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter))
            return true
        if (functions.GEN_AT(untrimmedline.esophagusAndEgjTumorEpicenter, "0129", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.esophagusAndEgjTumorEpicenter} not valid code for Esophagus and EGJ Tumor Epicenter')
        return true

    }

    // ID: RQRS-01412; TAG: N2856; NAME: Esophagus and EGJ Tumor Epicenter, Schema ID, Required (NAACCR)
    public boolean rqrs01412(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00161", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter))
                return false
        }
        return true

    }

    // ID: RQRS-01413; TAG: N2677; NAME: Estrogen Receptor Percent Positive or Range, Date DX (NAACCR)
    public boolean rqrs01413(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_NOOP()
        
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Estrogen Receptor Percent Positive or Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorPercentPositiveOrRange, "R10R20R30R40R50R60R70R80R90R99XX8XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.estrogenReceptorPercentPositiveOrRange, "000-100", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.estrogenReceptorPercentPositiveOrRange} not valid code for Estrogen Receptor Percent Positive or Range')
        return true

    }

    // ID: RQRS-01414; TAG: N2876; NAME: Estrogen Receptor Percent Positive or Range, Schema ID, Required (NAACCR)
    public boolean rqrs01414(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange) || functions.GEN_AT(untrimmedline.estrogenReceptorPercentPositiveOrRange, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01415; TAG: N3913; NAME: Estrogen Receptor Percent Positive or Range, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange) || functions.GEN_AT(untrimmedline.estrogenReceptorPercentPositiveOrRange, "XX8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01417; TAG: N2877; NAME: Estrogen Receptor Summary, Schema ID, Required (NAACCR)
    public boolean rqrs01417(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
                return false
        }
        return true

    }

    // ID: RQRS-01418; TAG: N2678; NAME: Estrogen Receptor Total Allred Score, Date DX (NAACCR)
    public boolean rqrs01418(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Estrogen Receptor Total Allred Score must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorTotalAllredScore, "000102030405060708X8X9", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.estrogenReceptorTotalAllredScore} not valid code for Estrogen Receptor Total Allred Score')
        return true

    }

    // ID: RQRS-01419; TAG: N2878; NAME: Estrogen Receptor Total Allred Score, Schema ID, Required (NAACCR)
    public boolean rqrs01419(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore) || functions.GEN_AT(untrimmedline.estrogenReceptorTotalAllredScore, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01420; TAG: N3914; NAME: Estrogen Receptor Total Allred Score, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore) || functions.GEN_AT(untrimmedline.estrogenReceptorTotalAllredScore, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01421; TAG: N0120; NAME: EthnSrc, Date of Diag (SEER IF72)
    public boolean rqrs01421(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1993) {
            if (functions.GEN_EMPTY(untrimmedline.computedEthnicitySource))
                return false
            else
                return true
        }
        
        return true

    }

    // ID: RQRS-01422; TAG: N2365; NAME: Extent of Disease 12-Digit ICDO3 (SEER IF26E98)
    public boolean rqrs01422(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int hist4, i, j, n, beh, n_site_idx, extflg, lymflg, nodflg, rnp, rne, tsz, dx_year, pextflg
        int site, pext, mycosis
        boolean kaposi, hematop, lympho, brain, othcns, othill
        char[] c_site_idx = new char[4], hist4c = new char[5], idxxx1 = new char[3]
        
        int LNflg
        
        char[] W_SiteExt = new char[7], W_HistExt = new char[7]
        
        char[] W_SiteLN = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_STRCMP(untrimmedline.eodCodingSys, "4") != 0 || (dx_year < 1998) || dx_year > 2003)
            return true
        if (functions.GEN_EMPTY(untrimmedline.morphologyIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,2,3")) {
            return true
        }
        if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)")) || !(functions.GEN_MATCH(untrimmedline.morphologyIcdO3, "(\\d\\d\\d\\d1)|(\\d\\d\\d\\d2)|(\\d\\d\\d\\d3)")))
            return functions.GEN_ERROR_MSG(binding, 'Catastropic Error in IF2610DG - ICDO3')
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        tsz = functions.GEN_VAL(untrimmedline.eodTumorSize)
        pext = functions.GEN_VAL(untrimmedline.eodExtensionProstPath)
        
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C619)"))) {
                if ((tsz != 999) || (functions.GEN_VAL(untrimmedline.eodExtension) != 99) || (functions.GEN_VAL(untrimmedline.eodLymphNodeInvolv) != 9) || (rne != 99) || (rnp != 99) || (!functions.GEN_EMPTY(untrimmedline.eodExtensionProstPath)))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Type of Reporting Source and EOD 12 digit conflict')
                return true
            }
            else {
                if ((tsz != 999) || (functions.GEN_VAL(untrimmedline.eodExtension) != 90) || (functions.GEN_VAL(untrimmedline.eodLymphNodeInvolv) != 9) || (rne != 99) || (rnp != 99) || (pext != 90))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Type of Reporting Source and EOD 12 digit conflict')
                return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729")) {
            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "001-002,999", "(\\d\\d\\d)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9734,9760-9989")) {
                if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-003,999", "(\\d\\d\\d)"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "500-506,508-509", "(C\\d\\d\\d)", 2, 3)) {
                        if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,997-999", "(\\d\\d\\d)"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "150-155,158-159,160-166,168-169,340-343,348-349", "(C\\d\\d\\d)", 2, 3)) {
                            if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,998-999", "(\\d\\d\\d)"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8220-8221")) {
                                if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,998-999", "(\\d\\d\\d)"))
                                    return functions.GEN_ERROR_MSG(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
                            }
                            else {
                                if (!functions.GEN_INLIST(untrimmedline.eodTumorSize, "000-990,999", "(\\d\\d\\d)")) {
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD--Tumor Size invalid for this site/histology/behavior')
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729,9731-9989")) {
                if (!functions.GEN_EMPTY(untrimmedline.eodExtension))
                    extflg = 1
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632,690, 691-694,698-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodExtension, "00"))
                        extflg = 1
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                        if (!functions.GEN_EMPTY(untrimmedline.eodExtension))
                            extflg = 1
                    }
                    else {
                        functions.GEN_STRCPY(W_SiteExt, untrimmedline.primarySite)
                        functions.GEN_STRCAT(W_SiteExt, untrimmedline.eodExtension)
                        if (!functions.GEN_ILOOKUP(W_SiteExt, context.RQRS_EXT03INS, context.RQRS_EXT03INS_SITEEXT, [:]))
                            extflg = 1
                    }
                }
            }
            if (extflg == 1)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'In Situ EOD--Extension invalid for this site/histology/behavior')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,3")) {
        
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140")) {
                if (!functions.GEN_INLIST(untrimmedline.eodExtension, "11,12,13,21,22,23,24,25,26,27,29,99"))
                    extflg = 1
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729")) {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.eodExtension, "10,11"))
                        extflg = 1
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,11,20,21,30,31,32,33,80,99"))
                            extflg = 1
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992")) {
                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,80,99"))
                            extflg = 1
                        else {
                            if (functions.GEN_INLIST(untrimmedline.eodExtension, "10") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731,9734,9740,9750-9752,9755-9758,9764,9930"))
                                extflg = 1
                            else {
                                if (functions.GEN_INLIST(untrimmedline.eodExtension, "80") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751,9752"))
                                    extflg = 1
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.eodExtension, "99") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731,9734,9740,9750-9758,9764,9930"))
                                        extflg = 1
                                }
                            }
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                            if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,11,20,21,30,31,40,41,50,51,60,62,64,70,80,85,87,99"))
                                extflg = 1
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,20,30,70,80,85,99"))
                                    extflg = 1
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "691-694,698,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                    if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,17,20,25,30,40,43,44,45,50,55,56,70,80,85,99"))
                                        extflg = 1
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                                        if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,12,15,30,40,45,48,50,55,60,70,72,75,80,85,99"))
                                            extflg = 1
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                                            if (!functions.GEN_INLIST(untrimmedline.eodExtension, "10,20,25,30,50,70,85,99"))
                                                extflg = 1
                                        }
                                        else {
                                            functions.GEN_STRCPY(W_SiteExt, untrimmedline.primarySite)
                                            functions.GEN_STRCAT(W_SiteExt, untrimmedline.eodExtension)
                                            if (!functions.GEN_ILOOKUP(W_SiteExt, context.RQRS_EXT3SITM, context.RQRS_EXT3SITM_SITEEXT, [:]))
                                                extflg = 1
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (extflg == 1) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Malignant EOD--Extension invalid for this site/histology/behavior')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729,9731-9989")) {
                if (!functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
                    LNflg = 1
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632,690,691-694,698-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0"))
                        LNflg = 1
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                        if (!functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
                            LNflg = 1
                    }
                    else {
                        functions.GEN_STRCPY(W_SiteLN, untrimmedline.primarySite)
                        functions.GEN_STRCAT(W_SiteLN, untrimmedline.eodLymphNodeInvolv)
                        if (!functions.GEN_ILOOKUP(W_SiteLN, context.RQRS_LN03INS, context.RQRS_LN03INS_SITE_LN, [:]))
                            LNflg = 1
                    }
                }
            }
            if (LNflg == 1)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'In Situ EOD--Lymph Node Involvement invalid for this site/histology/behavior')
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "1,3")) {
        
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9590-9699,9702-9729")) {
                if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,2,3,9"))
                    LNflg = 1
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992")) {
                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "9"))
                        LNflg = 1
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                        if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0-5,7-9"))
                            LNflg = 1
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                            if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                LNflg = 1
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "691-694,698,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790")) {
                                if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                    LNflg = 1
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514")) {
                                    if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0,1,7-9"))
                                        LNflg = 1
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9700-9701")) {
                                        if (!functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0-3,9"))
                                            LNflg = 1
                                    }
                                    else {
                                        functions.GEN_STRCPY(W_SiteLN, untrimmedline.primarySite)
                                        functions.GEN_STRCAT(W_SiteLN, untrimmedline.eodLymphNodeInvolv)
                                        if (!functions.GEN_ILOOKUP(W_SiteLN, context.RQRS_LN03MAL, context.RQRS_LN03MAL_SITE_LN, [:]))
                                            LNflg = 1
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (LNflg == 1) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Malignant EOD--Lymph Node Involvement invalid for this site/histology/behavior')
        }
        functions.GEN_STRCPY(hist4c, untrimmedline.histologyIcdO3)
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9731-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9699,9702-9729")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if (!(kaposi || hematop || lympho || mycosis || brain || othcns || othill)) {
            if (rnp >= 1 && rnp <= 97) {
                if (!(functions.GEN_MATCH(untrimmedline.eodLymphNodeInvolv, "([1-8])")))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Regional Nodes Positive = 01-97, EOD--Lymph Node Involv must = 1-8')
            }
        }
        if ((brain || othcns || othill || hematop || lympho) && (!kaposi)) {
            if ((rnp != 99) || (rne != 99))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive and Examined must both = 99 for this site/histology')
        }
        else {
            if (beh == 2) {
                if (rnp != 0 && rnp != 98)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive must = 00 or 98 for in situ cases')
            }
        }
        if (beh == 2) {
            if (rne > 98)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined cannot be greater than 98 for in situ cases')
        }
        if (rne == 0 && rnp != 98)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive/Examined conflict')
        else {
            if (rne >= 1 && rne <= 89) {
                if (rnp == 97 || rnp == 99 || rnp <= rne)
                    functions.GEN_NOOP()
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive/Examined conflict')
            }
            else {
                if (rne == 96 || rne == 97 || rne == 98) {
                    if ((rnp >= 0 && rnp <= 97) || (rnp == 99))
                        functions.GEN_NOOP()
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive/Examined conflict')
                }
                else {
                    if (rne == 90) {
                        if (rnp == 97 || rnp == 99 || rnp <= 96)
                            functions.GEN_NOOP()
                        else
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive/Examined conflict')
                    }
                    else {
                        if (rne == 99) {
                            if (rnp == 99)
                                functions.GEN_NOOP()
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive/Examined conflict')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01423; TAG: N3002; NAME: Extranodal Extension Clin (non-Head and Neck), Date DX (NAACCR)
    public boolean rqrs01423(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.extranodalExtensionClin} not valid code for Extranodal Extension Clin (non-Head and Neck)')
        return true

    }

    // ID: RQRS-01424; TAG: N3003; NAME: Extranodal Extension Clin (non-Head and Neck), Schema ID, Required (NAACCR)
    public boolean rqrs01424(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01425; TAG: N3915; NAME: Extranodal Extension Clin (non-Head and Neck), Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01425(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01426; TAG: N2729; NAME: Extranodal Extension Head and Neck Clinical, Date DX (NAACCR)
    public boolean rqrs01426(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Head and Neck Clinical must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.extranodalExtensionHeadAndNeckClinical} not valid code for Extranodal Extension Head and Neck Clinical')
        return true

    }

    // ID: RQRS-01427; TAG: N3000; NAME: Extranodal Extension Head and Neck Clinical, Schema ID, Required (NAACCR)
    public boolean rqrs01427(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[140]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01428; TAG: N3916; NAME: Extranodal Extension Head and Neck Clinical, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[140]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01429; TAG: N2730; NAME: Extranodal Extension Head and Neck Pathological, Date DX (NAACCR)
    public boolean rqrs01429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ENE = new char[3]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Head and Neck Pathological must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 2, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Head and Neck Pathological must be right justified with one decimal place')
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 3, 1))
        
        if (functions.GEN_AT(ENE, "X1X2X3X4X7X8X9", 2) == 0 && !functions.GEN_MATCH(ENE, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.extranodalExtensionHeadAndNeckPathological} not valid code for Extranodal Extension Head and Neck Pathological')
        return true

    }

    // ID: RQRS-01430; TAG: N3001; NAME: Extranodal Extension Head and Neck Pathological, Schema ID, Required (NAACCR)
    public boolean rqrs01430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[140]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckPathological, "X.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01431; TAG: N3004; NAME: Extranodal Extension Path (non-Head and Neck), Date DX (NAACCR)
    public boolean rqrs01431(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Path (non-Head and Neck) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.extranodalExtensionPath} not valid code for Extranodal Extension Path (non-Head and Neck)')
        return true

    }

    // ID: RQRS-01432; TAG: N3005; NAME: Extranodal Extension Path (non-Head and Neck), Schema ID, Required (NAACCR)
    public boolean rqrs01432(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01433; TAG: N3917; NAME: Extranodal Extension Path (non-Head and Neck), Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01433(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01434; TAG: N2667; NAME: Extravascular Matrix Patterns, Date DX (NAACCR)
    public boolean rqrs01434(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extravascular Matrix Patterns must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns))
            return true
        if (functions.GEN_AT(untrimmedline.extravascularMatrixPatterns, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.extravascularMatrixPatterns} not valid code for Extravascular Matrix Patterns')
        return true

    }

    // ID: RQRS-01435; TAG: N2954; NAME: Extravascular Matrix Patterns, Schema ID, Required (NAACCR)
    public boolean rqrs01435(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns) || functions.GEN_AT(untrimmedline.extravascularMatrixPatterns, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01436; TAG: N3918; NAME: Extravascular Matrix Patterns, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01436(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns) || functions.GEN_AT(untrimmedline.extravascularMatrixPatterns, "8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01438; TAG: N2955; NAME: Fibrosis Score, Schema ID, Required (NAACCR)
    public boolean rqrs01438(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00220 00230 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.fibrosisScore) || functions.GEN_AT(untrimmedline.fibrosisScore, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01439; TAG: N3920; NAME: Fibrosis Score, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01439(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00220 00230 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.fibrosisScore) || functions.GEN_AT(untrimmedline.fibrosisScore, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01440; TAG: N3030; NAME: FIGO Stage, Behavior (NAACCR)
    public boolean rqrs01440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[70]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 00530 00541 00542 00551 00552 00553 00560 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage) || functions.GEN_AT(untrimmedline.figoStage, "98") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0 || functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.figoStage, "97", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'FIGO Stage: ${untrimmedline.figoStage} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.figoStage, "97") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'FIGO Stage: ${untrimmedline.figoStage} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
        }
        return true

    }

    // ID: RQRS-01441; TAG: N2879; NAME: FIGO Stage, Date DX (NAACCR)
    public boolean rqrs01441(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.figoStage))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'FIGO Stage must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.figoStage))
            return true
        if (!functions.GEN_INLIST(untrimmedline.figoStage, "01-11, 20-24, 30-42, 97-99", "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.figoStage} not valid code for FIGO Stage')
        return true

    }

    // ID: RQRS-01442; TAG: N2624; NAME: FIGO Stage, Schema ID, Required (NAACCR)
    public boolean rqrs01442(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[70]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 00530 00541 00542 00551 00552 00553 00560 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.figoStage) || functions.GEN_AT(untrimmedline.figoStage, "98") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01443; TAG: N0212; NAME: Following Registry (NAACCR)
    public boolean rqrs01443(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.followingRegistry, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")

    }

    // ID: RQRS-01444; TAG: N0578; NAME: Following Registry, Date of Diagnosis (COC)
    public boolean rqrs01444(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.followingRegistry))
                return false
        }
        return true

    }

    // ID: RQRS-01445; TAG: N0325; NAME: Follow-Up Contact--City (SEER)
    public boolean rqrs01445(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactCity))
            return true
        return functions.GEN_MATCH(untrimmedline.followUpContactCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: RQRS-01446; TAG: N1669; NAME: Followup Contact--Country (NAACCR)
    public boolean rqrs01446(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followupContactCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.followupContactCountry, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: RQRS-01447; TAG: N1687; NAME: Followup Contact--Country, Date of Diag (NAACCR)
    public boolean rqrs01447(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.followupContactCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.followupContactCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.followupContactCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.followupContactCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: RQRS-01448; TAG: N0329; NAME: Follow-Up Contact--Name (SEER)
    public boolean rqrs01448(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactName))
            return true
        return functions.GEN_MATCH(untrimmedline.followUpContactName, "([A-Za-z]((\\-)|([A-Za-z])|(\\s))*)")

    }

    // ID: RQRS-01449; TAG: N0328; NAME: Follow-Up Contact--No/St (SEER)
    public boolean rqrs01449(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactNoAndStreet)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.followUpContactNoAndStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactNoAndStreet))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.followUpContactNoAndStreet, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.followUpContactNoAndStreet, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.RQRS_STREET, context.RQRS_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: RQRS-01450; TAG: N0327; NAME: Follow-Up Contact--Postal (SEER)
    public boolean rqrs01450(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactPostal))
            return true
        return functions.GEN_MATCH(untrimmedline.followUpContactPostal, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")

    }

    // ID: RQRS-01451; TAG: N0326; NAME: Follow-Up Contact--State (SEER)
    public boolean rqrs01451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactState))
            return true
        return functions.GEN_LOOKUP(untrimmedline.followUpContactState, context.RQRS_STATE, context.RQRS_STATE_CODE, [:])

    }

    // ID: RQRS-01452; TAG: N0539; NAME: Follow-Up Contact--Suppl (SEER)
    public boolean rqrs01452(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactSuppl))
            return true /* must be left justified */
        if (!functions.GEN_MATCH(untrimmedline.followUpContactSuppl, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.followUpContactSuppl))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.followUpContactSuppl, ((Integer)context.RQRS_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.followUpContactSuppl, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.RQRS_STREET, context.RQRS_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: RQRS-01453; TAG: N0213; NAME: Follow-Up Source (COC)
    public boolean rqrs01453(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpSource))
            return true
        return functions.GEN_INLIST(untrimmedline.followUpSource, "0-5,7-9")

    }

    // ID: RQRS-01454; TAG: N0577; NAME: Follow-Up Source (NAACCR)
    public boolean rqrs01454(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.followUpSource, "0-5,7-9")

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01458; TAG: N0543; NAME: Follow-Up Source, Date of Diagnosis (COC)
    public boolean rqrs01458(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.followUpSource))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01460; TAG: N2576; NAME: GeolocationID - 1970/80/90 (NAACCR)
    public boolean rqrs01460(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.geolocationid19708090))
            return true
        return functions.GEN_MATCH(untrimmedline.geolocationid19708090, "(((\\d\\d))((\\s\\s\\s)|(\\d\\d\\d))((\\s\\s\\s\\s\\s\\s)|(\\d\\d\\d\\d\\d\\d))((\\s)|(\\d)))")

    }

    // ID: RQRS-01461; TAG: N2577; NAME: GeolocationID - 2000 (NAACCR)
    public boolean rqrs01461(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.geolocationid2000))
            return true
        return functions.GEN_MATCH(untrimmedline.geolocationid2000, "(((\\d\\d))((\\s\\s\\s)|(\\d\\d\\d))((\\s\\s\\s\\s\\s\\s)|(\\d\\d\\d\\d\\d\\d))((\\s)|(\\d)))")

    }

    // ID: RQRS-01462; TAG: N2578; NAME: GeolocationID - 2010 (NAACCR)
    public boolean rqrs01462(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.geolocationid2010))
            return true
        return functions.GEN_MATCH(untrimmedline.geolocationid2010, "(((\\d\\d))((\\s\\s\\s)|(\\d\\d\\d))((\\s\\s\\s\\s\\s\\s)|(\\d\\d\\d\\d\\d\\d))((\\s)|(\\d)))")

    }

    // ID: RQRS-01463; TAG: N2579; NAME: GeolocationID - 2020 (NAACCR)
    public boolean rqrs01463(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.geolocationid2020))
            return true
        return functions.GEN_MATCH(untrimmedline.geolocationid2020, "(((\\d\\d))((\\s\\s\\s)|(\\d\\d\\d))((\\s\\s\\s\\s\\s\\s)|(\\d\\d\\d\\d\\d\\d))((\\s)|(\\d)))")

    }

    // ID: RQRS-01464; TAG: N2882; NAME: Gestational Trophoblastic Prognostic Scoring Index, AJCC TNM Stage (NAACCR)
    public boolean rqrs01464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] STAGE = new char[16], SCORE = new char[3]
        
        int dx_year
        
        char[] cstage_Prog = new char[18]
        char[] pstage_Prog = new char[18]
        char[] ptstage_Prog = new char[18]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "56") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex) || functions.GEN_AT(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
            return true
        if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), "99") == 0))) {
            functions.GEN_STRCPY(ptstage_Prog, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(ptstage_Prog, functions.GEN_TRIM(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), "99") == 0))) {
            functions.GEN_STRCPY(pstage_Prog, functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(pstage_Prog, functions.GEN_TRIM(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), "99") == 0))) {
            functions.GEN_STRCPY(cstage_Prog, functions.GEN_TRIM(untrimmedline.ajccTnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(cstage_Prog, functions.GEN_TRIM(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex, ((Integer)context.RQRS_GEN_RIGHT)))
        }
        if (!functions.GEN_EMPTY(ptstage_Prog) || !functions.GEN_EMPTY(pstage_Prog) || !functions.GEN_EMPTY(cstage_Prog)) {
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_PROGNOSTIC, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_PROGNOSTIC_STAGESCORE, ptstage_Prog, ['STAGE':STAGE, 'SCORE':SCORE]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_PROGNOSTIC, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_PROGNOSTIC_STAGESCORE, pstage_Prog, ['STAGE':STAGE, 'SCORE':SCORE]) && !functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_PROGNOSTIC, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_PROGNOSTIC_STAGESCORE, cstage_Prog, ['STAGE':STAGE, 'SCORE':SCORE]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gestational Trophoblastic Prognostic Scoring Index: ${untrimmedline.gestationalTrophoblasticPrognosticScoringIndex} conflicts with AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}, AJCC TNM Path Stage Group: ${untrimmedline.ajccTnmPathStageGroup}, and AJCC TNM Clin Stage Group: ${untrimmedline.ajccTnmClinStageGroup}')
        }
        return true

    }

    // ID: RQRS-01465; TAG: N2736; NAME: Gestational Trophoblastic Prognostic Scoring Index, Date DX (NAACCR)
    public boolean rqrs01465(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gestational Trophoblastic Prognostic Scoring Index must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex))
            return true
        if (!functions.GEN_INLIST(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex, "00-25, X9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gestationalTrophoblasticPrognosticScoringIndex} not valid code for Gestational Trophoblastic Prognostic Scoring Index')
        return true

    }

    // ID: RQRS-01466; TAG: N2881; NAME: Gestational Trophoblastic Prognostic Scoring Index, Schema ID, Required (NAACCR)
    public boolean rqrs01466(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00560", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex))
                return false
        }
        return true

    }

    // ID: RQRS-01467; TAG: N0752; NAME: GIS Coordinate Quality (NAACCR)
    public boolean rqrs01467(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gisQuality))
            return true
        return functions.GEN_INLIST(untrimmedline.gisQuality, "00-12,98,99", "(\\d\\d)")

    }

    // ID: RQRS-01468; TAG: N2706; NAME: Gleason Patterns Clinical, Date DX (NAACCR)
    public boolean rqrs01468(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical))
            return true
        if (!functions.GEN_INLIST(untrimmedline.gleasonPatternsClinical, "11-15,19,21-25,29,31-35,39,41-45,49,51-55,59,X6,X7,X8,X9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gleasonPatternsClinical} not valid code for Gleason Patterns Clinical')
        return true

    }

    // ID: RQRS-01469; TAG: N2883; NAME: Gleason Patterns Clinical, Schema ID, Required (NAACCR)
    public boolean rqrs01469(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical) || functions.GEN_AT(untrimmedline.gleasonPatternsClinical, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01470; TAG: N2708; NAME: Gleason Patterns Pathological, Date DX (NAACCR)
    public boolean rqrs01470(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological))
            return true
        if (!functions.GEN_INLIST(untrimmedline.gleasonPatternsPathological, "11-15,19,21-25,29,31-35,39,41-45,49,51-55,59,X6,X7,X8,X9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gleasonPatternsPathological} not valid code for Gleason Patterns Pathological')
        return true

    }

    // ID: RQRS-01471; TAG: N2884; NAME: Gleason Patterns Pathological, Schema ID, Required (NAACCR)
    public boolean rqrs01471(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological) || functions.GEN_AT(untrimmedline.gleasonPatternsPathological, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01472; TAG: N2707; NAME: Gleason Score Clinical, Date DX (NAACCR)
    public boolean rqrs01472(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Score Clinical must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical))
            return true
        if (functions.GEN_AT(untrimmedline.gleasonScoreClinical, "020304050607080910X7X8X9", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gleasonScoreClinical} not valid code for Gleason Score Clinical')
        return true

    }

    // ID: RQRS-01473; TAG: N2885; NAME: Gleason Score Clinical, Schema ID, Required (NAACCR)
    public boolean rqrs01473(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical) || functions.GEN_AT(untrimmedline.gleasonScoreClinical, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01474; TAG: N3921; NAME: Gleason Score Clinical, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01474(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical) || functions.GEN_AT(untrimmedline.gleasonScoreClinical, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01475; TAG: N2709; NAME: Gleason Score Pathological, Date DX (NAACCR)
    public boolean rqrs01475(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScorePathological))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Score Pathological must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gleasonScorePathological))
            return true
        if (functions.GEN_AT(untrimmedline.gleasonScorePathological, "020304050607080910X7X8X9", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gleasonScorePathological} not valid code for Gleason Score Pathological')
        return true

    }

    // ID: RQRS-01476; TAG: N2886; NAME: Gleason Score Pathological, Schema ID, Required (NAACCR)
    public boolean rqrs01476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonScorePathological) || functions.GEN_AT(untrimmedline.gleasonScorePathological, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01477; TAG: N3922; NAME: Gleason Score Pathological, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01477(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonScorePathological) || functions.GEN_AT(untrimmedline.gleasonScorePathological, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01478; TAG: N2710; NAME: Gleason Tertiary Pattern, Date DX (NAACCR)
    public boolean rqrs01478(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Tertiary Pattern must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern))
            return true
        if (functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "1020304050X7X8X9", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.gleasonTertiaryPattern} not valid code for Gleason Tertiary Pattern')
        return true

    }

    // ID: RQRS-01479; TAG: N2887; NAME: Gleason Tertiary Pattern, Schema ID, Required (NAACCR)
    public boolean rqrs01479(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01480; TAG: N3923; NAME: Gleason Tertiary Pattern, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01480(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01481; TAG: N0621; NAME: Grade (73-91) ICD-O-1 (SEER)
    public boolean rqrs01481(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradeIcdO1))
            return true
        return functions.GEN_INLIST(untrimmedline.gradeIcdO1, "1-9")

    }

    // ID: RQRS-01482; TAG: N1959; NAME: Grade (CCCR)
    public boolean rqrs01482(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.grade))
            return true
        if (functions.GEN_INLIST(untrimmedline.grade, "1-9"))
            return true
        return false

    }

    // ID: RQRS-01483; TAG: N2802; NAME: Grade Clin,Path,PostTX, Date of Diagnosis (NAACCR)
    public boolean rqrs01483(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.gradeClinical) || !functions.GEN_EMPTY(untrimmedline.gradePathological) || !functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical, Grade Pathological, and Grade Post Therapy must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.gradePathological))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological must be reported for diagnosis date 2018+')
        }
        return true

    }

    // ID: RQRS-01484; TAG: N2610; NAME: Grade Clinical (NAACCR)
    public boolean rqrs01484(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: RQRS-01485; TAG: N4914; NAME: Grade Path, Grade Post Therapy (NAACCR)
    public boolean rqrs01485(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-01486; TAG: N4912; NAME: Grade Path, Grade Post Therapy, Post Therapy Stage (NAACCR)
    public boolean rqrs01486(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0088", 2) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00790007950081100812008210082200830", 5) != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.RQRS_GEN_RIGHT)), "88") == 0)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological must = 9 if AJCC TNM Post Therapy Stage Group is not blank and AJCC TNM Post Therapy T not = 88')
            if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy: ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.RQRS_GEN_RIGHT)), "ypT0") != 0 && functions.GEN_AT(untrimmedline.ajccId, "48.148.2", 4) == 0) {
            if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy: ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy T: ${untrimmedline.ajccTnmPostTherapyT}')
        }
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy: ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        return true

    }

    // ID: RQRS-01487; TAG: N4913; NAME: Grade Path, Grade Post Therapy, Post Therapy Stage, CoC Flag (NPCR)
    public boolean rqrs01487(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0088", 2) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Pathological: ${untrimmedline.gradePathological} and AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
            if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy: ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup)) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy: ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        return true

    }

    // ID: RQRS-01488; TAG: N2751; NAME: Grade Pathological (NAACCR)
    public boolean rqrs01488(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_AT(untrimmedline.gradePathological, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: RQRS-01489; TAG: N2801; NAME: Grade Post Therapy (NAACCR)
    public boolean rqrs01489(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: RQRS-01490; TAG: N3094; NAME: Grade, Date of Diagnosis (COC)
    public boolean rqrs01490(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.grade))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade must not be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.grade))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade must be blank for cases diagnosed 2018 and later')
        }
        return true

    }

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

    }

    // ID: RQRS-01492; TAG: N3087; NAME: Grade, Ovary/PPC/FT, Behavior ICD-O-3 (NAACCR)
    public boolean rqrs01492(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00551 00552 00553 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "B", 1) == 0 || functions.GEN_AT(untrimmedline.gradePathological, "B", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical}, Grade Pathological: ${untrimmedline.gradePathological}, or Grade Post Therapy: ${untrimmedline.gradePostTherapy} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
                if (functions.GEN_AT(untrimmedline.gradePostTherapy, "B", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical}, Grade Pathological: ${untrimmedline.gradePathological}, or Grade Post Therapy: ${untrimmedline.gradePostTherapy} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
            }
        }
        return true

    }

    // ID: RQRS-01493; TAG: N2803; NAME: Grade, Schema ID (NAACCR)
    public boolean rqrs01493(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], Grade = new char[2]
        
        int dx_year
        
        char[] name = new char[50]
        
        
        char[] group_cgrade = new char[7]
        char[] group_pgrade = new char[7]
        char[] group_pngrade = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        if (!functions.GEN_EMPTY(untrimmedline.gradeClinical)) {
            functions.GEN_STRCPY(group_cgrade, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_cgrade, untrimmedline.gradeClinical)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_GRADEED8_SCHEMA_IDGRADE, group_cgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Schema ID ${untrimmedline.schemaId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.gradePathological)) {
            functions.GEN_STRCPY(group_pgrade, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_pgrade, untrimmedline.gradePathological)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_GRADEED8_SCHEMA_IDGRADE, group_pgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Schema ID ${untrimmedline.schemaId}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            functions.GEN_STRCPY(group_pngrade, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_pngrade, untrimmedline.gradePostTherapy)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_GRADEED8_SCHEMA_IDGRADE, group_pngrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
        
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy: ${untrimmedline.gradePostTherapy} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-01494; TAG: N2661; NAME: hCG Post-Orchiectomy Lab Value, Date DX (NAACCR)
    public boolean rqrs01494(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] hCG = new char[7]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Post-Orchiectomy Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.hcgPostOrchiectomyLabValue, 6, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Post-Orchiectomy Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPostOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPostOrchiectomyLabValue, 7, 1))
        
        if (functions.GEN_AT(hCG, "XXXXX1XXXXX7XXXXX8XXXXX9", 6) == 0 && !functions.GEN_MATCH(hCG, "(\\s\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s(([1-9]))\\d\\d\\d\\d)") && !functions.GEN_MATCH(hCG, "((([1-9]))\\d\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.hcgPostOrchiectomyLabValue} not valid code for hCG Post-Orchiectomy Lab Value')
        return true

    }

    // ID: RQRS-01495; TAG: N2977; NAME: hCG Post-Orchiectomy Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01495(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01496; TAG: N3924; NAME: hCG Post-Orchiectomy Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01496(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01497; TAG: N2717; NAME: hCG Post-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs01497(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Post-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.hcgPostOrchiectomyRange} not valid code for hCG Post-Orchiectomy Range')
        return true

    }

    // ID: RQRS-01498; TAG: N2978; NAME: hCG Post-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs01498(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01499; TAG: N2659; NAME: hCG Pre-Orchiectomy Lab Value, Date DX (NAACCR)
    public boolean rqrs01499(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] hCG = new char[7]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Pre-Orchiectomy Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.hcgPreOrchiectomyLabValue, 6, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Pre-Orchiectomy Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPreOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPreOrchiectomyLabValue, 7, 1))
        
        if (functions.GEN_AT(hCG, "XXXXX1XXXXX7XXXXX8XXXXX9", 6) == 0 && !functions.GEN_MATCH(hCG, "(\\s\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(hCG, "(\\s(([1-9]))\\d\\d\\d\\d)") && !functions.GEN_MATCH(hCG, "((([1-9]))\\d\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.hcgPreOrchiectomyLabValue} not valid code for hCG Pre-Orchiectomy Lab Value')
        return true

    }

    // ID: RQRS-01500; TAG: N2979; NAME: hCG Pre-Orchiectomy Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01500(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPreOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01501; TAG: N3925; NAME: hCG Pre-Orchiectomy Lab Value, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01501(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPreOrchiectomyLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01502; TAG: N2714; NAME: hCG Pre-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs01502(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'hCG Pre-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.hcgPreOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.hcgPreOrchiectomyRange} not valid code for hCG Pre-Orchiectomy Range')
        return true

    }

    // ID: RQRS-01503; TAG: N2980; NAME: hCG Pre-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs01503(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange) || functions.GEN_AT(untrimmedline.hcgPreOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01504; TAG: N0433; NAME: Hemato ICDO2, Summ Stg 1977, Class of Case (NAACCR
    public boolean rqrs01504(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9731,9740,9764,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 1, 7, or 9 for this histology')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9722,9723,9732,9741,9760-9763,9765-9910,9931-9989")) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 7 for this histology')
            }
        }
        return true

    }

    // ID: RQRS-01505; TAG: N0432; NAME: Hemato ICDO2, Summ Stg 1977, Type Rpt Srce (NAACCR
    public boolean rqrs01505(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9731,9740,9764,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 1, 7, or 9 for this histology')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9722,9723,9732,9741,9760-9763,9765-9910,9931-9989")) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 7 for this histology')
            }
        }
        return true

    }

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

    }

    // ID: RQRS-01507; TAG: N0451; NAME: Hematopoietic, TNM, ICDO3 (NAACCR)
    public boolean rqrs01507(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1996)
            return true
        if (dx_year > 2009)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49") || functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9731-9992")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01508; TAG: N2681; NAME: HER2 IHC Summary, Date DX (NAACCR)
    public boolean rqrs01508(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2IhcSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 IHC Summary must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2IhcSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2IhcSummary} not valid code for HER2 IHC Summary')
        return true

    }

    // ID: RQRS-01509; TAG: N2888; NAME: HER2 IHC Summary, Schema ID, Required (NAACCR)
    public boolean rqrs01509(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IhcSummary) || functions.GEN_AT(untrimmedline.her2IhcSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01510; TAG: N2684; NAME: HER2 ISH Dual Probe Copy Number, Date DX (NAACCR)
    public boolean rqrs01510(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] copy = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Dual Probe Copy Number must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeCopyNumber, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Dual Probe Copy Number must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(copy, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeCopyNumber, 1, 2))
        functions.GEN_STRCAT(copy, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeCopyNumber, 4, 1))
        
        if (functions.GEN_AT(copy, "XX1XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(copy, "(\\s\\d\\d)") && !functions.GEN_MATCH(copy, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2IshDualProbeCopyNumber} not valid code for HER2 ISH Dual Probe Copy Number')
        return true

    }

    // ID: RQRS-01511; TAG: N2857; NAME: HER2 ISH Dual Probe Copy Number, Schema ID, Required (NAACCR)
    public boolean rqrs01511(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshDualProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01512; TAG: N2683; NAME: HER2 ISH Dual Probe Ratio, Date DX (NAACCR)
    public boolean rqrs01512(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] probe = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Dual Probe Ratio must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeRatio, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Dual Probe Ratio must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(probe, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeRatio, 1, 2))
        functions.GEN_STRCAT(probe, functions.GEN_SUBSTR(untrimmedline.her2IshDualProbeRatio, 4, 1))
        
        if (functions.GEN_AT(probe, "XX2XX3XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(probe, "(\\s\\d\\d)") && !functions.GEN_MATCH(probe, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2IshDualProbeRatio} not valid code for HER2 ISH Dual Probe Ratio')
        return true

    }

    // ID: RQRS-01513; TAG: N2858; NAME: HER2 ISH Dual Probe Ratio, Schema ID, Required (NAACCR)
    public boolean rqrs01513(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio) || functions.GEN_AT(untrimmedline.her2IshDualProbeRatio, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01514; TAG: N2685; NAME: HER2 ISH Single Probe Copy Number, Date Dx (NAACCR)
    public boolean rqrs01514(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] copy = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Single Probe Copy Number must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.her2IshSingleProbeCopyNumber, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Single Probe Copy Number must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(copy, functions.GEN_SUBSTR(untrimmedline.her2IshSingleProbeCopyNumber, 1, 2))
        functions.GEN_STRCAT(copy, functions.GEN_SUBSTR(untrimmedline.her2IshSingleProbeCopyNumber, 4, 1))
        
        if (functions.GEN_AT(copy, "XX1XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(copy, "(\\s\\d\\d)") && !functions.GEN_MATCH(copy, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2IshSingleProbeCopyNumber} not valid code for HER2 ISH Single Probe Copy Number')
        return true

    }

    // ID: RQRS-01515; TAG: N2859; NAME: HER2 ISH Single Probe Copy Number, Schema ID, Required (NAACCR)
    public boolean rqrs01515(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshSingleProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01516; TAG: N2682; NAME: HER2 ISH Summary, Date DX (NAACCR)
    public boolean rqrs01516(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 ISH Summary must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2IshSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2IshSummary, "023789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2IshSummary} not valid code for HER2 ISH Summary')
        return true

    }

    // ID: RQRS-01517; TAG: N2860; NAME: HER2 ISH Summary, Schema ID, Required (NAACCR)
    public boolean rqrs01517(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSummary) || functions.GEN_AT(untrimmedline.her2IshSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01518; TAG: N2735; NAME: HER2 Overall Summary, Date DX (NAACCR)
    public boolean rqrs01518(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 Overall Summary must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2OverallSummary, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2OverallSummary} not valid code for HER2 Overall Summary')
        return true

    }

    // ID: RQRS-01519; TAG: N2889; NAME: HER2 Overall Summary, Schema ID, Required (NAACCR)
    public boolean rqrs01519(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
                return false
        }
        return true

    }

    // ID: RQRS-01520; TAG: N2740; NAME: Heritable Trait, Date DX (NAACCR)
    public boolean rqrs01520(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.heritableTrait))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Heritable Trait must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.heritableTrait))
            return true
        if (functions.GEN_AT(untrimmedline.heritableTrait, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.heritableTrait} not valid code for Heritable Trait')
        return true

    }

    // ID: RQRS-01521; TAG: N2861; NAME: Heritable Trait, Schema ID, Required (NAACCR)
    public boolean rqrs01521(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00680", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.heritableTrait))
                return false
        }
        return true

    }

    // ID: RQRS-01522; TAG: N2749; NAME: High Risk Cytogenetics, Date DX (NAACCR)
    public boolean rqrs01522(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'High Risk Cytogenetics must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskCytogenetics, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.highRiskCytogenetics} not valid code for High Risk Cytogenetics')
        return true

    }

    // ID: RQRS-01523; TAG: N2996; NAME: High Risk Cytogenetics, Schema ID, Required (NAACCR)
    public boolean rqrs01523(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.schemaDiscriminator1, "0") != 0) {
                if (functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'High Risk Cytogenetics must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0 && functions.GEN_AT(untrimmedline.schemaDiscriminator1, "19", 1) != 0) {
                if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'High Risk Cytogenetics: ${untrimmedline.highRiskCytogenetics} not valid for Schema ID: ${untrimmedline.schemaId} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1}')
            }
        }
        return true

    }

    // ID: RQRS-01524; TAG: N2731; NAME: High Risk Histologic Features, Date DX (NAACCR)
    public boolean rqrs01524(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'High Risk Histologic Features must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "012345689", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.highRiskHistologicFeatures} not valid code for High Risk Histologic Features')
        return true

    }

    // ID: RQRS-01525; TAG: N2981; NAME: High Risk Histologic Features, Schema ID, Required (NAACCR)
    public boolean rqrs01525(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00150", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures) || functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01526; TAG: N0625; NAME: Hist ICDO2, Date of DX, ICDO2 Conv Flag (SEER IF84)
    public boolean rqrs01526(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
                return false
        }
        if (dx_year > 2000) {
            if (!functions.GEN_EMPTY(untrimmedline.histologyIcdO2)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO2ConversionFlag, "0,5,6"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01527; TAG: N0627; NAME: Hist ICDO3, Date of DX, ICDO3 Conv Flag (SEER IF86)
    public boolean rqrs01527(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return false
        }
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return false
        }
        if (dx_year < 2001) {
            if (!functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "1,3"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01528; TAG: N0840; NAME: Histologic Type ICDO3 Conversion (NAACCR)
    public boolean rqrs01528(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_HISICDO3_HISTOLOGY, untrimmedline.histologyIcdO3, [:]))
            return false
        return true

    }

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

    }

    // ID: RQRS-01530; TAG: N4911; NAME: Histologic Type ICDO3, Primary Site, Date of Diagnosis (NAACCR)
    public boolean rqrs01530(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 < 2018 || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.primarySite, "C739") != 0) {
            if (functions.GEN_AT(untrimmedline.histologyIcdO3, "8510") != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.histologyIcdO3, "84808550", 4) != 0) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        
        return true

    }

    // ID: RQRS-01531; TAG: N0622; NAME: Histology (73-91) ICD-O-1 (SEER)
    public boolean rqrs01531(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO1))
            return true
        return functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8000-9990")

    }

    // ID: RQRS-01532; TAG: N0499; NAME: Histology ICDO2, Date DX, Date 1st Contact (NAACCR)
    public boolean rqrs01532(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fc_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (dx_year < 2001) {
                if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2001, Histology (92-00) ICD-O-2 cannot be blank')
                else
                    return true
            }
            else
                return true
        }
        fc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (fc_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (fc_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
        if (fc_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is unknown and Date of 1st Contact < 2001, then Histology (92-00) ICD-O-2 cannot be blank')
            else
                return true
        }
        return true

    }

    // ID: RQRS-01533; TAG: N0478; NAME: Histology ICDO2, Histology ICDO3 (SEER IF94)
    public boolean rqrs01533(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2) && functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return false
        return true

    }

    // ID: RQRS-01534; TAG: N0459; NAME: Histology ICDO3, Date of Diagnosis (NAACCR)
    public boolean rqrs01534(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return false
        }
        return true

    }

    // ID: RQRS-01535; TAG: N2645; NAME: HIV Status, Date DX (NAACCR)
    public boolean rqrs01535(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.hivStatus))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HIV Status must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.hivStatus))
            return true
        if (functions.GEN_AT(untrimmedline.hivStatus, "01789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.hivStatus} not valid code for HIV Status')
        return true

    }

    // ID: RQRS-01536; TAG: N2944; NAME: HIV Status, Schema ID, Required (NAACCR)
    public boolean rqrs01536(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.hivStatus) || functions.GEN_AT(untrimmedline.hivStatus, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01537; TAG: N0832; NAME: ICD Revision Number (NPCR)
    public boolean rqrs01537(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0-1,7-9")

    }

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

    }

    // ID: RQRS-01539; TAG: N0846; NAME: ICD Revision Number, Cause of Death (NAACCR)
    public boolean rqrs01539(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int cod_num
        
        if (functions.GEN_EMPTY(untrimmedline.causeOfDeath) || functions.GEN_EMPTY(untrimmedline.icdRevisionNumber)) {
            return true
        }
        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)")) {
            cod_num = functions.GEN_VAL(untrimmedline.causeOfDeath)
            if (cod_num == 0) {
                if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else {
                    if (cod_num == 7777 || cod_num == 7797)
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0")) {
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
            if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "9599"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1")) {
            if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\s)")) {
                if (functions.GEN_LOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD10CON, context.RQRS_ICD10CON_CODE2, [:]))
                    return true
                else
                    return false
            }
            else {
                if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD10COD, context.RQRS_ICD10COD_CODE, [:]))
                    return false
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "7")) {
                if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD7COD, context.RQRS_ICD7COD_CODE, [:]))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "8")) {
                    if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD8COD, context.RQRS_ICD8COD_CODE, [:]))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
                        if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD9COD, context.RQRS_ICD9COD_CODE, [:]))
                            return false
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01540; TAG: N0093; NAME: ICD Revision Number, Cause of Death (SEER IF37)
    public boolean rqrs01540(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int cod_num
        
        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)")) {
            cod_num = functions.GEN_VAL(untrimmedline.causeOfDeath)
            if (cod_num == 0) {
                if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else {
                    if (cod_num == 7777 || cod_num == 7797)
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0")) {
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
            if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "9599"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1")) {
            if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\s)")) {
                if (functions.GEN_LOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD10CON, context.RQRS_ICD10CON_CODE2, [:]))
                    return true
                else
                    return false
            }
            else {
                if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD10COD, context.RQRS_ICD10COD_CODE, [:]))
                    return false
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "7")) {
                if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD7COD, context.RQRS_ICD7COD_CODE, [:]))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "8")) {
                    if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD8COD, context.RQRS_ICD8COD_CODE, [:]))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
                        if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.RQRS_ICD9COD, context.RQRS_ICD9COD_CODE, [:]))
                            return false
                    }
                }
            }
        }
        return true

    }

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

    }

    // ID: RQRS-01542; TAG: N0738; NAME: ICD Revisn, Vital Stat, Date Last Cont (SEER IF113)
    public boolean rqrs01542(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dolc_year
        
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dolc_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dolc_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        if (dolc_year > 1998) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1"))
                    return true
                else
                    return false
            }
        }
        if (dolc_year > 1978 && dolc_year < 1999) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01543; TAG: N0629; NAME: ICD-O-2 Conversion Flag, Hist, Behav (SEER IF70)
    public boolean rqrs01543(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2) && functions.GEN_EMPTY(untrimmedline.behaviorIcdO2)) {
            if (functions.GEN_EMPTY(untrimmedline.icdO2ConversionFlag))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.histologyIcdO2) && !functions.GEN_EMPTY(untrimmedline.behaviorIcdO2)) {
            if (!functions.GEN_EMPTY(untrimmedline.icdO2ConversionFlag))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01544; TAG: N0498; NAME: ICD-O-3 Conversion Flag, Histology ICDO3 (SEER IF95)
    public boolean rqrs01544(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.icdO3ConversionFlag)) {
            if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01546; TAG: N0164; NAME: Industry Source (NPCR)
    public boolean rqrs01546(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.industrySource, "0-3,7-9", "(\\d)") || functions.GEN_EMPTY(untrimmedline.industrySource)

    }

    // ID: RQRS-01547; TAG: N0982; NAME: Inpatient Status (NAACCR)
    public boolean rqrs01547(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.inpatientStatus))
            return true
        if (!functions.GEN_INLIST(untrimmedline.inpatientStatus, "0,1,9"))
            return false
        
        return true

    }

    // ID: RQRS-01548; TAG: N0594; NAME: Institution Referred From, Date of Diagnosis (COC)
    public boolean rqrs01548(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.institutionReferredFrom))
                return false
        }
        return true

    }

    // ID: RQRS-01549; TAG: N0595; NAME: Institution Referred To, Date of Diagnosis (COC)
    public boolean rqrs01549(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.institutionReferredTo))
                return false
        }
        return true

    }

    // ID: RQRS-01550; TAG: N2653; NAME: International Normalized Ratio Prothrombin Time, Date DX (NAACCR)
    public boolean rqrs01550(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] INR = new char[3]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'International Normalized Ratio Prothrombin Time must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.internationalNormalizedRatioForProthrombinTime, 2, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'International Normalized Ratio Prothrombin Time must be right justified with one decimal place')
        functions.GEN_STRCPY(INR, functions.GEN_SUBSTR(untrimmedline.internationalNormalizedRatioForProthrombinTime, 1, 1))
        functions.GEN_STRCAT(INR, functions.GEN_SUBSTR(untrimmedline.internationalNormalizedRatioForProthrombinTime, 3, 1))
        
        if (functions.GEN_AT(INR, "X1X7X8X9", 2) == 0 && !functions.GEN_MATCH(INR, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.internationalNormalizedRatioForProthrombinTime} not valid code for International Normalized Ratio Prothrombin Time')
        return true

    }

    // ID: RQRS-01551; TAG: N2956; NAME: International Normalized Ratio Prothrombin Time, Schema ID, Required (NAACCR)
    public boolean rqrs01551(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime) || functions.GEN_AT(untrimmedline.internationalNormalizedRatioForProthrombinTime, "X.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01552; TAG: N3926; NAME: International Normalized Ratio Prothrombin Time, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01552(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime) || functions.GEN_AT(untrimmedline.internationalNormalizedRatioForProthrombinTime, "X.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01553; TAG: N2893; NAME: Invasion Beyond Capsule, Date DX (NAACCR)
    public boolean rqrs01553(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invasion Beyond Capsule must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule))
            return true
        if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "01234589", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.invasionBeyondCapsule} not valid code for Invasion Beyond Capsule')
        return true

    }

    // ID: RQRS-01554; TAG: N2894; NAME: Invasion Beyond Capsule, Schema ID, Required (NAACCR)
    public boolean rqrs01554(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01555; TAG: N2890; NAME: Ipsilateral Adrenal Gland Involvement, Date DX (NAACCR)
    public boolean rqrs01555(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement))
            return true
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "0123489", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ipsilateralAdrenalGlandInvolvement} not valid code for Ipsilateral Adrenal Gland Involvement')
        return true

    }

    // ID: RQRS-01556; TAG: N2891; NAME: Ipsilateral Adrenal Gland Involvement, Schema ID, Required (NAACCR)
    public boolean rqrs01556(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01557; TAG: N2646; NAME: JAK2, Date DX (NAACCR)
    public boolean rqrs01557(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.jak2))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'JAK2 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.jak2))
            return true
        if (functions.GEN_AT(untrimmedline.jak2, "012345789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.jak2} not valid code for JAK2')
        return true

    }

    // ID: RQRS-01558; TAG: N2945; NAME: JAK2, Schema ID, Required (NAACCR)
    public boolean rqrs01558(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00830", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.jak2) || functions.GEN_AT(untrimmedline.jak2, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01559; TAG: N2686; NAME: Ki-67, Date DX (NAACCR)
    public boolean rqrs01559(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] Ki = new char[5]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ki67))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ki-67 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ki67))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.ki67, 4, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Ki-67 must be right justified with one decimal place')
        functions.GEN_STRCPY(Ki, functions.GEN_SUBSTR(untrimmedline.ki67, 1, 3))
        functions.GEN_STRCAT(Ki, functions.GEN_SUBSTR(untrimmedline.ki67, 5, 1))
        
        if (functions.GEN_AT(Ki, "XXX7XXX8XXX9", 4) == 0 && !functions.GEN_MATCH(Ki, "(\\s\\s\\d\\d)") && !functions.GEN_MATCH(Ki, "(\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(Ki, "((([1-9]))\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ki67} not valid code for Ki-67')
        return true

    }

    // ID: RQRS-01560; TAG: N2892; NAME: Ki-67, Schema ID, Required (NAACCR)
    public boolean rqrs01560(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ki67) || functions.GEN_AT(untrimmedline.ki67, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01561; TAG: N3927; NAME: Ki-67, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01561(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ki67) || functions.GEN_AT(untrimmedline.ki67, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01562; TAG: N2698; NAME: KIT Gene Immunohistochemistry, Date DX (NAACCR)
    public boolean rqrs01562(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'KIT Gene Immunohistochemistry must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry))
            return true
        if (functions.GEN_AT(untrimmedline.kitGeneImmunohistochemistry, "01789", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.kitGeneImmunohistochemistry} not valid code for KIT Gene Immunohistochemistry')
        return true

    }

    // ID: RQRS-01563; TAG: N2957; NAME: KIT Gene Immunohistochemistry, Schema ID, Required (NAACCR)
    public boolean rqrs01563(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00430", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry) || functions.GEN_AT(untrimmedline.kitGeneImmunohistochemistry, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01564; TAG: N3928; NAME: KIT Gene Immunohistochemistry, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01564(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00430", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry) || functions.GEN_AT(untrimmedline.kitGeneImmunohistochemistry, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01565; TAG: N2696; NAME: KRAS, Date DX (NAACCR)
    public boolean rqrs01565(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.kras))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'KRAS must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.kras))
            return true
        if (functions.GEN_AT(untrimmedline.kras, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.kras} not valid code for KRAS')
        return true

    }

    // ID: RQRS-01566; TAG: N2997; NAME: KRAS, Schema ID, Required (NAACCR)
    public boolean rqrs01566(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.kras) || functions.GEN_AT(untrimmedline.kras, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01567; TAG: N0652; NAME: Laterality, Primary Site, Date of Diag (SEER IF24)
    public boolean rqrs01567(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.laterality, "0")) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "079,080,091,098,099,301,310,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "341-349,384,500-509,569,570", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "620-629,630,631,649,659,669", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "690-699,740-749,754", "(C\\d\\d\\d)", 2, 3)) || (dx_year > 1978 && (functions.GEN_INLIST(untrimmedline.primarySite, "081,090,400-403,441-443", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "445-447,471,472,491,492", "(C\\d\\d\\d)", 2, 3))) || (dx_year > 2003 && (functions.GEN_INLIST(untrimmedline.primarySite, "700,710-714,722-725", "(C\\d\\d\\d)", 2, 3))))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.laterality, "5")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "443,445,700,710-714,722-725", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.laterality, "5")) {
            if (dx_year > 2009)
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01568; TAG: N0445; NAME: Laterality, Primary Site, Morph ICDO3 (SEER IF42)
    public boolean rqrs01568(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        boolean paired_organ
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9999", "(\\d\\d\\d\\d)"))
            return true
        if (dx_year > 1987 && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140,9700,9701,9590-9980", "(\\d\\d\\d\\d)"))
            return true
        paired_organ = functions.GEN_ILOOKUP(untrimmedline.primarySite, context.RQRS_PAIRORGN, context.RQRS_PAIRORGN_PAIRSITE, [:]) || (dx_year > 1978 && functions.GEN_INLIST(untrimmedline.primarySite, "081,090,400-403,441,442,446,447,471,472,491,492", "(C\\d\\d\\d)", 2, 3))
        
        if (paired_organ) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                if (!functions.GEN_INLIST(untrimmedline.laterality, "1-3,5"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01569; TAG: N2718; NAME: LDH Post-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs01569(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Post-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhPostOrchiectomyRange} not valid code for LDH Post-Orchiectomy Range')
        return true

    }

    // ID: RQRS-01570; TAG: N2982; NAME: LDH Post-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs01570(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01571; TAG: N2715; NAME: LDH Pre-Orchiectomy Range, Date DX (NAACCR)
    public boolean rqrs01571(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pre-Orchiectomy Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange))
            return true
        if (functions.GEN_AT(untrimmedline.ldhPreOrchiectomyRange, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhPreOrchiectomyRange} not valid code for LDH Pre-Orchiectomy Range')
        return true

    }

    // ID: RQRS-01572; TAG: N2983; NAME: LDH Pre-Orchiectomy Range, Schema ID, Required (NAACCR)
    public boolean rqrs01572(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange) || functions.GEN_AT(untrimmedline.ldhPreOrchiectomyRange, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01573; TAG: N2656; NAME: LDH Pretreatment Lab Value, Date DX (NAACCR)
    public boolean rqrs01573(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] LDH = new char[7]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pretreatment Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.ldhPretreatmentLabValue, 6, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pretreatment Lab Value must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(LDH, functions.GEN_SUBSTR(untrimmedline.ldhPretreatmentLabValue, 1, 5))
        functions.GEN_STRCAT(LDH, functions.GEN_SUBSTR(untrimmedline.ldhPretreatmentLabValue, 7, 1))
        
        if (functions.GEN_AT(LDH, "XXXXX1XXXXX7XXXXX8XXXXX9", 6) == 0 && !functions.GEN_MATCH(LDH, "(\\s\\s\\s\\s\\d\\d)") && !functions.GEN_MATCH(LDH, "(\\s\\s\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(LDH, "(\\s\\s(([1-9]))\\d\\d\\d)") && !functions.GEN_MATCH(LDH, "(\\s(([1-9]))\\d\\d\\d\\d)") && !functions.GEN_MATCH(LDH, "((([1-9]))\\d\\d\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhPretreatmentLabValue} not valid code for LDH Pretreatment Lab Value')
        return true

    }

    // ID: RQRS-01574; TAG: N2934; NAME: LDH Pretreatment Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01574(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue) || functions.GEN_AT(untrimmedline.ldhPretreatmentLabValue, "XXXXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01575; TAG: N2750; NAME: LDH Pretreatment Level, Date DX (NAACCR)
    public boolean rqrs01575(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pretreatment Level must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel))
            return true
        if (functions.GEN_AT(untrimmedline.ldhPretreatmentLevel, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhPretreatmentLevel} not valid code for LDH Pretreatment Level')
        return true

    }

    // ID: RQRS-01576; TAG: N3902; NAME: LDH Pretreatment Level, Melanoma, Schema ID, Required (NAACCR)
    public boolean rqrs01576(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel))
                return false
        }
        return true

    }

    // ID: RQRS-01577; TAG: N2895; NAME: LDH Pretreatment Level, Myeloma, Schema ID, Required (NAACCR)
    public boolean rqrs01577(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.schemaDiscriminator1, "0") != 0) {
                if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pretreatment Level must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0 && functions.GEN_AT(untrimmedline.schemaDiscriminator1, "19", 1) != 0) {
                if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Pretreatment Level: ${untrimmedline.ldhPretreatmentLevel} not valid for Schema ID: ${untrimmedline.schemaId} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1}')
            }
        }
        return true

    }

    // ID: RQRS-01578; TAG: N2702; NAME: LDH Upper Limits of Normal, Date DX (NAACCR)
    public boolean rqrs01578(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Upper Limits of Normal must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal))
            return true
        if (functions.GEN_AT(untrimmedline.ldhUpperLimitsOfNormal, "XX8XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.ldhUpperLimitsOfNormal, "001-999", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhUpperLimitsOfNormal} not valid code for LDH Upper Limits of Normal')
        return true

    }

    // ID: RQRS-01579; TAG: N2896; NAME: LDH Upper Limits of Normal, Schema ID, Required (NAACCR)
    public boolean rqrs01579(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal) || functions.GEN_AT(untrimmedline.ldhUpperLimitsOfNormal, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01580; TAG: N3929; NAME: LDH Upper Limits of Normal, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01580(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal) || functions.GEN_AT(untrimmedline.ldhUpperLimitsOfNormal, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01581; TAG: N2636; NAME: LN Assessment Method Femoral-Inguinal, Date DX (NAACCR)
    public boolean rqrs01581(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Assessment Method Femoral-Inguinal must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal))
            return true
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnAssessmentMethodFemoralInguinal} not valid code for LN Assessment Method Femoral-Inguinal')
        return true

    }

    // ID: RQRS-01582; TAG: N2862; NAME: LN Assessment Method Femoral-Inguinal, Schema ID, Required (NAACCR)
    public boolean rqrs01582(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal) || functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01583; TAG: N3930; NAME: LN Assessment Method Femoral-Inguinal, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01583(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal) || functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01584; TAG: N2634; NAME: LN Assessment Method Para-Aortic, Date DX (NAACCR)
    public boolean rqrs01584(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Assessment Method Para-aortic must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic))
            return true
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnAssessmentMethodParaAortic} not valid code for LN Assessment Method Para-aortic')
        return true

    }

    // ID: RQRS-01585; TAG: N2863; NAME: LN Assessment Method Para-Aortic, Schema ID, Required (NAACCR)
    public boolean rqrs01585(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01586; TAG: N3931; NAME: LN Assessment Method Para-Aortic, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01586(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01587; TAG: N2635; NAME: LN Assessment Method Pelvic, Date DX (NAACCR)
    public boolean rqrs01587(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Assessment Method Pelvic must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic))
            return true
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnAssessmentMethodPelvic} not valid code for LN Assessment Method Pelvic')
        return true

    }

    // ID: RQRS-01588; TAG: N2864; NAME: LN Assessment Method Pelvic, Schema ID, Required (NAACCR)
    public boolean rqrs01588(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01589; TAG: N3932; NAME: LN Assessment Method Pelvic, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01589(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01590; TAG: N2638; NAME: LN Distant Assessment Method, Date DX (NAACCR)
    public boolean rqrs01590(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Distant Assessment Method must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantAssessmentMethod, "012789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnDistantAssessmentMethod} not valid code for LN Distant Assessment Method')
        return true

    }

    // ID: RQRS-01591; TAG: N2865; NAME: LN Distant Assessment Method, Schema ID, Required (NAACCR)
    public boolean rqrs01591(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod) || functions.GEN_AT(untrimmedline.lnDistantAssessmentMethod, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01592; TAG: N3933; NAME: LN Distant Assessment Method, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01592(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod) || functions.GEN_AT(untrimmedline.lnDistantAssessmentMethod, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01593; TAG: N2637; NAME: LN Distant: Mediastinal, Scalene, Date DX (NAACCR)
    public boolean rqrs01593(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Distant: Mediastinal, Scalene must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "012389", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnDistantMediastinalScalene} not valid code for LN Distant: Mediastinal, Scalene')
        return true

    }

    // ID: RQRS-01594; TAG: N2866; NAME: LN Distant: Mediastinal, Scalene, Schema ID, Required (NAACCR)
    public boolean rqrs01594(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01595; TAG: N3934; NAME: LN Distant: Mediastinal, Scalene, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01595(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01596; TAG: N2725; NAME: LN Head and Neck Levels I-III, Date DX (NAACCR)
    public boolean rqrs01596(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Head and Neck Levels I-III must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "0123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnHeadAndNeckLevels1To3} not valid code for LN Head and Neck Levels I-III')
        return true

    }

    // ID: RQRS-01597; TAG: N2897; NAME: LN Head and Neck Levels I-III, Schema ID, Required (NAACCR)
    public boolean rqrs01597(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01598; TAG: N2726; NAME: LN Head and Neck Levels IV-V, Date DX (NAACCR)
    public boolean rqrs01598(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Head and Neck Levels IV-V must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "012389", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnHeadAndNeckLevels4To5} not valid code for LN Head and Neck Levels IV-V')
        return true

    }

    // ID: RQRS-01599; TAG: N2898; NAME: LN Head and Neck Levels IV-V, Schema ID, Required (NAACCR)
    public boolean rqrs01599(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01600; TAG: N2727; NAME: LN Head and Neck Levels VI-VII, Date DX (NAACCR)
    public boolean rqrs01600(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Head and Neck Levels VI-VII must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "012389", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnHeadAndNeckLevels6To7} not valid code for LN Head and Neck Levels VI-VII')
        return true

    }

    // ID: RQRS-01601; TAG: N2899; NAME: LN Head and Neck Levels VI-VII, Schema ID, Required (NAACCR)
    public boolean rqrs01601(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01602; TAG: N2728; NAME: LN Head and Neck Other, Date DX (NAACCR)
    public boolean rqrs01602(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Head and Neck Other must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "0123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnHeadAndNeckOther} not valid code for LN Head and Neck Other')
        return true

    }

    // ID: RQRS-01603; TAG: N2900; NAME: LN Head and Neck Other, Schema ID, Required (NAACCR)
    public boolean rqrs01603(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01604; TAG: N2699; NAME: LN Isolated Tumor Cells (ITC), Date DX (NAACCR)
    public boolean rqrs01604(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells))
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnIsolatedTumorCells} not valid code for LN Isolated Tumor Cells (ITC)')
        return true

    }

    // ID: RQRS-01605; TAG: N2901; NAME: LN Isolated Tumor Cells (ITC), Schema ID, Required (NAACCR)
    public boolean rqrs01605(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01606; TAG: N2632; NAME: LN Laterality, Date DX (NAACCR)
    public boolean rqrs01606(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnLaterality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Laterality must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality))
            return true
        if (functions.GEN_AT(untrimmedline.lnLaterality, "012389", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnLaterality} not valid code for LN Laterality')
        return true

    }

    // ID: RQRS-01607; TAG: N2902; NAME: LN Laterality, Schema ID, Required (NAACCR)
    public boolean rqrs01607(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00500", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01608; TAG: N2673; NAME: LN Positive Axillary Level I-II, Date DX (NAACCR)
    public boolean rqrs01608(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2))
            return true
        if (functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X1X5X6X8X9", 2) == 0 && !functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "00-99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnPositiveAxillaryLevel1To2} not valid code for LN Positive Axillary Level I-II')
        return true

    }

    // ID: RQRS-01609; TAG: N2903; NAME: LN Positive Axillary Level I-II, Schema ID, Required (NAACCR)
    public boolean rqrs01609(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01610; TAG: N2648; NAME: LN Size, Date DX (NAACCR)
    public boolean rqrs01610(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] size = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnSize))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Size must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnSize))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.lnSize, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Size must be right justified with one decimal place')
        functions.GEN_STRCPY(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 1, 2))
        functions.GEN_STRCAT(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 4, 1))
        
        if (functions.GEN_AT(size, "XX1XX2XX3XX4XX5XX6XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(size, "(\\s\\d\\d)") && !functions.GEN_MATCH(size, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnSize} not valid code for LN Size')
        return true

    }

    // ID: RQRS-01611; TAG: N3085; NAME: LN Size, Schema ID, Required (NAACCR)
    public boolean rqrs01611(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[140]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00130 00131 00132 00133 00140 00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnSize) || functions.GEN_AT(untrimmedline.lnSize, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01612; TAG: N2633; NAME: LN Status Femoral-Inguinal, Para-Aortic, Pelvic, Date DX (NAACCR)
    public boolean rqrs01612(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Status Femoral-Inguinal, Para-aortic, Pelvic must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic))
            return true
        if (functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "0123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lnStatusFemoralInguinalParaAorticPelvic} not valid code for LN Status Femoral-Inguinal, Para-aortic, Pelvic')
        return true

    }

    // ID: RQRS-01613; TAG: N2867; NAME: LN Status Femoral-Inguinal, Para-Aortic, Pelvic, Schema ID, Required (NAACCR)
    public boolean rqrs01613(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic) || functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01614; TAG: N2743; NAME: Lymphocytosis, Date DX (NAACCR)
    public boolean rqrs01614(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.lymphocytosis))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphocytosis must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.lymphocytosis))
            return true
        if (functions.GEN_AT(untrimmedline.lymphocytosis, "01679", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.lymphocytosis} not valid code for Lymphocytosis')
        return true

    }

    // ID: RQRS-01615; TAG: N2904; NAME: Lymphocytosis, Schema ID, Required (NAACCR)
    public boolean rqrs01615(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00795", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.lymphocytosis))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01617; TAG: N0376; NAME: Lymphoma, EOD--Ext, Summ Stg 1977, ICDO2 (NAACCR)
    public boolean rqrs01617(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodExtension) || functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717")) {
                if (functions.GEN_INLIST(untrimmedline.eodExtension, "10-11")) {
                    if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.eodExtension, "20-21")) {
                        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "5"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.eodExtension, "30-80")) {
                            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                                return true
                            else
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.eodExtension, "99")) {
                                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                                    return true
                                else
                                    return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01618; TAG: N0443; NAME: Lymphoma, EOD--Ext, Summ Stg 2000, ICDO3 (NAACCR)
    public boolean rqrs01618(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodExtension) || functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729")) {
                if (functions.GEN_INLIST(untrimmedline.eodExtension, "10-11")) {
                    if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.eodExtension, "20-21")) {
                        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.eodExtension, "30-80")) {
                            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                                return true
                            else
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.eodExtension, "99")) {
                                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
                                    return true
                                else
                                    return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01619; TAG: N0377; NAME: Lymphoma, EOD--Tumor Size, ICDO2 (NAACCR)
    public boolean rqrs01619(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717")) {
            if (functions.GEN_INLIST(untrimmedline.eodTumorSize, "001,002,999"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01620; TAG: N0453; NAME: Lymphoma, EOD--Tumor Size, ICDO3 (NAACCR)
    public boolean rqrs01620(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.histologyIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729")) {
            if (functions.GEN_INLIST(untrimmedline.eodTumorSize, "001,002,999"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01621; TAG: N0378; NAME: Lymphoma, Prim Site, Summ Stg 1977, ICDO2 (NAACCR)
    public boolean rqrs01621(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01622; TAG: N0379; NAME: Lymphoma, TNM, ICDO2 (NAACCR)
    public boolean rqrs01622(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01623; TAG: N0454; NAME: Lymphoma, TNM, ICDO3 (NAACCR)
    public boolean rqrs01623(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "441, 690, 695, 696", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01625; TAG: N1014; NAME: Lymphovascular Invasion (CS)
    public boolean rqrs01625(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: RQRS-01626; TAG: N4909; NAME: Lymphovascular Invasion (SEER)
    public boolean rqrs01626(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0)
            return false
        
        return true

    }

    // ID: RQRS-01627; TAG: N3965; NAME: Lymphovascular Invasion, Date of Diagnosis (COC)
    public boolean rqrs01627(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
                return false
        }
        functions.GEN_NOOP()
        
        return true

    }

    // ID: RQRS-01628; TAG: N2367; NAME: Lymphovascular Invasion, Date of Dx (SEER)
    public boolean rqrs01628(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (dx_year >= 2010 && dx_year <= 2017) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C600,C601,C602,C608,C609")) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8246,8248-8576,8940-8950,8980-8982"))) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "019", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Primary Site: ${untrimmedline.primarySite}, Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
            }
            else {
                if ((functions.GEN_INLIST(untrimmedline.primarySite, "C620,C621,C629")) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576,8590-8670,8940-8950,8980-8981,9060-9090,9100-9105"))) {
                    if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "019", 1) == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Primary Site: ${untrimmedline.primarySite}, Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion)) {
                        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0189", 1) == 0)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Primary Site: ${untrimmedline.primarySite}, Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
                    }
                }
            }
        }
        if (dx_year >= 2018) {
            if (functions.GEN_AT(untrimmedline.schemaId, "0057000590", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "012349", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion:${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion:${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-01629; TAG: N1957; NAME: Lymphovascular Invasion, Histology, Behav (COC)
    public boolean rqrs01629(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
                return false
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,2")) {
                if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "1"))
                    return functions.GEN_ERROR_MSG(binding, 'If Behavior Code ICD-O-3 = ${untrimmedline.behaviorIcdO3}, Lymphovascular Invasion must not = 1')
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
                    return functions.GEN_ERROR_MSG(binding, 'If Histologic Type ICD-O-3 not = 9590-9992, Lymphovascular Invasion must not = 8')
            }
        }
        return true

    }

    // ID: RQRS-01630; TAG: N1958; NAME: Lymphovascular Invasion, Histology, Behav (CS)
    public boolean rqrs01630(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "1"))
                return functions.GEN_ERROR_MSG(binding, 'If Behavior Code ICD-O-3 = ${untrimmedline.behaviorIcdO3}, Lymphovascular Invasion must not = 1')
        }
        return true

    }

    // ID: RQRS-01631; TAG: N1763; NAME: Lymphovascular Invasion, Penis and Testis (CS)
    public boolean rqrs01631(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year > 2017))
            return true
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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 err_flag
        err_flag = 0
        
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1,"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Penis,Testis")) {
            if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, '_schema_ms')
                return false
            }
        }
        
        return true

    }

    // ID: RQRS-01632; TAG: N4019; NAME: Lymphovascular Invasion, Schema ID (COC)
    public boolean rqrs01632(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31]
        
        int dx_year
        char[] ID1 = new char[375]
        char[] ID2 = new char[200]
        char[] code = new char[7]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        
        functions.GEN_STRCPY(ID1, "00071 00072 00073 00074 00075 00076 00077 00080 00111 00112 ")
        functions.GEN_STRCAT(ID1, "00121 00122 00130 00131 00132 00133 00161 00169 00170 00180 ")
        functions.GEN_STRCAT(ID1, "00190 00200 00301 00302 00320 00340 00460 00470 00530 00541 ")
        functions.GEN_STRCAT(ID1, "00542 00570 00590 00620 00730 00740 00500 00510 00520 00560 ")
        functions.GEN_STRCAT(ID1, "00100 00230 00250 00260 00270 00280 00290 00330 00350 00360 ")
        functions.GEN_STRCAT(ID1, "00090 00310 00760 ")
        
        
        functions.GEN_STRCPY(ID2, "00210 00220 00241 00242 00381 00382 00383 00400 00410 00421 ")
        functions.GEN_STRCAT(ID2, "00422 00440 00450 00480 00580 00600 00610 00631 00632 00640 ")
        functions.GEN_STRCAT(ID2, "00660 00671 00672 00700 00750 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "012349", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must not = 8')
            }
        }
        if (functions.GEN_AT(code, ID2, 6) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        if (functions.GEN_AT(code, ID1, 6) == 0 && functions.GEN_AT(code, ID2, 6) == 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must = 8')
            }
        }
        return true

    }

    // ID: RQRS-01633; TAG: N2905; NAME: Major Vein Involvement, Date DX (NAACCR)
    public boolean rqrs01633(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Major Vein Involvement must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement))
            return true
        if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "0123489", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.majorVeinInvolvement} not valid code for Major Vein Involvement')
        return true

    }

    // ID: RQRS-01634; TAG: N2906; NAME: Major Vein Involvement, Schema ID, Required (NAACCR)
    public boolean rqrs01634(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01635; TAG: N0219; NAME: Marital Status at DX (SEER MARITAL)
    public boolean rqrs01635(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
            return true
        return functions.GEN_INLIST(untrimmedline.maritalStatusAtDx, "1,2,3,4,5,6,9")

    }

    // ID: RQRS-01636; TAG: N0220; NAME: Marital Status at DX, Age at Diagnosis (SEER IF14)
    public boolean rqrs01636(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001542")) {
            dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
            if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
                return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
            else {
                if (dx_year < 2000 || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
                    if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
                        return true
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.ageAtDx) < 15) {
            if (!functions.GEN_INLIST(untrimmedline.maritalStatusAtDx, "1"))
                return false
        }
        return true

    }

    // ID: RQRS-01637; TAG: N2662; NAME: Measured Basal Diameter, Date DX (NAACCR)
    public boolean rqrs01637(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] basal = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Measured Basal Diameter must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.measuredBasalDiameter, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Measured Basal Diameter must be right justified with one decimal place')
        functions.GEN_STRCPY(basal, functions.GEN_SUBSTR(untrimmedline.measuredBasalDiameter, 1, 2))
        functions.GEN_STRCAT(basal, functions.GEN_SUBSTR(untrimmedline.measuredBasalDiameter, 4, 1))
        
        if (functions.GEN_AT(basal, "XX0XX1XX2XX3XX4XX5XX6XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(basal, "(\\s\\d\\d)") && !functions.GEN_MATCH(basal, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.measuredBasalDiameter} not valid code for Measured Basal Diameter')
        return true

    }

    // ID: RQRS-01638; TAG: N2958; NAME: Measured Basal Diameter, Schema ID, Required (NAACCR)
    public boolean rqrs01638(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter) || functions.GEN_AT(untrimmedline.measuredBasalDiameter, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01639; TAG: N2663; NAME: Measured Thickness, Date DX (NAACCR)
    public boolean rqrs01639(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] thickness = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.measuredThickness))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Measured Thickness must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.measuredThickness))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.measuredThickness, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Measured Thickness must be right justified with one decimal place')
        functions.GEN_STRCPY(thickness, functions.GEN_SUBSTR(untrimmedline.measuredThickness, 1, 2))
        functions.GEN_STRCAT(thickness, functions.GEN_SUBSTR(untrimmedline.measuredThickness, 4, 1))
        
        if (functions.GEN_AT(thickness, "XX0XX1XX2XX3XX4XX5XX6XX8XX9", 3) == 0 && !functions.GEN_MATCH(thickness, "(\\s\\d\\d)") && !functions.GEN_MATCH(thickness, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.measuredThickness} not valid code for Measured Thickness')
        return true

    }

    // ID: RQRS-01640; TAG: N2959; NAME: Measured Thickness, Schema ID, Required (NAACCR)
    public boolean rqrs01640(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00660 00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.measuredThickness) || functions.GEN_AT(untrimmedline.measuredThickness, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01641; TAG: N0231; NAME: Medical Record Number (NAACCR)
    public boolean rqrs01641(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.medicalRecordNumber))
            return false
        return functions.GEN_MATCH(untrimmedline.medicalRecordNumber, "(((\\s))*((.))+)") && functions.GEN_JUSTIFIED(untrimmedline.medicalRecordNumber, ((Integer)context.RQRS_GEN_RIGHT))

    }

    // ID: RQRS-01642; TAG: N0380; NAME: Medical Record Number, Date of Diagnosis (COC)
    public boolean rqrs01642(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.medicalRecordNumber))
                return false
        }
        return true

    }

    // ID: RQRS-01643; TAG: N2854; NAME: Medicare Beneficiary Identifier (NAACCR)
    public boolean rqrs01643(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.medicareBeneficiaryIdentifier))
            return true
        if (functions.GEN_MATCH(untrimmedline.medicareBeneficiaryIdentifier, "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])"))
            return true
        return false

    }

    // ID: RQRS-01644; TAG: N2621; NAME: Methylation of O6-Methylguanine-Methyltransferase, Date DX (NAACCR)
    public boolean rqrs01644(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Methylation of O6-Methylguanine-Methyltransferase must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase))
            return true
        if (functions.GEN_AT(untrimmedline.methylationOfO6MethylguanineMethyltransferase, "01236789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.methylationOfO6MethylguanineMethyltransferase} not valid code for Methylation of O6-Methylguanine-Methyltransferase')
        return true

    }

    // ID: RQRS-01645; TAG: N2940; NAME: Methylation of O6-Methylguanine-Methyltransferase, Schema ID, Required (NAACCR)
    public boolean rqrs01645(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase) || functions.GEN_AT(untrimmedline.methylationOfO6MethylguanineMethyltransferase, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01646; TAG: N2597; NAME: Mets at DX-Bone, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01646(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBone, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone=${untrimmedline.metsDxBone} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone = ${untrimmedline.metsDxBone} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Bone = ${untrimmedline.metsDxBone}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01647; TAG: N2051; NAME: Mets at DX-Bone, Date of Diagnosis (SEER)
    public boolean rqrs01647(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxBone)))
                return false
        }
        return true

    }

    // ID: RQRS-01648; TAG: N3023; NAME: Mets at DX-Bone, EOD Mets (SEER)
    public boolean rqrs01648(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBone, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at DX-Bone and EOD Mets conflict')
        }
        return true

    }

    // ID: RQRS-01649; TAG: N2598; NAME: Mets at DX-Brain, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01649(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBrain, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain=${untrimmedline.metsDxBrain} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain = ${untrimmedline.metsDxBrain} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Brain = ${untrimmedline.metsDxBrain}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01650; TAG: N2129; NAME: Mets at DX-Brain, Date of Diagnosis (SEER)
    public boolean rqrs01650(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxBrain)))
                return false
        }
        return true

    }

    // ID: RQRS-01651; TAG: N3024; NAME: Mets at DX-Brain, EOD Mets (SEER)
    public boolean rqrs01651(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBrain))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxBrain, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at DX-Brain and EOD Mets conflict')
        }
        return true

    }

    // ID: RQRS-01652; TAG: N2599; NAME: Mets at DX-Distant LN, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01652(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN=${untrimmedline.metsDxDistantLn} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN = ${untrimmedline.metsDxDistantLn} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at Dx-Distant LN = ${untrimmedline.metsDxDistantLn}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01653; TAG: N2131; NAME: Mets at DX-Distant LN, Date of Diagnosis (SEER)
    public boolean rqrs01653(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxDistantLn)))
                return false
        }
        return true

    }

    // ID: RQRS-01654; TAG: N3025; NAME: Mets at DX-Distant LN, EOD Mets (SEER)
    public boolean rqrs01654(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxDistantLn))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at Dx-Distant LN and EOD Mets conflict')
        }
        return true

    }

    // ID: RQRS-01655; TAG: N2600; NAME: Mets at DX-Liver, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01655(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLiver, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver=${untrimmedline.metsDxLiver} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver = ${untrimmedline.metsDxLiver} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Liver = ${untrimmedline.metsDxLiver}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01656; TAG: N2133; NAME: Mets at DX-Liver, Date of Diagnosis (SEER)
    public boolean rqrs01656(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxLiver)))
                return false
        }
        return true

    }

    // ID: RQRS-01657; TAG: N3026; NAME: Mets at DX-Liver, EOD Mets (SEER)
    public boolean rqrs01657(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLiver))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLiver, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at DX-Liver and EOD Mets conflict')
        }
        return true

    }

    // ID: RQRS-01658; TAG: N2601; NAME: Mets at DX-Lung, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01658(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLung, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung=${untrimmedline.metsDxLung} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung = ${untrimmedline.metsDxLung} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Lung = ${untrimmedline.metsDxLung}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01659; TAG: N2135; NAME: Mets at DX-Lung, Date of Diagnosis (SEER)
    public boolean rqrs01659(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxLung)))
                return false
        }
        return true

    }

    // ID: RQRS-01660; TAG: N3027; NAME: Mets at DX-Lung, EOD Mets (SEER)
    public boolean rqrs01660(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxLung, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at DX-Lung and EOD Mets conflict')
        }
        return true

    }

    // ID: RQRS-01661; TAG: N2602; NAME: Mets at DX-Other, AJCC TNM Clin M, Path M (COC)
    public boolean rqrs01661(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "88", 2) != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other=${untrimmedline.metsDxOther} and AJCC TNM Path M =${untrimmedline.ajccTnmPathM}, AJCC TNM Clin M must not = ${untrimmedline.ajccTnmClinM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther} and AJCC TNM Clin M = ${untrimmedline.ajccTnmClinM}, AJCC TNM Path M must not = ${untrimmedline.ajccTnmPathM}')
            if (functions.GEN_AT(untrimmedline.ajccTnmClinM, "cM0            cM0(i+)        ") != 0 && functions.GEN_AT(untrimmedline.ajccTnmPathM, "cM0            cM0(i+)        ") != 0)
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther}, both AJCC TNM Clin M and AJCC TNM Path M must not = no metastasis')
        }
        return true

    }

    // ID: RQRS-01662; TAG: N2137; NAME: Mets at DX-Other, Date of Diagnosis (SEER)
    public boolean rqrs01662(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
                return false
        }
        if (dx_year < 2016) {
            if (!(functions.GEN_EMPTY(untrimmedline.metsDxOther)))
                return false
        }
        return true

    }

    // ID: RQRS-01663; TAG: N3028; NAME: Mets at DX-Other, EOD Mets (SEER)
    public boolean rqrs01663(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "88", 2) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                return functions.GEN_ERROR_MSG(binding, 'Mets at DX-Other and EOD Mets conflict')
        }
        return true

    }

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

    }

    // ID: RQRS-01665; TAG: N2990; NAME: Microsatellite Instability (MSI), Schema ID, Required (NAACCR)
    public boolean rqrs01665(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.microsatelliteInstability) || functions.GEN_AT(untrimmedline.microsatelliteInstability, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01666; TAG: N2668; NAME: Microvascular Density, Date DX (NAACCR)
    public boolean rqrs01666(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.microvascularDensity))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Microvascular Density must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.microvascularDensity))
            return true
        if (functions.GEN_AT(untrimmedline.microvascularDensity, "X1X2X3X4X5X7X8X9", 2) == 0 && !functions.GEN_INLIST(untrimmedline.microvascularDensity, "00-99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.microvascularDensity} not valid code for Microvascular Density')
        return true

    }

    // ID: RQRS-01667; TAG: N2960; NAME: Microvascular Density, Schema ID, Required (NAACCR)
    public boolean rqrs01667(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.microvascularDensity) || functions.GEN_AT(untrimmedline.microvascularDensity, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01668; TAG: N3935; NAME: Microvascular Density, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01668(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.microvascularDensity) || functions.GEN_AT(untrimmedline.microvascularDensity, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01669; TAG: N2664; NAME: Mitotic Count Uveal Melanoma, Date DX (NAACCR)
    public boolean rqrs01669(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] mitotic = new char[4]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Mitotic Count Uveal Melanoma must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.mitoticCountUvealMelanoma, 3, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Mitotic Count Uveal Melanoma must be right justified with one decimal place')
        functions.GEN_STRCPY(mitotic, functions.GEN_SUBSTR(untrimmedline.mitoticCountUvealMelanoma, 1, 2))
        functions.GEN_STRCAT(mitotic, functions.GEN_SUBSTR(untrimmedline.mitoticCountUvealMelanoma, 4, 1))
        
        if (functions.GEN_AT(mitotic, "XX1XX2XX3XX4XX7XX8XX9", 3) == 0 && !functions.GEN_MATCH(mitotic, "(\\s\\d\\d)") && !functions.GEN_MATCH(mitotic, "((([1-9]))\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.mitoticCountUvealMelanoma} not valid code for Mitotic Count Uveal Melanoma')
        return true

    }

    // ID: RQRS-01670; TAG: N2961; NAME: Mitotic Count Uveal Melanoma, Schema ID, Required (NAACCR)
    public boolean rqrs01670(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma) || functions.GEN_AT(untrimmedline.mitoticCountUvealMelanoma, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01671; TAG: N3936; NAME: Mitotic Count Uveal Melanoma, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01671(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma) || functions.GEN_AT(untrimmedline.mitoticCountUvealMelanoma, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01672; TAG: N2657; NAME: Mitotic Rate Melanoma, Date DX (NAACCR)
    public boolean rqrs01672(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Mitotic Rate Melanoma must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma))
            return true
        if (functions.GEN_AT(untrimmedline.mitoticRateMelanoma, "X1X2X3X4X7X8X9", 2) == 0 && !functions.GEN_INLIST(untrimmedline.mitoticRateMelanoma, "00-99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.mitoticRateMelanoma} not valid code for Mitotic Rate Melanoma')
        return true

    }

    // ID: RQRS-01673; TAG: N2907; NAME: Mitotic Rate Melanoma, Schema ID, Required (NAACCR)
    public boolean rqrs01673(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma) || functions.GEN_AT(untrimmedline.mitoticRateMelanoma, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01674; TAG: N0221; NAME: Morph (1973-91) ICD-O-1 (SEER OMORPnos)
    public boolean rqrs01674(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int i, dx_yr, hist_num, histlimit
        boolean morphflg, test_is_malignant, test_is_benign
        char[] histbeh = new char[6]
        
        morphflg = false
        
        dx_yr = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_yr == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_yr == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_yr > 1987) && (dx_yr < 1992)) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541"))
                return true
        }
        if (dx_yr < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544")) {
                return true
            }
        }
        if (dx_yr > 1991) {
        
            if (!functions.GEN_EMPTY(untrimmedline.histologyIcdO1)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Histology (73-91) ICD-O-1 not valid')
                morphflg = true
            }
            if (!functions.GEN_EMPTY(untrimmedline.behaviorIcdO1)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code (73-91) ICD-O-1 not valid')
                morphflg = true
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradeIcdO1)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade (73-91) ICD-O-1 not valid')
                morphflg = true
            }
        }
        if (morphflg == true) {
            return true
        }
        if (dx_yr < 1992) {
            if (!functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8000-9999", "(\\d\\d\\d\\d)")) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Histology (73-91) ICD-O-1 not valid')
                morphflg = true
            }
            else {
                if (dx_yr < 1986) {
                    histlimit = 9942
        
                    functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1) /* look for Behavior 3 (malignant), first */
                    functions.GEN_STRCAT(histbeh, "3")
        
                    test_is_malignant = functions.GEN_ILOOKUP(histbeh, context.RQRS_OLDMORPH, context.RQRS_OLDMORPH_HISTBEH, [:])
        
                    if (!test_is_malignant) {
                        functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1)
                        functions.GEN_STRCAT(histbeh, "2")
                        test_is_benign = functions.GEN_ILOOKUP(histbeh, context.RQRS_OLDMORPH, context.RQRS_OLDMORPH_HISTBEH, [:])
        
                        if (test_is_benign) {
                            if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Benign Histology (73-91) ICD-O-1 - Review')
                        }
                    }
                }
                else {
                    histlimit = 9950
        
                    if (dx_yr >= 1988) {
                        functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1) /* look for Behavior 3 (malignant), first */
                        functions.GEN_STRCAT(histbeh, "3")
        
                        test_is_malignant = functions.GEN_ILOOKUP(histbeh, context.RQRS_OMORPV88, context.RQRS_OMORPV88_HISTBEH, [:])
                        if (!test_is_malignant) {
                            functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1)
                            functions.GEN_STRCAT(histbeh, "2")
                            test_is_benign = functions.GEN_ILOOKUP(histbeh, context.RQRS_OMORPV88, context.RQRS_OMORPV88_HISTBEH, [:])
        
                            if (test_is_benign) {
                                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Benign Histology (73-91) ICD-O-1 - Review')
                            }
                            else {
                                if ((dx_yr <= 1991) && functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8035,8242,8961,8962,9111,9810,9865,9920"))
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Code Deleted from 1986 Field Trial')
                            }
                        }
                    }
                    else {
                        if (dx_yr >= 1986) {
                            functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1) /* look for Behavior 3 (malignant), first */
                            functions.GEN_STRCAT(histbeh, "3")
        
                            test_is_malignant = functions.GEN_ILOOKUP(histbeh, context.RQRS_OMORPV86, context.RQRS_OMORPV86_HISTBEH, [:])
                            if (!test_is_malignant) {
                                functions.GEN_STRCPY(histbeh, untrimmedline.histologyIcdO1)
                                functions.GEN_STRCAT(histbeh, "2")
                                test_is_benign = functions.GEN_ILOOKUP(histbeh, context.RQRS_OMORPV86, context.RQRS_OMORPV86_HISTBEH, [:])
        
                                if (test_is_benign) {
        
                                    if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Benign Histology (73-91) ICD-O-1 - Review')
                                }
                                else {
                                    if ((dx_yr <= 1987) && functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8035,8242,8961,8962,9111,9810,9865,9920"))
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Code Deleted from 1986 Field Trial')
                                }
                            }
                        }
                    }
                }
            }
        }
        if (dx_yr < 1992) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO1, "2,3")) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code (73-91) ICD-O-1 not valid')
                morphflg = true
            }
        }
        if (dx_yr < 1992) {
            if (functions.GEN_MATCH(untrimmedline.gradeIcdO1, "(\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "0,8")) {
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade (73-91) ICD-O-1 not valid')
                    morphflg = true
                }
                else {
                    hist_num = functions.GEN_VAL(untrimmedline.histologyIcdO1)
                    if (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "5,6,7") && (hist_num < 9590 || hist_num > histlimit)) {
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade (73-91) ICD-O-1 not valid')
                        morphflg = true
                    }
                }
            }
            else {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade (73-91) ICD-O-1 not valid')
                morphflg = true
            }
        }
        morphflg = false
        
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO1, "3") == 0) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8331,8851,9511"))
                morphflg = (functions.GEN_VAL(untrimmedline.gradeIcdO1) != 1)
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9693"))
                    morphflg = (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "2,3,4,8,9"))
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9083"))
                        morphflg = (functions.GEN_VAL(untrimmedline.gradeIcdO1) != 2)
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9621,9694"))
                            morphflg = (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "1,3,4,8,9"))
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9630,9696"))
                                morphflg = (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "1,2,4,8,9"))
                            else {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8020,8021,9062,9082,9401,9451,9512"))
                                    morphflg = (functions.GEN_VAL(untrimmedline.gradeIcdO1) != 4)
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9600"))
                                        morphflg = (functions.GEN_INLIST(untrimmedline.gradeIcdO1, "1,2,3,8,9"))
                                }
                            }
                        }
                    }
                }
            }
            if (morphflg == true)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Oldgrade & Oldhist conflict')
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO1, "2") == 0) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8000-8004,8020,8021,8331,8332,8523,8524") || functions.GEN_INLIST(untrimmedline.histologyIcdO1, "8543,8800-9054,9062,9082,9083") || functions.GEN_INLIST(untrimmedline.histologyIcdO1, "9110-9491,9501-9960"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invalid Oldhist for In Situ')
        }
        return true

    }

    // ID: RQRS-01675; TAG: N0854; NAME: Morph Coding Sys--Curr, Morph Coding Sys--Orig (COC)
    public boolean rqrs01675(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.morphCodingSysCurrent) || functions.GEN_EMPTY(untrimmedline.morphCodingSysOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "9") || functions.GEN_INLIST(untrimmedline.morphCodingSysOriginal, "9"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.morphCodingSysCurrent, untrimmedline.morphCodingSysOriginal) >= 0)
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01676; TAG: N0054; NAME: Morph Coding Sys--Current (NAACCR)
    public boolean rqrs01676(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "2-8,A")

    }

    // ID: RQRS-01677; TAG: N0855; NAME: Morph Coding Sys--Current, Date of DX (NAACCR)
    public boolean rqrs01677(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.histologyIcdO3) && !functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "7,8,A"))
            return functions.GEN_ERROR_MSG(binding, 'If Histologic Type ICD-O-3 is not blank, Morph Coding Sys--Current must = 7, 8, or A')
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year >= 2018) {
            if (!functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "7,8,A"))
                return false
            else
                return true
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (!functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "7,8"))
                return false
            else
                return true
        }
        if (dx_year > 2000) {
            if (!functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "7"))
                return false
            else
                return true
        }
        if (dx_year > 1991) {
            if (!functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "4,5,6,7"))
                return false
            else
                return true
        }
        if (dx_year > 1987) {
            if (!functions.GEN_INLIST(untrimmedline.morphCodingSysCurrent, "3,4,5,6,7"))
                return false
        }
        return true

    }

    // ID: RQRS-01678; TAG: N0472; NAME: Morphology--Type/Behavior ICDO3 (SEER MORPH)
    public boolean rqrs01678(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int morphflg, i, benign_ok
        int dx_year
        char[] histbeh = new char[6]
        
        morphflg = 0
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_HISICDO3_HISTOLOGY, untrimmedline.histologyIcdO3, [:]))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9597,9688,9712,9724,9725,9726,9735,9737,9738,9759,9806") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9807,9808,9809,9811,9812,9813,9814,9815,9816,9817,9818") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9865,9869,9898,9911,9965,9966,9967,9971,9991,9992")) {
                if (dx_year < 2010)
                    return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}) is not allowed if DX year < 2010')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8343") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2")) {
                    if (dx_year < 2017) {
                        if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                            return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} with Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3} not allowed for diagnosis year < 2017')
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8023,8054,8085,8086,8158,8163,8256,8257,8265,8339") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8474,8509,8519,8552,8594,8714,8975,9045,9086,9137,9385") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9395, 9396,9425, 9431, 9432, 9445, 9475, 9476, 9477") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9478, 9509, 9542")) {
                        if (dx_year < 2018)
                            return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3} not allowed if diagnosis year < 2018')
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751,9831,9975") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                            if (dx_year < 2010) {
                                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                                    return functions.GEN_ERROR_MSG(binding, 'If DX year < 2010, Behavior Code ICD-O-3 (${untrimmedline.behaviorIcdO3}) is not allowed for Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3})')
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8311,8825,8842,8983,9302,9341") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                                if (dx_year < 2018) {
                                    if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                                        return functions.GEN_ERROR_MSG(binding, 'if DX year < 2018 Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3} not allowed for Histologic Type ICD-O-3: ${untrimmedline.histologyIcdO3}')
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9421")) {
                                    if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3"))
                                        return functions.GEN_ERROR_MSG(binding, 'Behavior must be 3 for this histology')
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8077")) {
                                        if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
                                            return functions.GEN_ERROR_MSG(binding, 'Behavior must be 2 for this histology')
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO3, "2") == 0 && !functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8005,8020-8021,8331-8332") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-9055,9062-9062,9082-9083") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9110-9493,9501-9989"))
                return functions.GEN_ERROR_MSG(binding, 'Invalid Histology for In Situ - ICDO3')
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8519") && !functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
            return functions.GEN_ERROR_MSG(binding, 'Behavior must be 2 for this histology')
        return true

    }

    // ID: RQRS-01679; TAG: N1388; NAME: Mult Tum Rpt As One Prim, Date of DX (CCCR)
    public boolean rqrs01679(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.multiTumorRptAsOnePrim))
                return false
        }
        if (dx_year < 2008) {
            if (!functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Mult Tum Rpt as One Prim must be blank')
        }
        return true

    }

    // ID: RQRS-01680; TAG: N0900; NAME: Mult Tum Rpt as One Prim, Date of Mult Tum (NAACCR)
    public boolean rqrs01680(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumors) && functions.GEN_EMPTY(untrimmedline.dateOfMultipleTumorsFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "15")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateOfMultipleTumorsFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01681; TAG: N2675; NAME: Multigene Signature Method, Date DX (NAACCR)
    public boolean rqrs01681(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Multigene Signature Method must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod))
            return true
        if (functions.GEN_AT(untrimmedline.multigeneSignatureMethod, "123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.multigeneSignatureMethod} not valid code for Multigene Signature Method')
        return true

    }

    // ID: RQRS-01682; TAG: N2908; NAME: Multigene Signature Method, Schema ID, Required (NAACCR)
    public boolean rqrs01682(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod) || functions.GEN_AT(untrimmedline.multigeneSignatureMethod, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01683; TAG: N2676; NAME: Multigene Signature Results, Date DX (NAACCR)
    public boolean rqrs01683(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Multigene Signature Results must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults))
            return true
        if (functions.GEN_AT(untrimmedline.multigeneSignatureResults, "X1X2X3X4X7X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.multigeneSignatureResults, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.multigeneSignatureResults} not valid code for Multigene Signature Results')
        return true

    }

    // ID: RQRS-01684; TAG: N2909; NAME: Multigene Signature Results, Schema ID, Required (NAACCR)
    public boolean rqrs01684(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults) || functions.GEN_AT(untrimmedline.multigeneSignatureResults, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01685; TAG: N0901; NAME: Multiplicity Cntr, Mult Tum Rpt as One Prim (NAACCR)
    public boolean rqrs01685(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.multiTumorRptAsOnePrim) || functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
            return true
        if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01")) {
            if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.multiTumorRptAsOnePrim, "00")) {
            if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "01"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01686; TAG: N1382; NAME: Multiplicity Counter, Date of DX (CCCR)
    public boolean rqrs01686(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.multiplicityCounter))
                return false
        }
        if (dx_year < 2008) {
            if (!functions.GEN_EMPTY(untrimmedline.multiplicityCounter))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Multiplicity Counter must be blank')
        }
        return true

    }

    // ID: RQRS-01687; TAG: N1615; NAME: Multiplicity Ctr, Lymphoma/Leukem/Unk Site (NAACCR)
    public boolean rqrs01687(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.multiplicityCounter)) || (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
            return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9751-9758,9765-9769,9970"))
                return true
        }
        if (dx_year == 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9732-9733,9735-9738,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992")) || (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
        }
        if (dx_year == 2011) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (!functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3)))
                return true
        }
        if (dx_year > 2010) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C809")) || ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729,9735-9738")) && (functions.GEN_INLIST(untrimmedline.primarySite, "421,770-779", "(C\\d\\d\\d)", 2, 3))) || (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9732-9733,9741-9742,9759-9764,9800-9920,9931-9967,9971-9992"))) {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must = 88')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.multiplicityCounter, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site of ${untrimmedline.primarySite}, Histologic Type ICD-O-3 of ${untrimmedline.histologyIcdO3}, Multiplicity Counter must not = 88')
            }
        }
        
        return true

    }

    // ID: RQRS-01688; TAG: N0209; NAME: Name--Alias (SEER)
    public boolean rqrs01688(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameAlias))
            return true
        if (!functions.GEN_MATCH(untrimmedline.nameAlias, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

    // ID: RQRS-01689; TAG: N0152; NAME: Name--First (COC)
    public boolean rqrs01689(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameFirst))
            return true
        if (!functions.GEN_MATCH(untrimmedline.nameFirst, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

    // ID: RQRS-01690; TAG: N1431; NAME: Name--First (NPCR)
    public boolean rqrs01690(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_MATCH(untrimmedline.nameFirst, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

    // ID: RQRS-01691; TAG: N0155; NAME: Name--Last (COC)
    public boolean rqrs01691(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameLast))
            return false
        if (!functions.GEN_MATCH(untrimmedline.nameLast, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

    // ID: RQRS-01692; TAG: N0265; NAME: Name--Maiden (SEER)
    public boolean rqrs01692(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameMaiden))
            return true
        if (!functions.GEN_MATCH(untrimmedline.nameMaiden, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

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

    }

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

    }

    // ID: RQRS-01695; TAG: N2647; NAME: NCCN International Prognostic Index (IPI), Date DX (NAACCR)
    public boolean rqrs01695(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'NCCN International Prognostic Index (IPI) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex))
            return true
        if (functions.GEN_AT(untrimmedline.nccnInternationalPrognosticIndex, "X1X2X3X4X8X9", 2) == 0 && !functions.GEN_INLIST(untrimmedline.nccnInternationalPrognosticIndex, "00-08"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.nccnInternationalPrognosticIndex} not valid code for NCCN International Prognostic Index (IPI)')
        return true

    }

    // ID: RQRS-01696; TAG: N2946; NAME: NCCN International Prognostic Index (IPI), Schema ID, Required (NAACCR)
    public boolean rqrs01696(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex) || functions.GEN_AT(untrimmedline.nccnInternationalPrognosticIndex, "X8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01698; TAG: N0544; NAME: Next Follow-Up Source, Date of Diagnosis (COC)
    public boolean rqrs01698(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.nextFollowUpSource))
                return false
        }
        return true

    }

    // ID: RQRS-01699; TAG: N0739; NAME: NHIA Derived Hisp Origin (NAACCR)
    public boolean rqrs01699(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nhia))
            return true
        return functions.GEN_INLIST(untrimmedline.nhia, "0-8")

    }

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

    }

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

    }

    // ID: RQRS-01702; TAG: N3018; NAME: NPCR Derived AJCC 8 TNM Clin Stg Grp (NPCR)
    public boolean rqrs01702(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "Occult         0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1E             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2 bulky        2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1           3A2             3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0           3:1             3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6           3:7             3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12          3:13            3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18          3:19            3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24          3:25            4              4A             ")
        functions.GEN_STRCAT(s2_string, "4A1            4A2            4B            4C              4:0            4:1            ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4           4:5             4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10          4:11            4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16          4:17            4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22          4:23            4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             A              B              C              ")
        
        if (functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01703; TAG: N3019; NAME: NPCR Derived AJCC 8 TNM Path Stg Grp (NPCR)
    public boolean rqrs01703(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "Occult         0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1E             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2 bulky        2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1           3A2             3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0           3:1             3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6           3:7             3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12          3:13            3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18          3:19            3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24          3:25            4              4A             ")
        functions.GEN_STRCAT(s2_string, "4B             4C             4:0           4:1             ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4           4:5             4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10          4:11            4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16          4:17            4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22          4:23            4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             3D            ")
        
        if (functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01704; TAG: N3020; NAME: NPCR Derived AJCC 8 TNM Post Therapy Stg Grp (NPCR)
    public boolean rqrs01704(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp))
            return true
        char[] s1_string = new char[1130]
        char[] s2_string = new char[1130]
        
        functions.GEN_STRCPY(s1_string, "Occult         0              0a             0is            1              1A             ")
        functions.GEN_STRCAT(s1_string, "1A1            1A2            1A3            1B             1B1            1B2            ")
        functions.GEN_STRCAT(s1_string, "1C             1S             1:0            1:1            1:2            ")
        functions.GEN_STRCAT(s1_string, "1:3            1:4            1:5            1:6            1:7            1:8            ")
        functions.GEN_STRCAT(s1_string, "1:9            1:10           1:11           1:12           1:13           1:14           ")
        functions.GEN_STRCAT(s1_string, "1:15           1:16           1:17           1:18           1:19           1:20           ")
        functions.GEN_STRCAT(s1_string, "1:21           1:22           1:23           1:24           1:25           2              ")
        functions.GEN_STRCAT(s1_string, "2A             2A1            2A2            2B             2C             2E             ")
        functions.GEN_STRCAT(s1_string, "2:0            2:1            2:2            2:3            2:4            ")
        functions.GEN_STRCAT(s1_string, "2:5            2:6            2:7            2:8            2:9            2:10           ")
        functions.GEN_STRCAT(s1_string, "2:11           2:12           2:13           2:14           2:15           2:16           ")
        functions.GEN_STRCAT(s1_string, "2:17           2:18           2:19           2:20           2:21           2:22           ")
        functions.GEN_STRCAT(s1_string, "2:23           2:24           2:25           ")
        
        functions.GEN_STRCPY(s2_string, "3              3A             3A1           3A2             3B             3C             ")
        functions.GEN_STRCAT(s2_string, "3C1            3C2            3:0           3:1             3:2            3:3            ")
        functions.GEN_STRCAT(s2_string, "3:4            3:5            3:6           3:7             3:8            3:9            ")
        functions.GEN_STRCAT(s2_string, "3:10           3:11           3:12          3:13            3:14           3:15           ")
        functions.GEN_STRCAT(s2_string, "3:16           3:17           3:18          3:19            3:20           3:21           ")
        functions.GEN_STRCAT(s2_string, "3:22           3:23           3:24          3:25            4              4A             ")
        functions.GEN_STRCAT(s2_string, "4B             4C             4:0           4:1             ")
        functions.GEN_STRCAT(s2_string, "4:2            4:3            4:4           4:5             4:6            4:7            ")
        functions.GEN_STRCAT(s2_string, "4:8            4:9            4:10          4:11            4:12           4:13           ")
        functions.GEN_STRCAT(s2_string, "4:14           4:15           4:16          4:17            4:18           4:19           ")
        functions.GEN_STRCAT(s2_string, "4:20           4:21           4:22          4:23            4:24           4:25           ")
        functions.GEN_STRCAT(s2_string, "88             99             3D            ")
        
        if (functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp, s1_string, 15) == 0 && functions.GEN_AT(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp, s2_string, 15) == 0)
            return false
        return true

    }

    // ID: RQRS-01705; TAG: N3967; NAME: NPCR Derived AJCC 8 TNM, Date of Diagnosis, CoC Accredited Flag (NPCR)
    public boolean rqrs01705(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'All AJCC TNM fields must be blank for pre-2018 diagnoses')
        }
        if (dx_year >= 2018) {
        
            if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) || functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0)
                return true
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'NPCR Derived AJCC 8 TNM Clin Stg Grp must not be blank or not applicable for NPCR Derived AJCC 8 TNM Path Stg Grp: ${untrimmedline.npcrDerivedAjcc8TnmPathStgGrp} cases diagnosed 2018 and later')
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) && functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either NPCR Derived AJCC 8 TNM Path Stg Grp or NPCR Derived AJCC 8 TNM Post Therapy Stg Grp, but not both, must be reported for cases diagnosed 2018 and later')
            if (!functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) && !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostTherapyStgGrp))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Either NPCR Derived AJCC 8 TNM Path Stg Grp or NPCR Derived AJCC 8 TNM Post Therapy Stg Grp, but not both, must be reported for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01706; TAG: N2138; NAME: NPCR Derived C Stg Grp, Date of Diagnosis (NPCR)
    public boolean rqrs01706(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7,6"))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedClinStgGrp))
                return false
        }
        return true

    }

    // ID: RQRS-01707; TAG: N2139; NAME: NPCR Derived Clin Stg Grp (NPCR)
    public boolean rqrs01707(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.npcrDerivedClinStgGrp))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedClinStgGrp, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedClinStgGrp, "0A,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,OC,88,99", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedClinStgGrp, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-01708; TAG: N2140; NAME: NPCR Derived P Stg Grp, Date of Diagnosis (NPCR)
    public boolean rqrs01708(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7,6"))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.npcrDerivedPathStgGrp))
                return false
        }
        return true

    }

    // ID: RQRS-01709; TAG: N2141; NAME: NPCR Derived Path Stg Grp (NPCR)
    public boolean rqrs01709(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.npcrDerivedPathStgGrp))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedPathStgGrp, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedPathStgGrp, "0A,1A,1B,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,OC,88,99", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.npcrDerivedPathStgGrp, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-01710; TAG: N1916; NAME: NPCR-CER Height
    public boolean rqrs01710(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.height))
            return true
        if (functions.GEN_INLIST(untrimmedline.height, "00-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01711; TAG: N1917; NAME: NPCR-CER Height, Date of DX
    public boolean rqrs01711(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.height))
            return false
        return true

    }

    // ID: RQRS-01712; TAG: N1918; NAME: NPCR-CER Source Comorbidity
    public boolean rqrs01712(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.sourceComorbidity))
            return true
        if (functions.GEN_INLIST(untrimmedline.sourceComorbidity, "0-5,9"))
            return true
        return false

    }

    // ID: RQRS-01713; TAG: N1919; NAME: NPCR-CER Source Comorbidity, Date of DX
    public boolean rqrs01713(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.sourceComorbidity))
            return false
        return true

    }

    // ID: RQRS-01714; TAG: N1920; NAME: NPCR-CER Tobacco Use Cigarettes
    public boolean rqrs01714(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseCigarettes))
            return true
        if (functions.GEN_INLIST(untrimmedline.tobaccoUseCigarettes, "0-4,9"))
            return true
        return false

    }

    // ID: RQRS-01715; TAG: N1921; NAME: NPCR-CER Tobacco Use Cigarettes, Date of DX
    public boolean rqrs01715(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseCigarettes))
            return false
        return true

    }

    // ID: RQRS-01716; TAG: N1922; NAME: NPCR-CER Tobacco Use NOS
    public boolean rqrs01716(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseNos))
            return true
        if (functions.GEN_INLIST(untrimmedline.tobaccoUseNos, "0-4,9"))
            return true
        return false

    }

    // ID: RQRS-01717; TAG: N1923; NAME: NPCR-CER Tobacco Use NOS, Date of DX
    public boolean rqrs01717(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseNos))
            return false
        return true

    }

    // ID: RQRS-01718; TAG: N1924; NAME: NPCR-CER Tobacco Use Other Smoke
    public boolean rqrs01718(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseOtherSmoke))
            return true
        if (functions.GEN_INLIST(untrimmedline.tobaccoUseOtherSmoke, "0-4,9"))
            return true
        return false

    }

    // ID: RQRS-01719; TAG: N1925; NAME: NPCR-CER Tobacco Use Other Smoke, Date of DX
    public boolean rqrs01719(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseOtherSmoke))
            return false
        return true

    }

    // ID: RQRS-01720; TAG: N1926; NAME: NPCR-CER Tobacco Use Smokeless
    public boolean rqrs01720(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseSmokeless))
            return true
        if (functions.GEN_INLIST(untrimmedline.tobaccoUseSmokeless, "0-4,9"))
            return true
        return false

    }

    // ID: RQRS-01721; TAG: N1927; NAME: NPCR-CER Tobacco Use Smokeless, Date of DX
    public boolean rqrs01721(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tobaccoUseSmokeless))
            return false
        return true

    }

    // ID: RQRS-01722; TAG: N1928; NAME: NPCR-CER Weight
    public boolean rqrs01722(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.weight))
            return true
        if (functions.GEN_INLIST(untrimmedline.weight, "000-999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01723; TAG: N1929; NAME: NPCR-CER Weight, Date of DX
    public boolean rqrs01723(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.addressAtDxState, "AK,CA,CO,FL,ID,LA,NH,NC,RI,TX"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.weight))
            return false
        return true

    }

    // ID: RQRS-01724; TAG: N0875; NAME: NPI--Following Registry (NAACCR)
    public boolean rqrs01724(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.followingRegistryNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.followingRegistryNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Following Registry cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.followingRegistryNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Following Registry must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.followingRegistryNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Following Registry failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01725; TAG: N0873; NAME: NPI--Inst Referred From (NAACCR)
    public boolean rqrs01725(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.institutionReferredFromNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.institutionReferredFromNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred From cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.institutionReferredFromNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred From must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.institutionReferredFromNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred From failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01726; TAG: N0874; NAME: NPI--Inst Referred To (NAACCR)
    public boolean rqrs01726(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.institutionReferredToNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.institutionReferredToNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred To cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.institutionReferredToNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred To must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.institutionReferredToNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Inst Referred To failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01727; TAG: N0880; NAME: NPI--Physician 3 (NAACCR)
    public boolean rqrs01727(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physician3Npi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physician3Npi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 3 cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physician3Npi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 3 must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physician3Npi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 3 failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01728; TAG: N0881; NAME: NPI--Physician 4 (NAACCR)
    public boolean rqrs01728(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physician4Npi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physician4Npi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 4 cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physician4Npi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 4 must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physician4Npi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician 4 failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01729; TAG: N0878; NAME: NPI--Physician--Follow-Up (NAACCR)
    public boolean rqrs01729(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physicianFollowUpNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physicianFollowUpNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Follow-Up cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physicianFollowUpNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Follow-Up must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physicianFollowUpNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Follow-Up failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01730; TAG: N0877; NAME: NPI--Physician--Managing (NAACCR)
    public boolean rqrs01730(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physicianManagingNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physicianManagingNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Managing cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physicianManagingNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Managing must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physicianManagingNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Managing failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01731; TAG: N0879; NAME: NPI--Physician--Prim Surg (NAACCR)
    public boolean rqrs01731(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.physicianPrimarySurgNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.physicianPrimarySurgNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Prim Surg cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.physicianPrimarySurgNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Prim Surg must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.physicianPrimarySurgNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Physician--Prim Surg failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01732; TAG: N0871; NAME: NPI--Registry ID (NAACCR)
    public boolean rqrs01732(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] npi_str = new char[11]
        int i, npi_dig, sum
        
        if (functions.GEN_EMPTY(untrimmedline.registryIdNpi))
            return true
        if (functions.GEN_MATCH(untrimmedline.registryIdNpi, "(0000000000)|(9999999999)"))
            return functions.GEN_ERROR_MSG(binding, 'NPI--Registry ID cannot = 0000000000 or 9999999999')
        if (!functions.GEN_MATCH(untrimmedline.registryIdNpi, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return functions.GEN_ERROR_MSG(binding, 'NPI--Registry ID must be a ten-digit number')
        }
        functions.GEN_STRCPY(npi_str, untrimmedline.registryIdNpi)
        
        sum = 0
        i = 10
        
        while (i != 0) {
            npi_dig = functions.GEN_VAL(functions.GEN_SUBSTR(npi_str, i, 1))
            if ((i % 2) != 0) {
                npi_dig = (npi_dig * 2)
                if (npi_dig > 9)
                    npi_dig = (npi_dig - 9)
            }
            sum = (sum + npi_dig)
            i = (i - 1)
        }
        sum = (sum + 24)
        if ((sum % 10) == 0)
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'NPI--Registry ID failed the NPI check digit validation')
        
        return true

    }

    // ID: RQRS-01733; TAG: N2712; NAME: Number of Cores Examined, Date DX (NAACCR)
    public boolean rqrs01733(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Cores Examined must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X1X6X7X8X9", 2) == 0 && !functions.GEN_INLIST(untrimmedline.numberOfCoresExamined, "01-99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfCoresExamined} not valid code for Number of Cores Examined')
        return true

    }

    // ID: RQRS-01734; TAG: N2910; NAME: Number of Cores Examined, Schema ID, Required (NAACCR)
    public boolean rqrs01734(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined) || functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01735; TAG: N2711; NAME: Number of Cores Positive, Date DX (NAACCR)
    public boolean rqrs01735(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Cores Positive must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X1X6X7X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.numberOfCoresPositive, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfCoresPositive} not valid code for Number of Cores Positive')
        return true

    }

    // ID: RQRS-01736; TAG: N2911; NAME: Number of Cores Positive, Schema ID, Required (NAACCR)
    public boolean rqrs01736(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive) || functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01737; TAG: N2643; NAME: Number of Examined Para-Aortic Nodes, Date DX (NAACCR)
    public boolean rqrs01737(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Examined Para-Aortic Nodes must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1X2X6X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.numberOfExaminedParaAorticNodes, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfExaminedParaAorticNodes} not valid code for Number of Examined Para-Aortic Nodes')
        return true

    }

    // ID: RQRS-01738; TAG: N2912; NAME: Number of Examined Para-Aortic Nodes, Schema ID, Required (NAACCR)
    public boolean rqrs01738(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01739; TAG: N3937; NAME: Number of Examined Para-Aortic Nodes, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01739(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01740; TAG: N2642; NAME: Number of Examined Pelvic Nodes, Date DX (NAACCR)
    public boolean rqrs01740(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Examined Pelvic Nodes must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1X2X6X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.numberOfExaminedPelvicNodes, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfExaminedPelvicNodes} not valid code for Number of Examined Pelvic Nodes')
        return true

    }

    // ID: RQRS-01741; TAG: N2913; NAME: Number of Examined Pelvic Nodes, Schema ID, Required (NAACCR)
    public boolean rqrs01741(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01742; TAG: N3938; NAME: Number of Examined Pelvic Nodes, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01742(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01743; TAG: N2559; NAME: Number of Phases of Rad Treatment to This Volume (COC)
    public boolean rqrs01743(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "000102030499", 2) == 0)
            return false
        return true

    }

    // ID: RQRS-01744; TAG: N2562; NAME: Number of Phases of Radiation, PhI, II, III Radiation Phase (COC)
    public boolean rqrs01744(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        char[] radiation_msg = new char[100]
        
        if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
        }
        if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "01", 2) != 0) {
            if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "01-99") && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I radiation items are coded if 1 phase given")
                functions.GEN_SAVE_TEXT(binding, 'adiation_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
            }
        }
        if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "02", 2) != 0) {
            if ((functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "01-99") && functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00") != 0) || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I and II radiation items are coded if 2 phases given")
                functions.GEN_SAVE_TEXT(binding, 'adiation_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
            }
        }
        if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0304", 2) != 0) {
            if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "01-99"))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I, II, and III radiation items are coded if 3 or 4 phases given")
                functions.GEN_SAVE_TEXT(binding, 'adiation_ms')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
            }
        }
        return true

    }

    // ID: RQRS-01745; TAG: N2641; NAME: Number of Positive Para-Aortic Nodes, Date DX (NAACCR)
    public boolean rqrs01745(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Para-Aortic Nodes must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1X2X6X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.numberOfPositiveParaAorticNodes, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfPositiveParaAorticNodes} not valid code for Number of Positive Para-Aortic Nodes')
        return true

    }

    // ID: RQRS-01746; TAG: N2914; NAME: Number of Positive Para-Aortic Nodes, Schema ID, Required (NAACCR)
    public boolean rqrs01746(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01747; TAG: N3939; NAME: Number of Positive Para-Aortic Nodes, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01747(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01748; TAG: N2640; NAME: Number of Positive Pelvic Nodes, Date DX (NAACCR)
    public boolean rqrs01748(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Pelvic Nodes must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1X2X6X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.numberOfPositivePelvicNodes, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.numberOfPositivePelvicNodes} not valid code for Number of Positive Pelvic Nodes')
        return true

    }

    // ID: RQRS-01749; TAG: N2915; NAME: Number of Positive Pelvic Nodes, Schema ID, Required (NAACCR)
    public boolean rqrs01749(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01750; TAG: N3940; NAME: Number of Positive Pelvic Nodes, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01750(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01751; TAG: N0167; NAME: Occupation Source (NPCR)
    public boolean rqrs01751(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.occupationSource, "0-3,7-9", "(\\d)") || functions.GEN_EMPTY(untrimmedline.occupationSource)

    }

    // ID: RQRS-01752; TAG: N3054; NAME: Oncotype Dx Recurrence Score-DCIS, Breast, Behavior (NAACCR)
    public boolean rqrs01752(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3) || functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX6", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX6", 3) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01753; TAG: N2688; NAME: Oncotype Dx Recurrence Score-DCIS, Date DX (NAACCR)
    public boolean rqrs01753(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Oncotype Dx Recurrence Score-DCIS must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis))
            return true
        if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX6XX7XX8XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.oncotypeDxRecurrenceScoreDcis, "000-100", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.oncotypeDxRecurrenceScoreDcis} not valid code for Oncotype Dx Recurrence Score-DCIS')
        return true

    }

    // ID: RQRS-01754; TAG: N2916; NAME: Oncotype Dx Recurrence Score-DCIS, Schema ID, Required (NAACCR)
    public boolean rqrs01754(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01755; TAG: N3941; NAME: Oncotype Dx Recurrence Score-DCIS, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01755(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01756; TAG: N3055; NAME: Oncotype Dx Recurrence Score-Invasive, Breast, Behavior (NAACCR)
    public boolean rqrs01756(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreInvasive, "XX8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3) || functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreInvasive, "XX6", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreInvasive, "XX6", 3) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01757; TAG: N2687; NAME: Oncotype Dx Recurrence Score-Invasive, Date DX (NAACCR)
    public boolean rqrs01757(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Oncotype Dx Recurrence Score-Invasive must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive))
            return true
        if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreInvasive, "XX4XX5XX6XX7XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.oncotypeDxRecurrenceScoreInvasive, "000-100", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.oncotypeDxRecurrenceScoreInvasive} not valid code for Oncotype Dx Recurrence Score-Invasive')
        return true

    }

    // ID: RQRS-01758; TAG: N2917; NAME: Oncotype Dx Recurrence Score-Invasive, Schema ID, Required (NAACCR)
    public boolean rqrs01758(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive))
                return false
        }
        return true

    }

    // ID: RQRS-01759; TAG: N3974; NAME: Oncotype Dx Risk Level-DCIS, Breast, Behavior (NAACCR)
    public boolean rqrs01759(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3) || functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "3") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6", 3) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01760; TAG: N2690; NAME: Oncotype Dx Risk Level-DCIS, Date DX (NAACCR)
    public boolean rqrs01760(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Oncotype Dx Risk Level-DCIS must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis))
            return true
        if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "0126789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.oncotypeDxRiskLevelDcis} not valid code for Oncotype Dx Risk Level-DCIS')
        return true

    }

    // ID: RQRS-01761; TAG: N2918; NAME: Oncotype Dx Risk Level-DCIS, Schema ID, Required (NAACCR)
    public boolean rqrs01761(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01762; TAG: N3942; NAME: Oncotype Dx Risk Level-DCIS, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01762(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01763; TAG: N3975; NAME: Oncotype Dx Risk Level-Invasive, Breast, Behavior (NAACCR)
    public boolean rqrs01763(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        functions.GEN_NOOP()
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3) || functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6", 3) == 0)
                return false
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO3, "3") == 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01764; TAG: N2689; NAME: Oncotype Dx Risk Level-Invasive, Date DX (NAACCR)
    public boolean rqrs01764(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Oncotype Dx Risk Level-Invasive must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive))
            return true
        if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "0126789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.oncotypeDxRiskLevelInvasive} not valid code for Oncotype Dx Risk Level-Invasive')
        return true

    }

    // ID: RQRS-01765; TAG: N2919; NAME: Oncotype Dx Risk Level-Invasive, Schema ID, Required (NAACCR)
    public boolean rqrs01765(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01766; TAG: N3943; NAME: Oncotype Dx Risk Level-Invasive, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01766(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01767; TAG: N2744; NAME: Organomegaly, Date DX (NAACCR)
    public boolean rqrs01767(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.organomegaly))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Organomegaly must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.organomegaly))
            return true
        if (functions.GEN_AT(untrimmedline.organomegaly, "019", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.organomegaly} not valid code for Organomegaly')
        return true

    }

    // ID: RQRS-01768; TAG: N2920; NAME: Organomegaly, Schema ID, Required (NAACCR)
    public boolean rqrs01768(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00795", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.organomegaly))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01800; TAG: N0756; NAME: Patient System ID-Hosp (NAACCR)
    public boolean rqrs01800(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.patientSysIdHospital))
            return true
        if (functions.GEN_MATCH(untrimmedline.patientSysIdHospital, "(\\d\\d\\d\\d\\d\\d\\d\\d)") && functions.GEN_VAL(untrimmedline.patientSysIdHospital) > 0)
            return true
        else
            return false
        
        return true

    }

    // ID: RQRS-01801; TAG: N2654; NAME: Percent Necrosis Post Neoadjuvant, Date DX (NAACCR)
    public boolean rqrs01801(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] necrosis = new char[5]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_NOOP()
        
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant)) {
            return true
        }
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.percentNecrosisPostNeoadjuvant, 4, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0) {
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant must be right justified with one decimal place')
        }
        functions.GEN_STRCPY(necrosis, functions.GEN_SUBSTR(untrimmedline.percentNecrosisPostNeoadjuvant, 1, 3))
        functions.GEN_STRCAT(necrosis, functions.GEN_SUBSTR(untrimmedline.percentNecrosisPostNeoadjuvant, 5, 1))
        
        if (functions.GEN_AT(necrosis, "XXX2XXX8XXX9", 4) == 0 && !functions.GEN_MATCH(necrosis, "(\\s\\s\\d\\d)") && !functions.GEN_MATCH(necrosis, "(\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(necrosis, "((([1-9]))\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.percentNecrosisPostNeoadjuvant} not valid code for Percent Necrosis Post Neoadjuvant')
        return true

    }

    // ID: RQRS-01802; TAG: N2868; NAME: Percent Necrosis Post Neoadjuvant, Schema ID, Required (NAACCR)
    public boolean rqrs01802(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01803; TAG: N3944; NAME: Percent Necrosis Post Neoadjuvant, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01803(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01804; TAG: N2695; NAME: Perineural Invasion, Date DX (NAACCR)
    public boolean rqrs01804(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.perineuralInvasion))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Perineural Invasion must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.perineuralInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.perineuralInvasion, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.perineuralInvasion} not valid code for Perineural Invasion')
        return true

    }

    // ID: RQRS-01805; TAG: N2962; NAME: Perineural Invasion, Schema ID, Required (NAACCR)
    public boolean rqrs01805(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[27]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00150 00200 00640 00690 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.perineuralInvasion) || functions.GEN_AT(untrimmedline.perineuralInvasion, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01806; TAG: N2746; NAME: Peripheral Blood Involvement, Date DX (NAACCR)
    public boolean rqrs01806(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Peripheral Blood Involvement must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement))
            return true
        if (functions.GEN_AT(untrimmedline.peripheralBloodInvolvement, "012345679", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.peripheralBloodInvolvement} not valid code for Peripheral Blood Involvement')
        return true

    }

    // ID: RQRS-01807; TAG: N2921; NAME: Peripheral Blood Involvement, Schema ID, Required (NAACCR)
    public boolean rqrs01807(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00811", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement))
                return false
        }
        return true

    }

    // ID: RQRS-01808; TAG: N2639; NAME: Peritoneal Cytology, Date DX (NAACCR)
    public boolean rqrs01808(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.peritonealCytology))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Peritoneal Cytology must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.peritonealCytology))
            return true
        if (functions.GEN_AT(untrimmedline.peritonealCytology, "0123789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.peritonealCytology} not valid code for Peritoneal Cytology')
        return true

    }

    // ID: RQRS-01809; TAG: N2922; NAME: Peritoneal Cytology, Schema ID, Required (NAACCR)
    public boolean rqrs01809(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.peritonealCytology) || functions.GEN_AT(untrimmedline.peritonealCytology, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01810; TAG: N4917; NAME: Phase I Radiation (COC)
    public boolean rqrs01810(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00") != 0 && functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "00") != 0 && functions.GEN_AT(untrimmedline.totalDose, "000000") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLymphNodes, "00") == 0 || functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase1DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase1TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00", 2) == 0 || functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "00") == 0 || functions.GEN_AT(untrimmedline.totalDose, "000000") == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationToDrainingLymphNodes, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase1DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase1NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase1TotalDose, "000001-999999") || !functions.GEN_INLIST(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "01-04,99") || !functions.GEN_INLIST(untrimmedline.radiationTreatmentDiscontinuedEarly, "01-99") || !functions.GEN_INLIST(untrimmedline.totalDose, "000001-999999"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0 && functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "99") != 0 && functions.GEN_AT(untrimmedline.totalDose, "999999") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLymphNodes, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase1DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase1TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0 && functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "99") != 0 && functions.GEN_AT(untrimmedline.totalDose, "999999") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationToDrainingLymphNodes, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase1DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase1NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase1TotalDose, "000001-999999") || !functions.GEN_INLIST(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "01-04,99") || !functions.GEN_INLIST(untrimmedline.radiationTreatmentDiscontinuedEarly, "01-99") || !functions.GEN_INLIST(untrimmedline.totalDose, "000001-999999"))
                        return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01811; TAG: N4919; NAME: Phase II Radiation (COC)
    public boolean rqrs01811(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "0099", 2) != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "000199", 2) != 0)
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0001", 2) != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase2RadiationToDrainingLymphNodes, "00") == 0 || functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase2DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase2NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase2TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0001", 2) == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase2RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationToDrainingLymphNodes, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase2DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase2NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase2TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "02030499", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase2RadiationToDrainingLymphNodes, "99") != 0 && functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase2DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase2NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase2TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase2RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationToDrainingLymphNodes, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase2DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase2NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase2TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "02030499", 2) == 0)
                        return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01812; TAG: N4920; NAME: Phase III Radiation (COC)
    public boolean rqrs01812(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "0099", 2) != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00010299", 2) != 0)
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "000102", 2) != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase3RadiationToDrainingLymphNodes, "00") == 0 || functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamPlanningTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase3DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase3NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase3TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "000102", 2) == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase3RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationToDrainingLymphNodes, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase3DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase3NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase3TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "030499", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase3RadiationToDrainingLymphNodes, "99") != 0 && functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamPlanningTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase3DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase3NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase3TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase3RadiationTreatmentModality, "01-16,99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationToDrainingLymphNodes, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationExternalBeamPlanningTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase3DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase3NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase3TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "030499", 2))
                        return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01813; TAG: N2542; NAME: PhI Dose per Fraction (COC)
    public boolean rqrs01813(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1DosePerFraction, "00000-99999", "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01814; TAG: N2543; NAME: PhI Number of Fractions (COC)
    public boolean rqrs01814(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1NumberOfFractions, "000-999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01815; TAG: N2541; NAME: PhI Radiation External Beam Planning Tech (COC)
    public boolean rqrs01815(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationExternalBeamPlanningTech, "00-10, 88, 98, 99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01816; TAG: N4200; NAME: PhI Radiation External Beam Planning Tech, Date DX, CoC Flag (SEER)
    public boolean rqrs01816(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech)) {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "0099", 2) != 0)
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01817; TAG: N2538; NAME: PhI Radiation Primary Treatment Volume (COC)
    public boolean rqrs01817(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00-07, 09-14, 20-26, 29-32, 39-42") || functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "50-68, 70-73, 80-86, 88, 90-99"))
            return true
        return false

    }

    // ID: RQRS-01818; TAG: N2539; NAME: PhI Radiation to Draining Lymph Nodes (COC)
    public boolean rqrs01818(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationToDrainingLymphNodes, "00-08, 88, 99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01819; TAG: N2540; NAME: PhI Radiation Treatment Modality (COC)
    public boolean rqrs01819(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00-16,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01820; TAG: N3901; NAME: PhI Radiation Treatment Modality, Date DX (NAACCR)
    public boolean rqrs01820(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
                return false
        }
        return true

    }

    // ID: RQRS-01821; TAG: N2544; NAME: PhI Total Dose (COC)
    public boolean rqrs01821(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase1TotalDose))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1TotalDose, "000000-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01822; TAG: N3100; NAME: PhI, II, III Primary Treatment Volume, Conversion Codes (COC)
    public boolean rqrs01822(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "949596", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code is obsolete for cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "949596", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code is obsolete for cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "949596", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code is obsolete for cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "97") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code 97 is invalid for cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "97") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code 97 is invalid for cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "97") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation code 97 is invalid for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-01823; TAG: N3097; NAME: PhI, II, III Primary Treatment Volume, Radiation to Draining Nodes (COC)
    public boolean rqrs01823(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLymphNodes))
            return true
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "010203040506070809", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLymphNodes, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume} conflicts with Phase I Radiation to Draining Lymph Nodes: ${untrimmedline.phase1RadiationToDrainingLymphNodes}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "010203040506070809", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationToDrainingLymphNodes, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume} conflicts with Phase II Radiation to Draining Lymph Nodes: ${untrimmedline.phase2RadiationToDrainingLymphNodes}')
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "010203040506070809", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationToDrainingLymphNodes, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume} conflicts with Phase III Radiation to Draining Lymph Nodes: ${untrimmedline.phase3RadiationToDrainingLymphNodes}')
        }
        return true

    }

    // ID: RQRS-01824; TAG: N4201; NAME: PhI, II, III Radiation External Beam Planning Tech (SEER)
    public boolean rqrs01824(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamPlanningTech} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamPlanningTech} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamPlanningTech, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamPlanningTech}')
        }
        return true

    }

    // ID: RQRS-01825; TAG: N3096; NAME: PhI, II, III Radiation Modality, Dose Per Fraction, Total Dose (COC)
    public boolean rqrs01825(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose))
            return true
        if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1DosePerFraction, "99998") == 0 || functions.GEN_AT(untrimmedline.phase1TotalDose, "999998") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase I Dose per Fraction: ${untrimmedline.phase1DosePerFraction} and Phase I Total Dose: ${untrimmedline.phase1TotalDose}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2DosePerFraction, "99998") == 0 || functions.GEN_AT(untrimmedline.phase2TotalDose, "999998") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase II Dose per Fraction: ${untrimmedline.phase2DosePerFraction} and Phase II Total Dose: ${untrimmedline.phase2TotalDose}')
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3DosePerFraction, "99998") == 0 || functions.GEN_AT(untrimmedline.phase3TotalDose, "999998") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality} conflicts with Phase III Dose per Fraction: ${untrimmedline.phase3DosePerFraction} and Phase III Total Dose: ${untrimmedline.phase3TotalDose}')
        }
        return true

    }

    // ID: RQRS-01826; TAG: N3095; NAME: PhI, II, III Radiation Modality, External Beam Planning Tech (COC)
    public boolean rqrs01826(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech))
            return true
        if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "0102030405060708091098", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "0102030405060708091098", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamPlanningTech, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "010203040506")) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamPlanningTech, "0102030405060708091098", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamPlanningTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "13141516", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamPlanningTech, "88") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamPlanningTech}')
        }
        return true

    }

    // ID: RQRS-01827; TAG: N4918; NAME: PhI, II, III Radiation Primary Treatment Volume (COC)
    public boolean rqrs01827(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume} conflicts with Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTreatmentVolume} conflicts with Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume} conflicts with Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTreatmentVolume} conflicts with Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTreatmentVolume}')
        }
        return true

    }

    // ID: RQRS-01828; TAG: N4928; NAME: PhI, II, III Radiation Treatment Modality (SEER)
    public boolean rqrs01828(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality}')
        }
        return true

    }

    // ID: RQRS-01829; TAG: N3098; NAME: PhI, II, III Total Dose, Total Dose (COC)
    public boolean rqrs01829(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose))
            return true
        if (functions.GEN_AT(untrimmedline.phase1TotalDose, "999998") != 0 && (functions.GEN_AT(untrimmedline.phase2TotalDose, "999998000000", 6) != 0 || functions.GEN_EMPTY(untrimmedline.phase2TotalDose)) && (functions.GEN_AT(untrimmedline.phase3TotalDose, "999998000000", 6) != 0 || functions.GEN_EMPTY(untrimmedline.phase3TotalDose))) {
            if (functions.GEN_AT(untrimmedline.totalDose, "999998") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Total Dose: ${untrimmedline.totalDose} conflicts with Phase I Total Dose: ${untrimmedline.phase1TotalDose}, Phase II Total Dose: ${untrimmedline.phase2TotalDose}, and Phase III Total Dose: ${untrimmedline.phase3TotalDose}')
        }
        return true

    }

    // ID: RQRS-01830; TAG: N2545; NAME: PhII Dose per Fraction (COC)
    public boolean rqrs01830(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2DosePerFraction, "00000-99999", "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01831; TAG: N2546; NAME: PhII Number of Fractions (COC)
    public boolean rqrs01831(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2NumberOfFractions, "000-999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01832; TAG: N2548; NAME: PhII Radiation External Beam Planning Tech (COC)
    public boolean rqrs01832(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamPlanningTech))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationExternalBeamPlanningTech, "00-10, 88, 98, 99"))
            return true
        return false

    }

    // ID: RQRS-01833; TAG: N2550; NAME: PhII Radiation Primary Treatment Volume (COC)
    public boolean rqrs01833(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00-07, 09-14, 20-26, 29-32, 39-42") || functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "50-68, 70-73, 80-86, 88, 90-99"))
            return true
        return false

    }

    // ID: RQRS-01834; TAG: N2547; NAME: PhII Radiation to Draining Lymph Nodes (COC)
    public boolean rqrs01834(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationToDrainingLymphNodes, "00-08, 88, 99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01835; TAG: N2549; NAME: PhII Radiation Treatment Modality (COC)
    public boolean rqrs01835(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationTreatmentModality, "00-16,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01836; TAG: N2551; NAME: PhII Total Dose (COC)
    public boolean rqrs01836(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase2TotalDose))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase2TotalDose, "000000-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01837; TAG: N2552; NAME: PhIII Dose per Fraction (COC)
    public boolean rqrs01837(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3DosePerFraction, "00000-99999", "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01838; TAG: N2553; NAME: PhIII Number of Fractions (COC)
    public boolean rqrs01838(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3NumberOfFractions, "000-999", "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01839; TAG: N2555; NAME: PhIII Radiation External Beam Planning Tech (COC)
    public boolean rqrs01839(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamPlanningTech))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationExternalBeamPlanningTech, "00-10, 88, 98, 99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01840; TAG: N2557; NAME: PhIII Radiation Primary Treatment Volume (COC)
    public boolean rqrs01840(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00-07, 09-14, 20-26, 29-32, 39-42") || functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "50-68, 70-73, 80-86, 88, 90-96, 98-99"))
            return true
        return false

    }

    // ID: RQRS-01841; TAG: N2554; NAME: PhIII Radiation to Draining Lymph Nodes (COC)
    public boolean rqrs01841(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationToDrainingLymphNodes, "00-08, 88, 99"))
            return true
        return false

    }

    // ID: RQRS-01842; TAG: N2556; NAME: PhIII Radiation Treatment Modality (COC)
    public boolean rqrs01842(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationTreatmentModality, "00-16,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-01843; TAG: N2558; NAME: PhIII Total Dose (COC)
    public boolean rqrs01843(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.phase3TotalDose))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase3TotalDose, "000000-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

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

    }

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

    }

    // ID: RQRS-01846; TAG: N0381; NAME: Physician--Follow-Up, Date of Diagnosis (COC)
    public boolean rqrs01846(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.physicianFollowUp))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01848; TAG: N0382; NAME: Physician--Primary Surg, Date of Diagnosis (COC)
    public boolean rqrs01848(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.physicianPrimarySurg))
                return false
        }
        return true

    }

    // ID: RQRS-01849; TAG: N0714; NAME: PIN III ICDO3, Date of Diagnosis (SEER IF110)
    public boolean rqrs01849(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8148") && functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01853; TAG: N1761; NAME: Place of Death--Country, Date of Diagnosis (NAACCR)
    public boolean rqrs01853(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XNI,XCB,XEN,XSC,XGR,XYG,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: RQRS-01854; TAG: N1903; NAME: Place of Death--Country, Place of Death--State (NAACCR)
    public boolean rqrs01854(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cntry_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry) || functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        if (functions.GEN_INLIST(untrimmedline.placeOfDeathState, "XX") && functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "ZZX"))
            return false
        functions.GEN_STRCPY(cntry_state, untrimmedline.placeOfDeathCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.placeOfDeathState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.RQRS_CNTRY_ST, context.RQRS_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01858; TAG: N1760; NAME: Place of Death--State, Date of Diagnosis (NAACCR)
    public boolean rqrs01858(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathState, "NN,MM,PP,XN"))
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-01860; TAG: N2672; NAME: Pleural Effusion, Date DX (NAACCR)
    public boolean rqrs01860(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.pleuralEffusion))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Pleural Effusion must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.pleuralEffusion))
            return true
        if (functions.GEN_AT(untrimmedline.pleuralEffusion, "0123489", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.pleuralEffusion} not valid code for Pleural Effusion')
        return true

    }

    // ID: RQRS-01861; TAG: N2869; NAME: Pleural Effusion, Schema ID, Required (NAACCR)
    public boolean rqrs01861(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00370", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.pleuralEffusion) || functions.GEN_AT(untrimmedline.pleuralEffusion, "8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01863; TAG: N1031; NAME: Primary Payer at DX, Date of DX (SEER IF181)
    public boolean rqrs01863(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_EMPTY(untrimmedline.primaryPayerAtDx))
                return false
        }
        return true

    }

    // ID: RQRS-01864; TAG: N2936; NAME: Primary Sclerosing Cholangitis, Date DX (NAACCR)
    public boolean rqrs01864(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Sclerosing Cholangitis must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis))
            return true
        if (functions.GEN_AT(untrimmedline.primarySclerosingCholangitis, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Sclerosing Cholangitis must be blank for cases diagnosed before 2018')
        return true

    }

    // ID: RQRS-01865; TAG: N2937; NAME: Primary Sclerosing Cholangitis, Schema ID, Required (NAACCR)
    public boolean rqrs01865(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00230 00250 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis) || functions.GEN_AT(untrimmedline.primarySclerosingCholangitis, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01866; TAG: N3947; NAME: Primary Sclerosing Cholangitis, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01866(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00230 00250 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis) || functions.GEN_AT(untrimmedline.primarySclerosingCholangitis, "8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01868; TAG: N2298; NAME: Primary Site, AJCC M - Ed 7, ICDO3 (SEER)
    public boolean rqrs01868(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpMCode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpMCode, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmClinM)
            if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_AJC7MC, context.RQRS_AJC7MC_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpMCode, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmPathM)
        if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_AJC7MP, context.RQRS_AJC7MP_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01869; TAG: N2196; NAME: Primary Site, AJCC N - Ed 7, ICDO3 (NPCR)
    public boolean rqrs01869(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
        
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NC, context.RQRS_AJC7NC_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NP, context.RQRS_AJC7NP_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01870; TAG: N2420; NAME: Primary Site, AJCC N - Ed 7, ICDO3 (SEER)
    public boolean rqrs01870(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NCS, context.RQRS_AJC7NCS_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NPS, context.RQRS_AJC7NPS_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01873; TAG: N2333; NAME: Primary Site, AJCC Stage Group - Ed 7 (NPCR)
    public boolean rqrs01873(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9837"))
                            functions.GEN_STRCPY(SiteGrp, "57A")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "57A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9837"))
                functions.GEN_STRCPY(SiteGrp, "57C")
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
            functions.GEN_STRCPY(GrpStg, SiteGrp)
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGC, context.RQRS_AJC7STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
        if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGP, context.RQRS_AJC7STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01874; TAG: N2300; NAME: Primary Site, AJCC Stage Group - Ed 7, ICDO3 (SEER)
    public boolean rqrs01874(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57C")
            else {
                if (functions.GEN_INLIST(SiteGrp, "04C")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                        functions.GEN_STRCPY(SiteGrp, "04D")
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                functions.GEN_STRCPY(SiteGrp, "08A")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                    functions.GEN_STRCPY(SiteGrp, "08B")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "08C")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "08D")) {
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                functions.GEN_STRCPY(SiteGrp, "08D")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "011")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                        functions.GEN_STRCPY(SiteGrp, "16A")
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "021")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                functions.GEN_STRCPY(SiteGrp, "020")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                    functions.GEN_STRCPY(SiteGrp, "022")
                                            }
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9837"))
                            functions.GEN_STRCPY(SiteGrp, "57A")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "57A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9837"))
                functions.GEN_STRCPY(SiteGrp, "57C")
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
            functions.GEN_STRCPY(GrpStg, SiteGrp)
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGC, context.RQRS_AJC7STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
        if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_AJC7STGP, context.RQRS_AJC7STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        }
        return true

    }

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

    }

    // ID: RQRS-01876; TAG: N2301; NAME: Primary Site, AJCC T - Ed 7, ICDO3 (SEER)
    public boolean rqrs01876(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinT, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_AJC7TC, context.RQRS_AJC7TC_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathT, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_AJC7TP, context.RQRS_AJC7TP_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01877; TAG: N0851; NAME: Primary Site, CS Extension (SEER IF176)
    public boolean rqrs01877(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDate, "(1)"))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9140, 9590-9992"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-300") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "069,260-269,390-399,409,419,579,639", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-320") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "479,499", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-400") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C189") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8210,8220,8261,8263")) || functions.GEN_INLIST(untrimmedline.primarySite, "559", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        return true

    }

    // ID: RQRS-01878; TAG: N0464; NAME: Primary Site, EOD, ICDO3 (SEER IF40)
    public boolean rqrs01878(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDate, "(1)"))
            return true
        if (functions.GEN_VAL(untrimmedline.behaviorIcdO3) == 2)
            return true
        if ((functions.GEN_VAL(untrimmedline.eodCodingSys) == 4 && functions.GEN_VAL(untrimmedline.histologyIcdO3) == 9140) || functions.GEN_VAL(untrimmedline.histologyIcdO3) >= 9590)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C189") && !(functions.GEN_MATCH(untrimmedline.histologyIcdO3, "(8210)|(8220)|(8261)|(8263)"))) {
            if ((functions.GEN_VAL(untrimmedline.eodCodingSys) == 0 || functions.GEN_VAL(untrimmedline.eodCodingSys) == 1) && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "4-") == 0)
                return false
            else {
                if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 3 && (functions.GEN_STRCMP(functions.GEN_RIGHT(functions.GEN_LEFT(untrimmedline.eodOld4Digit, 3), 1), "4", 1) < 0 && functions.GEN_STRCMP(functions.GEN_RIGHT(functions.GEN_LEFT(untrimmedline.eodOld4Digit, 3), 1), "0", 1) > 0))
                    return false
                else {
                    if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 4 && (functions.GEN_VAL(untrimmedline.eodExtension) >= 10 && functions.GEN_VAL(untrimmedline.eodExtension) < 31))
                        return false
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 0 || functions.GEN_VAL(untrimmedline.eodCodingSys) == 1) {
            if ((functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "4-", 2) == 0) || (functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-8])|(C809)") && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "5-", 2) == 0))
                return false
        }
        if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 3 && functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && (functions.GEN_STRCMP(functions.GEN_LEFT(functions.GEN_RIGHT(untrimmedline.eodOld4Digit, 2), 1), "4", 1) < 0 && functions.GEN_STRCMP(functions.GEN_LEFT(functions.GEN_RIGHT(untrimmedline.eodOld4Digit, 2), 1), "0", 1) > 0))
            return false
        if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 4) {
            if (functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && (functions.GEN_VAL(untrimmedline.eodExtension) > 9 && functions.GEN_VAL(untrimmedline.eodExtension) < 31))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01883; TAG: N2337; NAME: Primary Site, M 2016 - Ed 7 (SEER)
    public boolean rqrs01883(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpMCode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
            functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmClinM)
        
            if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_SR7M2016, context.RQRS_SR7M2016_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmPathM)
        
        if (!functions.GEN_LOOKUP(t_GrpMCode, context.RQRS_SR7M2016, context.RQRS_SR7M2016_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01884; TAG: N0010; NAME: Primary Site, Morphology-Type ICDO2 (SEER IF25)
    public boolean rqrs01884(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] Site_Lo = new char[5], Site_Hi = new char[5], SitHist = new char[100]
        
        char[] SiteHist = new char[9]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)")) {
            return true
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.RQRS_IF25_REF, context.RQRS_IF25_REF_SITE_LO, ['SITE_LO':Site_Lo, 'SITE_HI':Site_Hi])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Site_Lo) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Site_Hi) <= 0)
                functions.GEN_STRCPY(SiteGrp, Site_Lo)
            else {
                return false
            }
        }
        functions.GEN_STRCPY(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO2, 4)
        
        return functions.GEN_ILOOKUP(SiteHist, context.RQRS_IF25_2, context.RQRS_IF25_2_SITEHIST, [:])

    }

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

    }

    // ID: RQRS-01886; TAG: N2207; NAME: Primary Site, N 2016 - Ed 7 (SEER)
    public boolean rqrs01886(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
        
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_SR7NCL16, context.RQRS_SR7NCL16_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_SR7NPA16, context.RQRS_SR7NPA16_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01887; TAG: N2302; NAME: Primary Site, Stage Group 2016 - Ed 7 (NPCR)
    public boolean rqrs01887(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, if TNM Clin Stage Group or TNM Path Stage Group is coded 88, both should be coded 88')
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88"))
                return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, if TNM Clin Stage Group or TNM Path Stage Group is coded 88, both should be coded 88')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDx) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            functions.GEN_STRCPY(GrpStg, SiteGrp)
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_CC7C2016, context.RQRS_CC7C2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
        
            functions.GEN_STRCPY(GrpStg, SiteGrp)
        
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_CC7P2016, context.RQRS_CC7P2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
            }
        }
        return true

    }

    // ID: RQRS-01888; TAG: N2209; NAME: Primary Site, Stage Group 2016 - Ed 7 (SEER)
    public boolean rqrs01888(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
            functions.GEN_STRCPY(GrpStg, SiteGrp)
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_SR7C2016, context.RQRS_SR7C2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
        
            functions.GEN_STRCPY(GrpStg, SiteGrp)
        
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.RQRS_SR7P2016, context.RQRS_SR7P2016_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
            }
        }
        return true

    }

    // ID: RQRS-01889; TAG: N2211; NAME: Primary Site, T 2016 - Ed 7 (COC-NPCR)
    public boolean rqrs01889(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinT)) && (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathT)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "05B") && functions.GEN_INLIST(untrimmedline.primarySite, "328,329", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
        
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_NP7TCL16, context.RQRS_NP7TCL16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_NP7TPA16, context.RQRS_NP7TPA16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01890; TAG: N2212; NAME: Primary Site, T 2016 - Ed 7 (SEER)
    public boolean rqrs01890(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
        
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_SR7TCL16, context.RQRS_SR7TCL16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_SR7TPA16, context.RQRS_SR7TPA16_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01891; TAG: N2213; NAME: Primary Site, TNM Clin Stage Valid A-Ed 7 (COC)
    public boolean rqrs01891(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[5], CLINN = new char[5], CLINM = new char[5], CLINSPEC = new char[8], CLINSTAGE = new char[6], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[100], PATHN = new char[100], PATHM = new char[100], PATHSPEC = new char[100], PATHSTAGE = new char[100], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[100], SSF15 = new char[100], SSF16 = new char[100], STESTIS = new char[100], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        
        char[] st_msg = new char[79]
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_EMPTY(untrimmedline.tnmClinN) || functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8050, 8140-8147, 8160-8162, 8170-8175, 8180-8221, 8250-8507") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8514-8551,8571-8574, 8576, 8940-8941"))
                functions.GEN_STRCPY(SiteGrp, "10C")
        }
        if (functions.GEN_INLIST(SiteGrp, "10A")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8046, 8051-8131, 8148-8157, 8230-8249, 8508") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8510-8513, 8560-8570, 8575, 8905, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2, c3") && functions.GEN_INLIST(untrimmedline.tnmClinN, "c0") && functions.GEN_INLIST(untrimmedline.tnmClinM, "c0")) {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "150, 151, 153, 154", "(C\\d\\d\\d)", 2, 3))
                        functions.GEN_STRCPY(SiteGrp, "10E")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "152,155,158,159", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "10H")
                    }
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "10D")
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10B")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8050, 8140-8147, 8160-8162, 8170-8175, 8180-8221, 8250-8507") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8514-8551,8571-8574, 8576, 8940-8941"))
                functions.GEN_STRCPY(SiteGrp, "10F")
        }
        if (functions.GEN_INLIST(SiteGrp, "10B")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8046, 8051-8131, 8148-8157, 8230-8249, 8508") || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8510-8513, 8560-8570, 8575, 8905, 8980-8981"))
                functions.GEN_STRCPY(SiteGrp, "10G")
        }
        if (functions.GEN_INLIST(SiteGrp, "027")) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9260, 9364"))
                functions.GEN_STRCPY(SiteGrp, "27B")
            else
                functions.GEN_STRCPY(SiteGrp, "27A")
        }
        if (!functions.GEN_INLIST(SiteGrp, "003,04A,04B,04C,04D,05A,05B,08A,08B,08C,08D,08E,08F,009") && !functions.GEN_INLIST(SiteGrp, "10A,10C,10D,10E,10H,10F,10G,011,012,13A,13B,014,015,16A") && !functions.GEN_INLIST(SiteGrp, "16B,17A,17B,17C,018,019,021,022,023,024,025,026,27A,27B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88")) {
            functions.GEN_STRCPY(cM, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            functions.GEN_STRCAT(cM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            functions.GEN_STRCPY(cM, untrimmedline.tnmClinM)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88")) {
            functions.GEN_STRCPY(cN, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
            functions.GEN_STRCAT(cN, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            functions.GEN_STRCPY(cN, untrimmedline.tnmClinN)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "88")) {
            functions.GEN_STRCPY(cT, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            functions.GEN_STRCAT(cT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            functions.GEN_STRCPY(cT, untrimmedline.tnmClinT)
        if (functions.GEN_INLIST(SiteGrp, "13A")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010, 011"))
                functions.GEN_STRCPY(Spec, "C1")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "020, 021"))
                functions.GEN_STRCPY(Spec, "C2")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "030"))
                functions.GEN_STRCPY(Spec, "C3")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "040"))
                functions.GEN_STRCPY(Spec, "C4")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988, 998, 999"))
                functions.GEN_STRCPY(Spec, "CX")
        }
        if (functions.GEN_INLIST(SiteGrp, "028")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "2"))
                functions.GEN_STRCPY(Spec, "2")
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "3"))
                    functions.GEN_STRCPY(Spec, "3")
                else {
                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                        functions.GEN_STRCPY(Spec, "4")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "9"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "10C,10D,10E,10F,10G,10H, 27A")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "1"))
                functions.GEN_STRCPY(Spec, "1")
            if (functions.GEN_INLIST(untrimmedline.grade, "2"))
                functions.GEN_STRCPY(Spec, "2")
            else {
                if (functions.GEN_INLIST(untrimmedline.grade, "3"))
                    functions.GEN_STRCPY(Spec, "3")
                else {
                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                        functions.GEN_STRCPY(Spec, "3")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "9"))
                            functions.GEN_STRCPY(Spec, "9")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "160-169", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110,991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050,988,990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996,998,999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110,991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050,988,990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996,998,999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16B")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159, 170-179", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "051-100,110, 991"))
                    functions.GEN_STRCPY(Spec, "High")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-050, 988, 990"))
                        functions.GEN_STRCPY(Spec, "Low")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "996, 998, 999"))
                            functions.GEN_STRCPY(Spec, "Unknown")
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "180-189, 199, 209", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "051-100,110, 991"))
                        functions.GEN_STRCPY(Spec, "High")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000-050, 988, 990"))
                            functions.GEN_STRCPY(Spec, "Low")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "996, 998, 999"))
                                functions.GEN_STRCPY(Spec, "Unknown")
                        }
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "051-100,110, 991"))
                            functions.GEN_STRCPY(Spec, "High")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000-050, 988, 990"))
                                functions.GEN_STRCPY(Spec, "Low")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "996, 998, 999"))
                                    functions.GEN_STRCPY(Spec, "Unknown")
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_CLINTNM, SiteGrp)
        functions.GEN_STRCAT(t_CLINTNM, cT)
        functions.GEN_STRCAT(t_CLINTNM, cN)
        functions.GEN_STRCAT(t_CLINTNM, cM)
        
        if (functions.GEN_INLIST(SiteGrp, "025")) {
            if (functions.GEN_INLIST(cT, "X") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "99")) {
                return true
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "16A,16B") && functions.GEN_INLIST(Spec, "Unknown") && functions.GEN_INLIST(cT, "1,2,3,4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "13A") && functions.GEN_INLIST(Spec, "C2,C3,C4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "1A") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "4A")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "27A") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "2,3") && functions.GEN_INLIST(cN, "0,X") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "27A") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "1") && functions.GEN_INLIST(cN, "0,X") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "1,2") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "3") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16A") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "2"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "1,2") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "3") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "2"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "16B") && functions.GEN_INLIST(Spec, "High") && functions.GEN_INLIST(cT, "4") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "3A")) {
            return true
        }
        if (functions.GEN_INLIST(SiteGrp, "10C,10D,10E,10F,10H,10G") && functions.GEN_INLIST(Spec, "2,3,4") && functions.GEN_INLIST(cT, "IS") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10C,10F") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "1A,1B,1") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10C,10F") && functions.GEN_INLIST(Spec, "3,4") && functions.GEN_INLIST(cT, "2") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10D,10G") && functions.GEN_INLIST(Spec, "2,3,4") && functions.GEN_INLIST(cT, "1A,1B,1") && functions.GEN_INLIST(cN, "0") && functions.GEN_INLIST(cM, "0") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10E") && functions.GEN_INLIST(Spec, "2,3,4") && functions.GEN_INLIST(cT, "2,3") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "2A"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "10H") && functions.GEN_INLIST(Spec, "2,3,4") && functions.GEN_INLIST(cT, "2,3") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B"))
            return true
        functions.GEN_STRCPY(st_msg, "Set OR TNM 1 or OR TNM Tis to 1 if codes reviewed and confirmed to be correct")
        
        if (functions.GEN_INLIST(SiteGrp, "10C, 10D, 10E, 10F, 10G, 10H, 13A, 16A, 16B, 27A")) {
            functions.GEN_STRCPY(t_CLINTNMSP, t_CLINTNM)
            functions.GEN_STRCAT(t_CLINTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_CLINTNMSP, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNMSP, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0) {
                    functions.GEN_SAVE_TEXT(binding, 't_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                }
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmClinStageGroup}')
                    }
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "10C, 10D, 10E, 10F, 10G, 10H, 13A, 16A, 16B, 27A")) {
                if (functions.GEN_LOOKUP(t_CLINTNM, context.RQRS_CLST7VAL, context.RQRS_CLST7VAL_GPCTNM, ['GPCODE':GPCODE, 'CLINT':CLINT, 'CLINSTAGE':CLINSTAGE, 'GPCTNM':GPCTNM, 'GPCTNMSP':GPCTNMSP])) {
                    if (functions.GEN_STRCMP(CLINSTAGE, "ERROR") == 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} is invalid for TNM staging')
                    }
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmClinStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), CLINSTAGE) != 0) {
                            functions.GEN_SAVE_TEXT(binding, 't_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmClinT} N${untrimmedline.tnmClinN} M${untrimmedline.tnmClinM} and assigned TNM stage ${untrimmedline.tnmClinStageGroup}')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01892; TAG: N2303; NAME: Primary Site, TNM M - c,p pre2016 (NPCR)
    public boolean rqrs01892(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpMcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
        
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpMcode, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpMcode, untrimmedline.tnmClinM)
            if (!functions.GEN_LOOKUP(t_GrpMcode, context.RQRS_AJC7MC, context.RQRS_AJC7MC_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpMcode, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpMcode, untrimmedline.tnmPathM)
        if (!functions.GEN_LOOKUP(t_GrpMcode, context.RQRS_AJC7MP, context.RQRS_AJC7MP_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01893; TAG: N2305; NAME: Primary Site, TNM N - c,p pre2016 (NPCR)
    public boolean rqrs01893(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NC, context.RQRS_AJC7NC_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.RQRS_AJC7NP, context.RQRS_AJC7NP_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01894; TAG: N2416; NAME: Primary Site, TNM Path Stage Valid B-Ed 7 (COC)
    public boolean rqrs01894(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[100], CLINN = new char[100], CLINM = new char[100], CLINSPEC = new char[100], CLINSTAGE = new char[100], GPCTNM = new char[100], GPCTNMSP = new char[100], GPCTNMSPST = new char[100], GPCTNMST = new char[100]
        char[] PATHT = new char[5], PATHN = new char[5], PATHM = new char[5], PATHSPEC = new char[8], PATHSTAGE = new char[6], GPPTNM = new char[100], GPPTNMSP = new char[100], GPPTNMSPST = new char[100], GPPTNMST = new char[100]
        char[] CLINTNM = new char[100], PATHTNM = new char[100], SSF13 = new char[4], SSF15 = new char[4], SSF16 = new char[4], STESTIS = new char[6], TESTISSSF = new char[100]
        
        char[] cT = new char[5]
        char[] cN = new char[5]
        char[] cM = new char[5]
        char[] pT = new char[5]
        char[] pN = new char[5]
        char[] pM = new char[5]
        char[] Spec = new char[8]
        char[] SValue = new char[6]
        char[] SSFTestis = new char[10]
        int req_flag
        int dx_year
        char[] st_msg = new char[79]
        char[] GL8 = new char[4]
        char[] GL10 = new char[4]
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] t_CLINTNM = new char[18] /*group code TNM*/
        
        char[] t_CLINTNMSP = new char[25] /*group code TNM spec*/
        
        char[] t_PATHTNM = new char[18] /*group code TNM*/
        
        char[] t_PATHTNMSP = new char[25] /*group code TNM spec*/
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4, 6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727, 9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "041")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "001-099"))
                functions.GEN_STRCPY(SiteGrp, "41B")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100-199"))
                    functions.GEN_STRCPY(SiteGrp, "41C")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200-980"))
                        functions.GEN_STRCPY(SiteGrp, "41D")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988, 997, 998, 999"))
                            functions.GEN_STRCPY(SiteGrp, "41A")
                    }
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "029,030,031,032,033,034,035,36A,36B,36C,37A,37B,038,039") && !functions.GEN_INLIST(SiteGrp, "040,41A,41B,41C,41D,042,043,044,045,046,47A,47B,048,049") && !functions.GEN_INLIST(SiteGrp, "51A,51B,052,053,054,055,057,57B"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmPathM, "88")) {
            functions.GEN_STRCPY(pM, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
            functions.GEN_STRCAT(pM, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            functions.GEN_STRCPY(pM, untrimmedline.tnmPathM)
        if (!functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88")) {
                functions.GEN_STRCPY(pN, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
                functions.GEN_STRCAT(pN, " ")
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                functions.GEN_STRCPY(pN, "88  ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            functions.GEN_STRCPY(pN, untrimmedline.tnmPathN)
        if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "88")) {
            functions.GEN_STRCPY(pT, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
            functions.GEN_STRCAT(pT, " ")
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            functions.GEN_STRCPY(pT, untrimmedline.tnmPathT)
        if (functions.GEN_INLIST(SiteGrp, "042")) {
            functions.GEN_STRCPY(SSFTestis, untrimmedline.csSiteSpecificFactor13)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor15)
            functions.GEN_STRCAT(SSFTestis, untrimmedline.csSiteSpecificFactor16)
        
            if (functions.GEN_LOOKUP(SSFTestis, context.RQRS_SVALTEST, context.RQRS_SVALTEST_TESTISSSF, ['STESTIS':STESTIS, 'TESTISSSF':TESTISSSF]))
                functions.GEN_STRCPY(SValue, STESTIS)
            if (functions.GEN_INLIST(SValue, "S0"))
                functions.GEN_STRCPY(Spec, "S0")
            else {
                if (functions.GEN_INLIST(SValue, "S1"))
                    functions.GEN_STRCPY(Spec, "S1")
                else {
                    if (functions.GEN_INLIST(SValue, "S2"))
                        functions.GEN_STRCPY(Spec, "S2")
                    else {
                        if (functions.GEN_INLIST(SValue, "S3"))
                            functions.GEN_STRCPY(Spec, "S3")
                        else {
                            if (functions.GEN_INLIST(SValue, "SX"))
                                functions.GEN_STRCPY(Spec, "SX")
                            else {
                                if (functions.GEN_INLIST(SValue, "ERROR"))
                                    functions.GEN_STRCPY(Spec, "ERROR")
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                functions.GEN_STRCPY(Spec, "000")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                functions.GEN_STRCPY(Spec, "010")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                functions.GEN_STRCPY(Spec, "050")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "110"))
                functions.GEN_STRCPY(Spec, "110")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "150"))
                functions.GEN_STRCPY(Spec, "150")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "200"))
                functions.GEN_STRCPY(Spec, "200")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                functions.GEN_STRCPY(Spec, "988")
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "999"))
                functions.GEN_STRCPY(Spec, "999")
        }
        if (functions.GEN_INLIST(SiteGrp, "57B")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "030"))
                functions.GEN_STRCPY(Spec, "B0NOS")
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                    functions.GEN_STRCPY(Spec, "B0a")
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020"))
                        functions.GEN_STRCPY(Spec, "B0b")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "060"))
                            functions.GEN_STRCPY(Spec, "B1NOS")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "040"))
                                functions.GEN_STRCPY(Spec, "B1a")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "050"))
                                    functions.GEN_STRCPY(Spec, "B1b")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "070"))
                                        functions.GEN_STRCPY(Spec, "B2")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "080, 090, 988,  997, 999"))
                                            functions.GEN_STRCPY(Spec, "BX")
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(t_PATHTNM, SiteGrp)
        functions.GEN_STRCAT(t_PATHTNM, pT)
        functions.GEN_STRCAT(t_PATHTNM, pN)
        functions.GEN_STRCAT(t_PATHTNM, pM)
        
        if (functions.GEN_INLIST(SiteGrp, "41B,41C,41D,41A")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988,998,999"))
                functions.GEN_STRCPY(GL10, "000")
            else
                functions.GEN_STRCPY(GL10, untrimmedline.csSiteSpecificFactor10)
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988,998,999"))
                functions.GEN_STRCPY(GL8, "000")
            else
                functions.GEN_STRCPY(GL8, untrimmedline.csSiteSpecificFactor8)
        }
        if (functions.GEN_INLIST(SiteGrp, "41B,41C,41D,41A")) {
            if (functions.GEN_VAL(GL8) >= functions.GEN_VAL(GL10)) {
                if (functions.GEN_INLIST(GL8, "002, 003,004, 005, 006"))
                    functions.GEN_STRCPY(Spec, "1")
                else {
                    if (functions.GEN_INLIST(GL8, "007"))
                        functions.GEN_STRCPY(Spec, "2")
                    else {
                        if (functions.GEN_INLIST(GL8, "008, 009, 010"))
                            functions.GEN_STRCPY(Spec, "3")
                        else {
                            if (functions.GEN_INLIST(GL8, "000"))
                                functions.GEN_STRCPY(Spec, "9")
                        }
                    }
                }
            }
            else {
        
                if (functions.GEN_INLIST(GL10, "002, 003,004, 005, 006"))
                    functions.GEN_STRCPY(Spec, "1")
                else {
                    if (functions.GEN_INLIST(GL10, "007"))
                        functions.GEN_STRCPY(Spec, "2")
                    else {
                        if (functions.GEN_INLIST(GL10, "008, 009, 010"))
                            functions.GEN_STRCPY(Spec, "3")
                        else {
                            if (functions.GEN_INLIST(GL10, "000"))
                                functions.GEN_STRCPY(Spec, "9")
                        }
                    }
                }
            }
        }
        functions.GEN_STRCPY(st_msg, "Set OR TNM 1 or OR TNM Tis to 1 if codes reviewed and confirmed to be correct")
        if (functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A, 042, 57B")) {
            functions.GEN_STRCPY(t_PATHTNMSP, t_PATHTNM)
            functions.GEN_STRCAT(t_PATHTNMSP, Spec)
        
            if (functions.GEN_LOOKUP(t_PATHTNMSP, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNMSP, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0) {
                    functions.GEN_SAVE_TEXT(binding, 't_ms')
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, invalid forTNM staging')
                }
                else {
                    if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM}, staging parameter for ${untrimmedline.primarySite}, inconsistent with TNM stage ${untrimmedline.tnmPathStageGroup}')
                    }
                }
            }
        }
        else {
            if (!functions.GEN_INLIST(SiteGrp, "039,41B,41C,41D,41A,042, 57B")) {
                if (functions.GEN_LOOKUP(t_PATHTNM, context.RQRS_PAST7VAL, context.RQRS_PAST7VAL_GPPTNM, ['GPCODE':GPCODE, 'PATHT':PATHT, 'PATHSTAGE':PATHSTAGE, 'GPPTNM':GPPTNM, 'GPPTNMSP':GPPTNMSP])) {
                    if (functions.GEN_STRCMP(PATHSTAGE, "ERROR") == 0) {
                        functions.GEN_SAVE_TEXT(binding, 't_ms')
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Combination of T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} is invalid for TNM staging')
                    }
                    else {
                        if (functions.GEN_STRCMP(functions.GEN_TRIM(untrimmedline.tnmPathStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), PATHSTAGE) != 0) {
                            functions.GEN_SAVE_TEXT(binding, 't_ms')
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Inconsistency between TNM categories T${untrimmedline.tnmPathT} N${untrimmedline.tnmPathN} M${untrimmedline.tnmPathM} and assigned TNM stage ${untrimmedline.tnmPathStageGroup}')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-01895; TAG: N2310; NAME: Primary Site, TNM T - c,p pre2016 (NPCR)
    public boolean rqrs01895(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AJC7SIGP, context.RQRS_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinT, 1, 1), "c,p"))
                functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            else
                functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_AJC7TC, context.RQRS_AJC7TC_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathT, 1, 1), "c,p"))
            functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
        else
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.RQRS_AJC7TP, context.RQRS_AJC7TP_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: RQRS-01896; TAG: N2700; NAME: Profound Immune Suppression, Date DX (NAACCR)
    public boolean rqrs01896(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Profound Immune Suppression must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression))
            return true
        if (functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "012345689", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.profoundImmuneSuppression} not valid code for Profound Immune Suppression')
        return true

    }

    // ID: RQRS-01897; TAG: N2870; NAME: Profound Immune Suppression, Schema ID, Required (NAACCR)
    public boolean rqrs01897(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) != 0) {
        
            if (functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression) || functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01898; TAG: N3067; NAME: Profound Immune Suppression, Sequence Number--Central (NAACCR)
    public boolean rqrs01898(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression) || functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.sequenceNumberCentral))
            return true
        if (functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "34", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.sequenceNumberCentral, "00", 2) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01899; TAG: N3057; NAME: Profound Immune Suppression, Sequence Number--Hospital (NAACCR)
    public boolean rqrs01899(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression) || functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.sequenceNumberHosp))
            return true
        if (functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "34", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.sequenceNumberHosp, "00", 2) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01900; TAG: N2679; NAME: Progesterone Receptor Percent Positive or Range, Date DX (NAACCR)
    public boolean rqrs01900(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Progesterone Receptor Percent Positive or Range must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneReceptorPercentPositiveOrRange, "R10R20R30R40R50R60R70R80R90R99XX8XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.progesteroneReceptorPercentPositiveOrRange, "000-100", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.progesteroneReceptorPercentPositiveOrRange} not valid code for Progesterone Receptor Percent Positive or Range')
        return true

    }

    // ID: RQRS-01901; TAG: N2923; NAME: Progesterone Receptor Percent Positive or Range, Schema ID, Required (NAACCR)
    public boolean rqrs01901(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange) || functions.GEN_AT(untrimmedline.progesteroneReceptorPercentPositiveOrRange, "XX8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01902; TAG: N3945; NAME: Progesterone Receptor Percent Positive or Range, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01902(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange) || functions.GEN_AT(untrimmedline.progesteroneReceptorPercentPositiveOrRange, "XX8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01904; TAG: N2924; NAME: Progesterone Receptor Summary, Schema ID, Required (NAACCR)
    public boolean rqrs01904(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorSummary))
                return false
        }
        return true

    }

    // ID: RQRS-01905; TAG: N2680; NAME: Progesterone Receptor Total Allred Score, Date DX (NAACCR)
    public boolean rqrs01905(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Progesterone Receptor Total Allred Score must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneReceptorTotalAllredScore, "000102030405060708X8X9", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.progesteroneReceptorTotalAllredScore} not valid code for Progesterone Receptor Total Allred Score')
        return true

    }

    // ID: RQRS-01906; TAG: N2925; NAME: Progesterone Receptor Total Allred Score, Schema ID, Required (NAACCR)
    public boolean rqrs01906(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore) || functions.GEN_AT(untrimmedline.progesteroneReceptorTotalAllredScore, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01907; TAG: N3946; NAME: Progesterone Receptor Total Allred Score, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01907(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore) || functions.GEN_AT(untrimmedline.progesteroneReceptorTotalAllredScore, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01908; TAG: N2705; NAME: Prostate Pathological Extension, Date DX (SEER)
    public boolean rqrs01908(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Prostate Pathological Extension must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
            return true
        if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "000250300350400500600700800900950999", 3) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.prostatePathologicalExtension} not valid code for Prostate Pathological Extension')
        return true

    }

    // ID: RQRS-01909; TAG: N3063; NAME: Prostate Pathological Extension, Schema ID, Required (SEER)
    public boolean rqrs01909(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
                return false
        }
        return true

    }

    // ID: RQRS-01910; TAG: N2737; NAME: PSA (Prostatic Specific Antigen) Lab Value, Date DX (NAACCR)
    public boolean rqrs01910(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] PSA = new char[6]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.psaLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.psaLabValue))
            return true
        functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(untrimmedline.psaLabValue, 4, 1))
        
        if (functions.GEN_AT(decimal, ".") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must be right justified with one decimal place')
        functions.GEN_STRCPY(PSA, functions.GEN_SUBSTR(untrimmedline.psaLabValue, 1, 3))
        functions.GEN_STRCAT(PSA, functions.GEN_SUBSTR(untrimmedline.psaLabValue, 5, 1))
        
        if (functions.GEN_AT(PSA, "XXX1XXX7XXX9", 4) == 0 && !functions.GEN_MATCH(PSA, "(\\s\\s0(([1-9])))") && !functions.GEN_MATCH(PSA, "(\\s\\s(([1-9]))\\d)") && !functions.GEN_MATCH(PSA, "(\\s(([1-9]))\\d\\d)") && !functions.GEN_MATCH(PSA, "((([1-9]))\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.psaLabValue} not valid code for PSA (Prostatic Specific Antigen) Lab Value')
        return true

    }

    // ID: RQRS-01911; TAG: N2991; NAME: PSA (Prostatic Specific Antigen) Lab Value, Schema ID, Required (NAACCR)
    public boolean rqrs01911(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.psaLabValue))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01914; TAG: N2840; NAME: Radiation Items, DX Post 2017 (COC)
    public boolean rqrs01914(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.radBoostDoseCgy)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--Boost Dose cGy must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.radBoostRxModality)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--Boost RX Modality must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--No of Treatments Vol must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--Regional Dose: cGy must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--Regional RX Modality must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.radTreatmentVolume)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, Rad--Treatment Volume must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-01915; TAG: N2828; NAME: Radiation Phases, Date DX (COC)
    public boolean rqrs01915(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.totalDose))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Total Dose must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.radiationTreatmentDiscontinuedEarly))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation Treatment Discontinued Early must be reported for diagnosis date 2018+')
        }
        return true

    }

    // ID: RQRS-01916; TAG: N2560; NAME: Radiation Treatment Discontinued Early (COC)
    public boolean rqrs01916(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radiationTreatmentDiscontinuedEarly))
            return true
        if (functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "000102030405060799", 2) == 0)
            return false
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01922; TAG: N1604; NAME: Rad--Regional RX Modality, Date of Diagnosis (NPCR)
    public boolean rqrs01922(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2006 || dx_year > 2017) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2006-2014, Histologic Type ICD-O-3 = ${untrimmedline.histologyIcdO3} and Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()}, Primary Site cannot be blank')
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015-2017, Rad--Regional RX Modality must be reported')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01925; TAG: N1614; NAME: Reason for No Radiation, Date of DX (NPCR)
    public boolean rqrs01925(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, Reason for No Radiation cannot be blank')
        }
        return true

    }

    // ID: RQRS-01926; TAG: N2567; NAME: Reason for No Radiation, Number of Phases of Rad Treatment (COC)
    public boolean rqrs01926(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0102030499", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0099", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "99") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-01927; TAG: N3969; NAME: Reason for No Radiation, PhI Radiation Treatment Modality (NAACCR)
    public boolean rqrs01927(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,99"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "0099", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-01928; TAG: N2565; NAME: Reason for No Radiation, PhI, II, III Radiation (COC)
    public boolean rqrs01928(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "01-99"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "0099", 2) != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "0099", 2) != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "0099", 2) != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "99") != 0 && (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLymphNodes) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamPlanningTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLymphNodes, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamPlanningTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase1DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase1TotalDose, "999999") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTreatmentVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTreatmentVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTreatmentVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTreatmentVolume)))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-01929; TAG: N2566; NAME: Reason for No Radiation, Radiation Treatment Discontinued Early (COC)
    public boolean rqrs01929(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.radiationTreatmentDiscontinuedEarly))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "0102030405060799", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "00") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "0099", 2) == 0)
                return false
            else {
                if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
                    if (functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "99") == 0)
                        return false
                }
            }
        }
        return true

    }

    // ID: RQRS-01930; TAG: N2568; NAME: Reason for No Radiation, Total Dose (COC)
    public boolean rqrs01930(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0", 1) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.totalDose, "000001-999999"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.totalDose, "000000") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.totalDose, "000000999999", 6) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.totalDose, "999999") == 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-01932; TAG: N0812; NAME: Reason for No Surgery, Date of DX (NPCR)
    public boolean rqrs01932(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005) {
            if (functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery))
                return false
        }
        return true

    }

    // ID: RQRS-01933; TAG: N0834; NAME: Reason for No Surgery, DateDX, RptSrc (SEER IF57)
    public boolean rqrs01933(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 1988 && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "2"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0,6,8,9"))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (dx_year <= 2002 || (dx_year >= 1984 && dx_year <= 2002 && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "2"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                        if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0-2, 6-9"))
                            return true
                        else
                            return false
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0-2, 5-9"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01941; TAG: N2357; NAME: Regional Nodes Examined, Date of Dx (SEER)
    public boolean rqrs01941(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01944; TAG: N2358; NAME: Regional Nodes Positive, Date of Dx (SEER)
    public boolean rqrs01944(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
                return false
        }
        return true

    }

    // ID: RQRS-01945; TAG: N3964; NAME: Regional Nodes Positive, Examined, Schema ID (NAACCR)
    public boolean rqrs01945(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int rnp, rne
        char[] ID = new char[55]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        
        functions.GEN_STRCPY(ID, "00560 00721 00722 00723 00790 00795 00821 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive and Examined must both = 99 for this Schema, site/histology')
            else
                return true
        }
        
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01952; TAG: N2926; NAME: Residual Tumor Volume Post Cytoreduction, Date DX (NAACCR)
    public boolean rqrs01952(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction))
            return true
        if (functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "001020304090919293979899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.residualTumorVolumePostCytoreduction} not valid code for Residual Tumor Volume Post Cytoreduction')
        return true

    }

    // ID: RQRS-01953; TAG: N3058; NAME: Residual Tumor Volume Post Cytoreduction, Gynecologic, Surg Prim Site, Seq (NAACCR)
    public boolean rqrs01953(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.schemaId, 4), "0055", 4) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction) || functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "98") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-57")) {
            if (functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "97", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction: ${untrimmedline.residualTumorVolumePostCytoreduction} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "10309092", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "24") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction: ${untrimmedline.residualTumorVolumePostCytoreduction} conflicts with RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurgSeq}')
        }
        if (functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "20409193", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "2467") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction: ${untrimmedline.residualTumorVolumePostCytoreduction} conflicts with RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurgSeq}')
        }
        return true

    }

    // ID: RQRS-01954; TAG: N2927; NAME: Residual Tumor Volume Post Cytoreduction, Schema ID, Required (NAACCR)
    public boolean rqrs01954(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00550 00551 00552 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction) || functions.GEN_AT(untrimmedline.residualTumorVolumePostCytoreduction, "98") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01955; TAG: N2674; NAME: Response to Neoadjuvant Therapy, Date DX (NAACCR)
    public boolean rqrs01955(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Response to Neoadjuvant Therapy must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "0123489", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.responseToNeoadjuvantTherapy} not valid code for Response to Neoadjuvant Therapy')
        return true

    }

    // ID: RQRS-01956; TAG: N2963; NAME: Response to Neoadjuvant Therapy, Schema ID, Required (NAACCR)
    public boolean rqrs01956(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy) || functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01957; TAG: N3948; NAME: Response to Neoadjuvant Therapy, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs01957(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy) || functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-01958; TAG: N2530; NAME: RQRS NCDB Submission Flag (COC)
    public boolean rqrs01958(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rqrsNcdbSubmissionFlag))
            return true
        if (functions.GEN_AT(untrimmedline.rqrsNcdbSubmissionFlag, "12", 1) != 0)
            return true
        return false

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-01965; TAG: N4204; NAME: RX Coding System--Current, Date DX (NAACCR)
    public boolean rqrs01965(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year >= 2018) {
            if (functions.GEN_INLIST(untrimmedline.rxCodingSysCurrent, "08", "(\\d\\d)"))
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-01966; TAG: N1071; NAME: RX Date BRM Flag (NAACCR)
    public boolean rqrs01966(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

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

    }

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

    }

    // ID: RQRS-01969; TAG: N3980; NAME: RX Date BRM, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01969(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01970; TAG: N1426; NAME: RX Date BRM, Date Flag, DX Date (NPCR)
    public boolean rqrs01970(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        
        return true

    }

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

    }

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

    }

    // ID: RQRS-01973; TAG: N3978; NAME: RX Date Chemo, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01973(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01974; TAG: N1425; NAME: RX Date Chemo, Date Flag, DX Date (NPCR)
    public boolean rqrs01974(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-01975; TAG: N0073; NAME: RX Date Hormone (COC)
    public boolean rqrs01975(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateHormone))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Hormone: %DC')
            return false
        }
        
        return true

    }

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

    }

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

    }

    // ID: RQRS-01978; TAG: N3979; NAME: RX Date Hormone, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01978(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01979; TAG: N1427; NAME: RX Date Hormone, Date Flag, DX Date (NPCR)
    public boolean rqrs01979(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-01980; TAG: N4905; NAME: RX Date Mst Defn Srg, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01980(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01981; TAG: N1996; NAME: RX Date Mst Defn Srg, Date Flag, DX Date (NPCR)
    public boolean rqrs01981(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return false
        }
        
        return true

    }

    // ID: RQRS-01982; TAG: N2030; NAME: RX Date Mst Defn Srg, Date Last Contact (NPCR)
    public boolean rqrs01982(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfLastContact, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-01984; TAG: N2032; NAME: RX Date Mst Defn Srg, Surg Prim Site (NPCR)
    public boolean rqrs01984(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Date Mst Defn Srg Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
        
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10, 12"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis < 2012, RX Date Mst Defn Srg Flag must = 10 or 12')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, if year of Date of Diagnosis > 2011, RX Date Mst Defn Srg Flag must = 10')
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Mst Defn Srg is blank, if year of Date of Diagnosis < 2012, RX Date Mst Defn Srg Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and RX Date Mst Defn Srg is blank, if year of Date of Diagnosis > 2011, RX Date Mst Defn Srg Flag must = 12')
                }
            }
        }
        return true

    }

    // ID: RQRS-01985; TAG: N3981; NAME: RX Date Other, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01985(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01986; TAG: N1424; NAME: RX Date Other, Date Flag, DX Date (NPCR)
    public boolean rqrs01986(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Other and RX Date Other Flag cannot both be blank')
        }
        
        return true

    }

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

    }

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

    }

    // ID: RQRS-01989; TAG: N3977; NAME: RX Date Radiation, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01989(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01990; TAG: N1602; NAME: RX Date Radiation, Date Flag, DX Date (NPCR)
    public boolean rqrs01990(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Radiation and RX Date Radiation Flag cannot both be blank')
        }
        
        return true

    }

    // ID: RQRS-01991; TAG: N3968; NAME: RX Date Radiation, PhI Radiation Treatment Modality (NAACCR)
    public boolean rqrs01991(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-01992; TAG: N3099; NAME: RX Date Radiation, Radiation Items (COC)
    public boolean rqrs01992(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume) && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.radiationTreatmentDiscontinuedEarly) && functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_AT(untrimmedline.rxDateRadiationFlag, "11") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "00") == 0 || functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") == 0 || functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "00") == 0 || functions.GEN_AT(untrimmedline.totalDose, "000000") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-01993; TAG: N2035; NAME: RX Date Radiation, Rad--Location of RX (OLD)
    public boolean rqrs01993(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0"))
                return true
            else
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-01996; TAG: N3976; NAME: RX Date Surgery, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01996(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
                return false
        }
        return true

    }

    // ID: RQRS-01997; TAG: N1422; NAME: RX Date Surgery, Date Flag, DX Date (NPCR)
    public boolean rqrs01997(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2010) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
                return false
        }
        
        return true

    }

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

    }

    // ID: RQRS-01999; TAG: N3982; NAME: RX Date Systemic, Date Flag, Date DX, CoC Flag (SEER)
    public boolean rqrs01999(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02008; TAG: N0610; NAME: RX Hosp--Scope Reg LN Sur, Primary Site,ICDO2 (COC)
    public boolean rqrs02008(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-02009; TAG: N0611; NAME: RX Hosp--Scope Reg LN Sur, Primary Site,ICDO3 (COC)
    public boolean rqrs02009(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year > 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3) || functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year == 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "761-768,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C760") != 0)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02010; TAG: N0984; NAME: RX Hosp--Surg App 2010, Date of Diagnosis (COC)
    public boolean rqrs02010(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02014; TAG: N0819; NAME: RX Summ--BRM, Date of DX (NPCR)
    public boolean rqrs02014(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--BRM cannot be blank')
        }
        return true

    }

    // ID: RQRS-02015; TAG: N0291; NAME: RX Summ--BRM, DateDX, RptSrc (SEER IF63)
    public boolean rqrs02015(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if ((functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis)) && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if ((dx_year < 1988) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,88,99", "(\\d\\d)"))
                return true
            else
                return false
        }
        else {
            if (((dx_year >= 1988) && (dx_year <= 2002)) || ((dx_year < 2003) && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,87,88,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2002) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,82,85-88,99", "(\\d\\d)"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02018; TAG: N0817; NAME: RX Summ--Chemo, Date of DX (NPCR)
    public boolean rqrs02018(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Chemo cannot be blank')
        }
        return true

    }

    // ID: RQRS-02019; TAG: N0292; NAME: RX Summ--Chemo, DateDX, RptSrc (SEER IF61)
    public boolean rqrs02019(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if ((dx_year < 1988) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,01,88,99", "(\\d\\d)"))
                return true
            else
                return false
        }
        else {
            if (((dx_year >= 1988) && (dx_year <= 2002)) || ((dx_year < 2003) && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,87,88,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2002) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,82,85-88,99", "(\\d\\d)"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02023; TAG: N0818; NAME: RX Summ--Hormone, Date of DX (NPCR)
    public boolean rqrs02023(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Hormone cannot be blank')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02026; TAG: N0825; NAME: RX Summ--Other (NPCR)
    public boolean rqrs02026(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6-9")

    }

    // ID: RQRS-02027; TAG: N0820; NAME: RX Summ--Other, Date of DX (NPCR)
    public boolean rqrs02027(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Other cannot be blank')
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02034; TAG: N4022; NAME: RX Summ--Radiation, Date of Diagnosis (NPCR)
    public boolean rqrs02034(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2006 || dx_year > 2017) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation))
                return false
        }
        if (dx_year > 2014 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For diagnosis year 2015-2017, RX Summ--Radiation cannot be blank')
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02044; TAG: N0779; NAME: RX Summ--Scope Reg 98-02, Date of DX (SEER IF98)
    public boolean rqrs02044(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
                return false
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02049; TAG: N0729; NAME: RX Summ--Scope Reg LN Sur, Date of DX (NPCR)
    public boolean rqrs02049(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return false
        }
        return true

    }

    // ID: RQRS-02050; TAG: N0780; NAME: RX Summ--Scope Reg LN Sur, Date of DX (SEER IF100)
    public boolean rqrs02050(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return true
            else
                return false
        }
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return false
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02054; TAG: N0781; NAME: RX Summ--Surg Oth 98-02, Date of DX (SEER IF99)
    public boolean rqrs02054(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
                return false
            else
                return true
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02057; TAG: N0730; NAME: RX Summ--Surg Oth Reg/Dis, Date of DX (NPCR)
    public boolean rqrs02057(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02060; TAG: N0728; NAME: RX Summ--Surg Prim Site, Date of DX (NPCR)
    public boolean rqrs02060(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
        }
        return true

    }

    // ID: RQRS-02061; TAG: N0599; NAME: RX Summ--Surg Prim Site, Date of DX (SEER IF102)
    public boolean rqrs02061(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return true
            else
                return false
        }
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
            else
                return true
        }
        if (dx_year > 1997) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
            else
                return true
        }
        return true

    }

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

    }

    // ID: RQRS-02063; TAG: N0783; NAME: RX Summ--Surg Site 98-02, Date of DX (SEER IF103)
    public boolean rqrs02063(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-02064; TAG: N0635; NAME: RX Summ--Surg Site 98-02, Diag Conf (SEER IF106)
    public boolean rqrs02064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.overRideSurgDxConf, "1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "10-90")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02067; TAG: N2352; NAME: RX Summ--Surg/Rad Seq, Date of DX (NPCR)
    public boolean rqrs02067(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006 && dx_year < 2016) {
            if (((functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3))) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")) && (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)))
                return false
        }
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02073; TAG: N0493; NAME: RX Summ--Surgery, Reason for No Surgery (SEER IF51)
    public boolean rqrs02073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "01-07", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,2,6-8"))
                return false
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgeryType) > 9) {
            if (functions.GEN_STRCMP(untrimmedline.reasonForNoSurgery, "0") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02075; TAG: N0576; NAME: RX Summ--Surgical Approch, Date of DX (COC)
    public boolean rqrs02075(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalApproach))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02080; TAG: N1607; NAME: RX Summ--Systemic/Sur Seq, Date of DX (NPCR)
    public boolean rqrs02080(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005 && dx_year < 2016) {
            if (((functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3))) && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")) && (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq)))
                return false
        }
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq))
                return false
        }
        return true

    }

    // ID: RQRS-02081; TAG: N0794; NAME: RX Summ--Systemic/Sur Seq, Date of DX (SEER IF154)
    public boolean rqrs02081(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq))
                return false
        }
        if (dx_year < 2006) {
            if (!functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2006, then RX Summ--Systemic/Sur Seq must be blank')
        }
        if (dx_year < 2012) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSystemicSurgSeq, "7"))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2012, then RX Summ--Systemic/Sur Seq cannot be 7')
        }
        return true

    }

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

    }

    // ID: RQRS-02083; TAG: N0836; NAME: RX Summ--Transplnt/Endocr, Date of DX (NPCR)
    public boolean rqrs02083(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Transplnt/Endocr cannot be blank')
        }
        return true

    }

    // ID: RQRS-02084; TAG: N0601; NAME: RX Summ--Transplnt/Endocr, DateDX, Rpt (SEER IF104)
    public boolean rqrs02084(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) {
                if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (dx_year < 2003) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,10-12,20,30,40,87,88,99", "(\\d\\d)"))
                return false
        }
        if (dx_year > 2002) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,10-12,20,30,40,82,85-88,99", "(\\d\\d)"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02086; TAG: N1601; NAME: RX Summ--Treatm Stat, Treatment (COC)
    public boolean rqrs02086(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0,2")) {
                if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8") && (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00") && dx_year >= 2018))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9") || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "99") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "99") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "99") && dx_year >= 2018)) {
        
                        if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9") && (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00,99") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00,99") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "00,99") && dx_year >= 2018))
                            return true
                        else
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                    }
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-02087; TAG: N1608; NAME: RX Summ--Treatment Status, Date of DX (NPCR)
    public boolean rqrs02087(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Treatment Status cannot be blank')
        }
        return true

    }

    // ID: RQRS-02088; TAG: N2738; NAME: S Category Clinical, Date DX (NAACCR)
    public boolean rqrs02088(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'S Category Clinical must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.sCategoryClinical))
            return true
        if (functions.GEN_AT(untrimmedline.sCategoryClinical, "01239", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.sCategoryClinical} not valid code for S Category Clinical')
        return true

    }

    // ID: RQRS-02089; TAG: N2928; NAME: S Category Clinical, Schema ID, Required (NAACCR)
    public boolean rqrs02089(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.sCategoryClinical))
                return false
        }
        return true

    }

    // ID: RQRS-02090; TAG: N2739; NAME: S Category Pathological, Date DX (NAACCR)
    public boolean rqrs02090(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryPathological))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'S Category Pathological must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.sCategoryPathological))
            return true
        if (functions.GEN_AT(untrimmedline.sCategoryPathological, "01239", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.sCategoryPathological} not valid code for S Category Pathological')
        return true

    }

    // ID: RQRS-02091; TAG: N2929; NAME: S Category Pathological, Schema ID, Required (NAACCR)
    public boolean rqrs02091(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.sCategoryPathological))
                return false
        }
        return true

    }

    // ID: RQRS-02092; TAG: N2930; NAME: Sarcomatoid Features, Date DX (NAACCR)
    public boolean rqrs02092(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sarcomatoid Features must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures))
            return true
        if (functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "R01R02R03R04R05XX6XX7XX8XX9", 3) == 0 && !functions.GEN_INLIST(untrimmedline.sarcomatoidFeatures, "000-100", "(\\d\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.sarcomatoidFeatures} not valid code for Sarcomatoid Features')
        return true

    }

    // ID: RQRS-02093; TAG: N2931; NAME: Sarcomatoid Features, Schema ID, Required (NAACCR)
    public boolean rqrs02093(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures) || functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "XX8") != 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02095; TAG: N3006; NAME: Schema Discriminator 2, Date DX (NAACCR)
    public boolean rqrs02095(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
            return true
        if (functions.GEN_AT(untrimmedline.schemaDiscriminator2, "129", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.schemaDiscriminator2} is not a valid value for Schema Discriminator 2')
        return true

    }

    // ID: RQRS-02096; TAG: N2970; NAME: Schema ID, EOD Mets (SEER)
    public boolean rqrs02096(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], MET = new char[3], SCHEMA_NAME = new char[31]
        
        int dx_year
        
        functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
        
        
        char[] group_m = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        if (!functions.GEN_EMPTY(untrimmedline.eodMets)) {
            functions.GEN_STRCPY(group_m, functions.GEN_TRIM(functions.GEN_LEFT(untrimmedline.schemaId, 5), ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_m, functions.GEN_TRIM(untrimmedline.eodMets, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EODM2018, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EODM2018_SCHEMA_IDMET, group_m, ['SCHEMA_ID':SCHEMA_ID, 'MET':MET])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Mets: ${untrimmedline.eodMets} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02097; TAG: N2968; NAME: Schema ID, EOD Primary Tumor (SEER)
    public boolean rqrs02097(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], PRIMARY = new char[4], SCHEMA_NAME = new char[31]
        
        int dx_year
        
        functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
        
        
        char[] group_p = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        if (!functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor)) {
            functions.GEN_STRCPY(group_p, functions.GEN_TRIM(functions.GEN_LEFT(untrimmedline.schemaId, 5), ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_p, functions.GEN_TRIM(untrimmedline.eodPrimaryTumor, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EODPT2018, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EODPT2018_SCHEMA_IDPRIMARY, group_p, ['SCHEMA_ID':SCHEMA_ID, 'PRIMARY':PRIMARY])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02098; TAG: N2969; NAME: Schema ID, EOD Regional Nodes (SEER)
    public boolean rqrs02098(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], NODES = new char[4], SCHEMA_NAME = new char[31]
        
        int dx_year
        
        functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
        
        
        char[] group_n = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        if (!functions.GEN_EMPTY(untrimmedline.eodRegionalNodes)) {
            functions.GEN_STRCPY(group_n, functions.GEN_TRIM(functions.GEN_LEFT(untrimmedline.schemaId, 5), ((Integer)context.RQRS_GEN_RIGHT)))
            functions.GEN_STRCAT(group_n, functions.GEN_TRIM(untrimmedline.eodRegionalNodes, ((Integer)context.RQRS_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_EODRN2018, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_EODRN2018_SCHEMA_IDNODES, group_n, ['SCHEMA_ID':SCHEMA_ID, 'NODES':NODES])) {
                functions.GEN_SAVE_TEXT(binding, 'am')
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02099; TAG: N4026; NAME: Secondary Diagnosis 1, Date DX (COC)
    public boolean rqrs02099(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis1))
            return false
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02106; TAG: N0701; NAME: SEER Derived Items, Date of DX (SEER)
    public boolean rqrs02106(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = 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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_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.histologyIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > 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.behaviorIcdO3, "0,1")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year == 2016 || dx_year == 2017) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSeerPathStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017, Derived SEER Path Stg Grp cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSeerClinStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017, Derived SEER Clin Stg Grp cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017, Derived SEER Cmb Stg Grp cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year == 2016 || dx_year == 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT) || !functions.GEN_EMPTY(untrimmedline.tnmClinN) || !functions.GEN_EMPTY(untrimmedline.tnmClinM) || !functions.GEN_EMPTY(untrimmedline.tnmPathT) || !functions.GEN_EMPTY(untrimmedline.tnmPathN) || !functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
        
                if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedT)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017 and any Clin or Path TNM fields coded, Derived SEER Combined T cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedN)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017 and any Clin or Path TNM fields coded, Derived SEER Combined N cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedM)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX = 2016 or 2017 and any Clin or Path TNM fields coded, Derived SEER Combined M cannot be blank')
                    err_flag = 1
                }
            }
        }
        if (dx_year < 2016 || dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerPathStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Path Stg Grp must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerClinStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Clin Stg Grp must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedStgGrp)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Cmb Stg Grp must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedT)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Combined T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedN)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Combined N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedM)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Combined M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedTSrc)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Cmb T Src must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedNSrc)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Cmb N Src must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedSeerCombinedMSrc)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX <2016 or > 2017, Derived SEER Cmb M Src 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, '_schema_ms')
            return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02109; TAG: N3988; NAME: SEER Site-Specific Fact 1, Date DX (SEER)
    public boolean rqrs02109(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFactor1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'SEER Site-Specific Fact 1 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFactor1))
            return true
        if (functions.GEN_AT(untrimmedline.seerSiteSpecificFactor1, "0123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.seerSiteSpecificFactor1} not valid code for SEER Site-Specific Fact 1')
        return true

    }

    // ID: RQRS-02110; TAG: N3989; NAME: SEER Site-Specific Fact 1, Schema ID, Required (SEER)
    public boolean rqrs02110(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[70]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00100 00111 00112 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFactor1))
                return false
        }
        return true

    }

    // ID: RQRS-02111; TAG: N0810; NAME: SEER Submission Edit 01 (SEER)
    public boolean rqrs02111(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addressAtDxCounty))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'County at DX not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.nhia))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'NHIA Derived Hisp Origin not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3 not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3 not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.seerTypeOfFollowUp))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'SEER Type of Follow-Up not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.seerRecordNumber))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'SEER Record Number not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionNumber))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'ICD Revision Number not valid for submission')
        return true

    }

    // ID: RQRS-02112; TAG: N0850; NAME: SEER Submission Edit 02 (SEER)
    public boolean rqrs02112(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year >= 1973) && (dx_year <= 1991)) {
            if (!functions.GEN_INLIST(untrimmedline.registryId, "41,44", "(00000015\\d\\d)", 9, 2)) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO1, "2,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Behavior (73-91) ICD-O-1 must be 2 or 3')
            }
        }
        if ((dx_year >= 1992) && (dx_year <= 2000)) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior (92-00) ICD-O-2 must be 2 or 3')
        }
        if ((dx_year >= 2001) && (dx_year <= 2003)) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "2,3"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior Code ICD-O-3 must be 2 or 3')
        }
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001542")) {
            if (dx_year < 2000) {
                if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
                    return true
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
            return functions.GEN_ERROR_MSG(binding, 'Marital Status must not be blank')
        return true

    }

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

    }

    // ID: RQRS-02114; TAG: N2531; NAME: Sentinel Lymph Nodes Examined (COC)
    public boolean rqrs02114(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        return functions.GEN_INLIST(untrimmedline.sentinelLymphNodesExamined, "00-90, 95,98,99")

    }

    // ID: RQRS-02115; TAG: N2536; NAME: Sentinel Lymph Nodes Examined, Date of Sentinel Lymph Node Biopsy Flag (COC)
    public boolean rqrs02115(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, flag
        
        ex = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        flag = functions.GEN_VAL(untrimmedline.dateSentinelLymphNodeBiopsyFlag)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag) && functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy))
            return true
        if ((ex == 0 || ex == 95) && flag != 11)
            return false
        else {
            if (((ex >= 1 && ex <= 90) || (ex == 98)) && (flag == 10 || flag == 11))
                return false
            else {
                if ((ex == 99) && (flag != 10))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02116; TAG: N2833; NAME: Sentinel Lymph Nodes Examined, Regional Nodes Examined (COC)
    public boolean rqrs02116(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (reg == 0 && sen != 0)
            return false
        else {
            if (((reg == 95 && (sen == 95)) || sen == 0))
                return true
            else {
                if (sen >= 1 && sen <= 90) {
                    if (((reg >= 1 && reg <= 90) || (reg >= 96 && reg <= 98)) && (sen <= reg))
                        return true
                    else
                        return false
                }
                else {
                    if (sen == 98) {
                        if ((reg >= 1 && reg <= 90) || (reg >= 96 && reg <= 98))
                            return true
                        else
                            return false
                    }
                    else {
                        if (sen == 95) {
                            if ((reg >= 1 && reg <= 90) || (reg >= 95 && reg <= 98))
                                return true
                            else
                                return false
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-02117; TAG: N2535; NAME: Sentinel Lymph Nodes Examined, Sentinel Lymph Nodes Positive (COC)
    public boolean rqrs02117(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
            return true
        ex = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        pos = functions.GEN_VAL(untrimmedline.sentinelLymphNodesPositive)
        
        if (ex == 0 && pos != 98)
            return false
        else {
            if (ex >= 1 && ex <= 90) {
                if (pos == 97 || pos == 99 || pos <= ex)
                    return true
                else
                    return false
            }
            else {
                if (ex == 95) {
                    if (pos == 0 || pos == 95 || pos == 99)
                        return true
                    else
                        return false
                }
            }
        }
        if (ex == 98) {
            if ((pos >= 0 && pos <= 90) || (pos == 97) || (pos == 99))
                return true
            else
                return false
        }
        else {
            if (ex == 99) {
                if (pos == 99)
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02118; TAG: N2532; NAME: Sentinel Lymph Nodes Pos/Ex, Schema ID, Date DX (COC)
    public boolean rqrs02118(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_NOOP()
        
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || !functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year > 2017) {
            if (functions.GEN_AT(code, ID, 6) != 0) {
                if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Node data items must not be blank for Breast and Melanoma cases')
            }
            if (functions.GEN_AT(code, ID, 6) == 0) {
                if (!functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || !functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be reported only for Melanoma of Skin and Breast')
            }
        }
        return true

    }

    // ID: RQRS-02119; TAG: N3971; NAME: Sentinel Lymph Nodes Pos/Ex, Schema ID, Date DX (SEER)
    public boolean rqrs02119(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        functions.GEN_NOOP()
        
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || !functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be reported for Melanoma of Skin and Breast')
        }
        return true

    }

    // ID: RQRS-02120; TAG: N2533; NAME: Sentinel Lymph Nodes Positive (COC)
    public boolean rqrs02120(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
            return true
        return functions.GEN_INLIST(untrimmedline.sentinelLymphNodesPositive, "00-90, 95,97,98,99")

    }

    // ID: RQRS-02121; TAG: N2834; NAME: Sentinel Lymph Nodes Positive, Regional Nodes Positive (COC)
    public boolean rqrs02121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesPositive)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (reg == 0 && (sen == 0 || sen == 98))
            return true
        else {
            if (reg == 95 && (sen == 95 || sen == 0 || sen == 98))
                return true
            else {
                if (sen >= 1 && sen <= 90) {
                    if (((reg >= 1 && reg <= 90) || (reg >= 97 && reg <= 98)) && (sen <= reg))
                        return true
                    else
                        return false
                }
                else {
                    if (sen == 95) {
                        if ((reg >= 1 && reg <= 90) || (reg == 95) || (reg >= 97 && reg <= 98))
                            return true
                        else
                            return false
                    }
                    else {
                        if (sen == 97) {
                            if ((reg >= 1 && reg <= 90) || (reg >= 97 && reg <= 98))
                                return true
                            else
                                return false
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-02122; TAG: N3060; NAME: Separate Tumor Nodules, Behavior (NAACCR)
    public boolean rqrs02122(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3) || functions.GEN_AT(untrimmedline.behaviorIcdO3, "013", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.separateTumorNodules, "09", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02123; TAG: N2670; NAME: Separate Tumor Nodules, Date DX (NAACCR)
    public boolean rqrs02123(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.separateTumorNodules))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Separate Tumor Nodules must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules))
            return true
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "01234789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.separateTumorNodules} not valid code for Separate Tumor Nodules')
        return true

    }

    // ID: RQRS-02124; TAG: N2871; NAME: Separate Tumor Nodules, Schema ID, Required (NAACCR)
    public boolean rqrs02124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02128; TAG: N2747; NAME: Serum Albumin Pretreatment Level, Date DX (NAACCR)
    public boolean rqrs02128(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Albumin Pretreatment Level must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel))
            return true
        if (functions.GEN_AT(untrimmedline.serumAlbuminPretreatmentLevel, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.serumAlbuminPretreatmentLevel} not valid code for Serum Albumin Pretreatment Level')
        return true

    }

    // ID: RQRS-02129; TAG: N2932; NAME: Serum Albumin Pretreatment Level, Schema ID, Required (NAACCR)
    public boolean rqrs02129(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.schemaDiscriminator1, "0") != 0) {
                if (functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Albumin Pretreatment Level must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0 && functions.GEN_AT(untrimmedline.schemaDiscriminator1, "19", 1) != 0) {
                if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Albumin Pretreatment Level: ${untrimmedline.serumAlbuminPretreatmentLevel} not valid for Schema ID: ${untrimmedline.schemaId} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1}')
            }
        }
        return true

    }

    // ID: RQRS-02130; TAG: N2748; NAME: Serum Beta-2 Microglobulin Pretreatment Level, Date DX (NAACCR)
    public boolean rqrs02130(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Beta-2 Microglobulin Pretreatment Level must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel))
            return true
        if (functions.GEN_AT(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel, "01279", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.serumBeta2MicroglobulinPretreatmentLevel} not valid code for Serum Beta-2 Microglobulin Pretreatment Level')
        return true

    }

    // ID: RQRS-02131; TAG: N2933; NAME: Serum Beta-2 Microglobulin Pretreatment Level, Schema ID, Required (NAACCR)
    public boolean rqrs02131(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            if (functions.GEN_AT(untrimmedline.schemaDiscriminator1, "0") != 0) {
                if (functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Beta-2 Microglobulin Pretreatment Level must not be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2018 and later')
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) != 0 && functions.GEN_AT(untrimmedline.schemaDiscriminator1, "19", 1) != 0) {
                if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Serum Beta-2 Microglobulin Pretreatment Level: ${untrimmedline.serumBeta2MicroglobulinPretreatmentLevel} not valid for Schema ID: ${untrimmedline.schemaId} and Schema Discriminator 1: ${untrimmedline.schemaDiscriminator1}')
            }
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02135; TAG: N0860; NAME: Site Coding Sys--Original, Date of DX (NAACCR)
    public boolean rqrs02135(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.siteCodingSysOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (!functions.GEN_INLIST(untrimmedline.siteCodingSysOriginal, "4,5"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02142; TAG: N2339; NAME: SS1977, TNM M c,p pre2016 (NAACCR)
    public boolean rqrs02142(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 > 2015)
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] codepm = new char[5]
        char[] codecm = new char[5]
        char[] MCODE = new char[6]
        char[] MCODE2 = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmM, "1"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "p"))
            functions.GEN_STRCPY(codepm, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
        else
            functions.GEN_STRCPY(codepm, untrimmedline.tnmPathM)
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c"))
            functions.GEN_STRCPY(codecm, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
        else
            functions.GEN_STRCPY(codecm, untrimmedline.tnmClinM)
        if (functions.GEN_INLIST(codepm, "88") && functions.GEN_INLIST(codecm, "88"))
            return true
        if (!functions.GEN_EMPTY(codepm)) {
            functions.GEN_STRCPY(MCODE, codepm)
            if (functions.GEN_INLIST(MCODE, "X, 88")) {
                if (!functions.GEN_EMPTY(codecm)) {
                    if (!functions.GEN_INLIST(codecm, "X, 88"))
                        functions.GEN_STRCPY(MCODE, codecm)
                }
            }
        }
        else
            functions.GEN_STRCPY(MCODE, codecm)
        functions.GEN_STRCPY(MCODE2, MCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,3,9")) {
            if (functions.GEN_INLIST(MCODE2, "1"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "2,4,5")) {
            if (functions.GEN_INLIST(MCODE2, "1"))
                return true
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7")) {
            if (functions.GEN_INLIST(MCODE2, "0"))
                return true
            else
                return true
        }
        return true

    }

    // ID: RQRS-02143; TAG: N2340; NAME: SS1977, TNM N c,p pre2016 (NAACCR)
    public boolean rqrs02143(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 > 2015)
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] codepn = new char[5]
        char[] codecn = new char[5]
        char[] NCODE = new char[6]
        char[] NCODE2 = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmN, "1"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "p"))
            functions.GEN_STRCPY(codepn, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
        else
            functions.GEN_STRCPY(codepn, untrimmedline.tnmPathN)
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c"))
            functions.GEN_STRCPY(codecn, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
        else
            functions.GEN_STRCPY(codecn, untrimmedline.tnmClinN)
        if (functions.GEN_INLIST(codepn, "88") && functions.GEN_INLIST(codecn, "88"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage1977) > 4)
            return true
        if (!functions.GEN_EMPTY(codepn)) {
            functions.GEN_STRCPY(NCODE, codepn)
            if (functions.GEN_INLIST(NCODE, "88,X")) {
                if (!functions.GEN_EMPTY(codecn)) {
                    if (!functions.GEN_INLIST(codecn, "88,X"))
                        functions.GEN_STRCPY(NCODE, codecn)
                }
            }
        }
        else
            functions.GEN_STRCPY(NCODE, codecn)
        functions.GEN_STRCPY(NCODE2, NCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,2")) {
            if (functions.GEN_INLIST(NCODE2, "1, 2, 3, 1,2, 3"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4")) {
            if (functions.GEN_INLIST(NCODE2, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-02144; TAG: N2341; NAME: SS2000, TNM M c,p pre2016 (NAACCR)
    public boolean rqrs02144(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year > 2015))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] codepm = new char[5]
        char[] codecm = new char[5]
        char[] MCODE = new char[6]
        char[] MCODE2 = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmM, "1"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "p"))
            functions.GEN_STRCPY(codepm, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
        else
            functions.GEN_STRCPY(codepm, untrimmedline.tnmPathM)
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c"))
            functions.GEN_STRCPY(codecm, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
        else
            functions.GEN_STRCPY(codecm, untrimmedline.tnmClinM)
        if (functions.GEN_INLIST(codepm, "88") && functions.GEN_INLIST(codecm, "88"))
            return true
        if (!functions.GEN_EMPTY(codepm)) {
            functions.GEN_STRCPY(MCODE, codepm)
            if (functions.GEN_INLIST(MCODE, "X, 88")) {
                if (!functions.GEN_EMPTY(codecm)) {
                    if (!functions.GEN_INLIST(codecm, "X, 88"))
                        functions.GEN_STRCPY(MCODE, codecm)
                }
            }
        }
        else
            functions.GEN_STRCPY(MCODE, codecm)
        functions.GEN_STRCPY(MCODE2, MCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,3,9")) {
            if (functions.GEN_INLIST(MCODE2, "1 "))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "2,4,5")) {
            if (functions.GEN_INLIST(MCODE2, "1"))
                return true
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7")) {
            if (functions.GEN_INLIST(MCODE2, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "000,011,021,079,099,119,180-189,199,250-259,340-349,384,541,569,570,670-680", "(C\\d\\d\\d)", 2, 3))
                    return true
                else
                    return true
            }
            else
                return true
        }
        
        return true

    }

    // ID: RQRS-02145; TAG: N2342; NAME: SS2000, TNM N c,p pre2016 (NAACCR)
    public boolean rqrs02145(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year > 2015))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        char[] codepn = new char[5]
        char[] codecn = new char[5]
        char[] NCODE = new char[6]
        char[] NCODE2 = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmN, "1"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "p"))
            functions.GEN_STRCPY(codepn, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
        else
            functions.GEN_STRCPY(codepn, untrimmedline.tnmPathN)
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c"))
            functions.GEN_STRCPY(codecn, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
        else
            functions.GEN_STRCPY(codecn, untrimmedline.tnmClinN)
        if (functions.GEN_INLIST(codepn, "88") && functions.GEN_INLIST(codecn, "88"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage2000) > 4)
            return true
        if (!functions.GEN_EMPTY(codepn)) {
            functions.GEN_STRCPY(NCODE, codepn)
            if (functions.GEN_INLIST(NCODE, "88,X")) {
                if (!functions.GEN_EMPTY(codecn)) {
                    if (!functions.GEN_INLIST(codecn, "88,X"))
                        functions.GEN_STRCPY(NCODE, codecn)
                }
            }
        }
        else
            functions.GEN_STRCPY(NCODE, codecn)
        functions.GEN_STRCPY(NCODE2, NCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(NCODE2, "1, 2, 3, 4"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "3,4")) {
            if (functions.GEN_INLIST(NCODE2, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-02146; TAG: N4015; NAME: SSDI Extranodal Extension non-H&N, Blank for Other Schemas (NAACCR)
    public boolean rqrs02146(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00460 00570 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Merkel Cell,Penis, Extranodal Extens Clin (non-H&N) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Merkel Cell,Penis, Extranodal Extens Path (non-H&N) must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02147; TAG: N4017; NAME: SSDI FIGO Stage, Blank for Other Schemas (NAACCR)
    public boolean rqrs02147(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00500 00510 00520 00530 00541 00542 00551 00552 00553 00560 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.figoStage)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Gynecologic, FIGO Stage must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02148; TAG: N3997; NAME: SSDI for Appendix & Colorectal, Blank for Other Schemas (NAACCR)
    public boolean rqrs02148(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00190 00200 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Appendix,Colorectal, CEA Pretreat Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Appendix,Colorectal, CEA Pretreat Lab Value must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00200 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Circumferential Resection Margin must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.kras)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, KRAS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Microsatellite Instability (MSI) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tumorDeposits)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Tumor Deposits must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02149; TAG: N3999; NAME: SSDI for Bone, Blank for Other Schemas (NAACCR)
    public boolean rqrs02149(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00381 00382 00383 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Bone, Percent Necrosis Post Neoadjuvant must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02150; TAG: N4010; NAME: SSDI for Brain,CNS, Blank for Other Schemas (NAACCR)
    public boolean rqrs02150(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00721 00722 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Brain Molecular Markers must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Chromosome 1p: Loss of Heterozygosity must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Chromosome 19q: Loss of Heterozygosity must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Methylat O6-Methylguanine-Methyltransf must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02151; TAG: N3990; NAME: SSDI for Breast, Blank for Other Schemas (NAACCR)
    public boolean rqrs02151(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00480") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Percent Pos or Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Total Allred Score must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IhcSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 IHC Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Dual Probe Copy Number must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Dual Probe Ratio must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Single Probe Copy Number must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 Overall Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ki67)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Ki-67 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, LN Positive Axillary Level I-II must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Multigene Signature Method must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Multigene Signature Results must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Recurrence Score-DCIS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Recurrence Score-Invasive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Risk Level-DCIS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Risk Level-Invasive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Recept Percent Pos or Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Receptor Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Receptor Total Allred Score must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Response to Neoadjuvant Therapy must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02152; TAG: N4004; NAME: SSDI for Corpus Uteri, Blank for Other Schemas (NAACCR)
    public boolean rqrs02152(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00530 00541 00542 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number Pos Para-Aortic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number Exam Para-Aortic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number of Positive Pelvic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number of Examined Pelvic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.peritonealCytology)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Peritoneal Cytology must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02153; TAG: N3996; NAME: SSDI for Esophagus, Blank for Other Schemas (NAACCR)
    public boolean rqrs02153(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00161") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00161") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Esophagus (Squam), Esophagus,EGJ Tumor Epicenter must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02154; TAG: N4001; NAME: SSDI for GIST, Blank for Other Schemas (NAACCR)
    public boolean rqrs02154(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00430") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00430") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not GIST, KIT Gene Immunohistochemistry must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02155; TAG: N3995; NAME: SSDI for Head & Neck, Blank for Other Schemas (NAACCR)
    public boolean rqrs02155(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] ID = new char[70]
        char[] IDPlus1 = new char[140]
        char[] IDPlus2 = new char[150]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00100 00111 00112 ")
        
        functions.GEN_STRCPY(IDPlus1, ID)
        functions.GEN_STRCAT(IDPlus1, "00060 00080 00090 00121 00122 00131 00132 00133 00130 00140 ")
        
        functions.GEN_STRCPY(IDPlus2, IDPlus1)
        functions.GEN_STRCAT(IDPlus2, "00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00060 00140 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels I-III must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels IV-V must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels VI-VII must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Other must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, ID, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFactor1)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, SEER Site-Specific Fact 1 must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, IDPlus1, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, Extranodal Extension H&N Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, Extranodal Extension H&N Pathological must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, IDPlus2, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N or SCC of H&N, LN Size must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02156; TAG: N4013; NAME: SSDI for HemeRetic, Blank for Other Schemas (NAACCR)
    public boolean rqrs02156(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00830") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00830") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.jak2)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not HemeRetic, JAK2 must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02157; TAG: N3993; NAME: SSDI for Kidney, Blank for Other Schemas (NAACCR)
    public boolean rqrs02157(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00600") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Invasion Beyond Capsule must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Ipsilateral Adrenal Gland Involvement must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Major Vein Involvement must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Sarcomatoid Features must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02158; TAG: N4009; NAME: SSDI for Lacrimal Gland, Blank for Other Schemas (NAACCR)
    public boolean rqrs02158(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00690") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00690") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lacrimal Gland, Adenoid Cystic Basaloid Pattern must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02159; TAG: N3994; NAME: SSDI for Liver & Biliary, Blank for Other Schemas (NAACCR)
    public boolean rqrs02159(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00220 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, AFP Pretreatment Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, AFP Pretreatment Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Bilirubin Pretreatment Total Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Bilirubin Pretreatment Unit of Measure must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Creatinine Pretreatment Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Creatinine Pretreatment Unit of Measure must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Internatl Norm Ratio Prothrombin Time must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00220 00230 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver or Intrehepatic Bile Duct, Fibrosis Score must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00230 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Intrahepatic Bile Duct, Tumor Growth Pattern must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00230 00250 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Intrahep,Perihilar Duct, Prim Scleros Cholang must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02160; TAG: N3998; NAME: SSDI for Lung & Pleura, Blank for Other Schemas (NAACCR)
    public boolean rqrs02160(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.separateTumorNodules)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, Separate Tumor Nodules must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, Visceral and Parietal Pleural Invasion must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00370") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.pleuralEffusion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Pleural Mesothelioma, Pleural Effusion must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02161; TAG: N4011; NAME: SSDI for Lymphoma, Blank for Other Schemas (NAACCR)
    public boolean rqrs02161(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00790 00795 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.bSymptoms)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, B Symptoms must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hivStatus)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, HIV Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, NCCN International Prognostic Index must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00795 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.adenopathy)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Adenopathy must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.anemia)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Anemia must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lymphocytosis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Lymphocytosis must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.organomegaly)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Organomegaly must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.thrombocytopenia)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Thrombocytopenia must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02162; TAG: N4018; NAME: SSDI for Mycosis Fungoides, Blank for Other Schemas (NAACCR)
    public boolean rqrs02162(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00811") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00811") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Mycosis Fungoides, Peripheral Blood Involvement must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02163; TAG: N4007; NAME: SSDI for Ophthalmic Melanoma, Blank for Other Schemas (NAACCR)
    public boolean rqrs02163(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00660 00671 00672 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.measuredThickness)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ophthalmic Melanoma, Measured Thickness must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00671 00672 ") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Chromosome 3 Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome8qStatus)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Chromosome 8q Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Extravascular Matrix Patterns must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Measured Basal Diameter must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.microvascularDensity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Microvascular Density must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Mitotic Count Uveal Melanoma must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02164; TAG: N4005; NAME: SSDI for Ovary, Fallopian Tube, Primary Peritoneal, Blank for Other Schemas (NAACCR)
    public boolean rqrs02164(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00551 00552 00553 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ovarian, CA-125 Pretreatment Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ovarian, Residual Tumor Volume Post Cytoreduction must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02165; TAG: N4006; NAME: SSDI for Placenta, Blank for Other Schemas (NAACCR)
    public boolean rqrs02165(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00560") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00560") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Placenta, Gest Trophoblast Prognost Scoring Ind must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02166; TAG: N4012; NAME: SSDI for Plasma Cell Myeloma, Blank for Other Schemas (NAACCR)
    public boolean rqrs02166(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00821") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, High Risk Cytogenetics must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, Serum Albumin Pretreatment Level must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, Serum Beta-2 Microglob Pretreat Level must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02167; TAG: N3991; NAME: SSDI for Prostate, Blank for Other Schemas (NAACCR)
    public boolean rqrs02167(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Patterns Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Patterns Pathological must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Score Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScorePathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Score Pathological must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Tertiary Pattern must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Number of Cores Examined must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Number of Cores Positive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Prostate Pathological Extension must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.psaLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, PSA Lab Value must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02168; TAG: N4008; NAME: SSDI for Retinoblastoma, Blank for Other Schemas (NAACCR)
    public boolean rqrs02168(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00680") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00680") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.heritableTrait)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Retinoblastoma, Heritable Trait must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02169; TAG: N4002; NAME: SSDI for Skin, Blank for Other Schemas (NAACCR)
    public boolean rqrs02169(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00150") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cutaneous SCC H&N, High Risk Histologic Features must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00460") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Merkel Cell, LN Isolated Tumor Cells (ITC) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Merkel Cell, Profound Immune Suppression must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00470") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Breslow Tumor Thickness must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, LDH Pretreatment Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, LDH Upper Limits of Normal must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Mitotic Rate Melanoma must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ulceration)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Ulceration must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02170; TAG: N4000; NAME: SSDI for Soft Tissue, Blank for Other Schemas (NAACCR)
    public boolean rqrs02170(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00400 00410 00421 00422 00440 00450 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.boneInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Soft Tissue, Bone Invasion must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02171; TAG: N3992; NAME: SSDI for Testis, Blank for Other Schemas (NAACCR)
    public boolean rqrs02171(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00590") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Post-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Pre-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Post-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Pre-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, LDH Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, LDH Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, S Category Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryPathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, S Category Pathological must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02172; TAG: N4003; NAME: SSDI for Vulva, Vagina, Cervix, Blank for Other Schemas (NAACCR)
    public boolean rqrs02172(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00500 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnLaterality)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva, LN Laterality must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00500 00510 00520 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva,Vagina,Cervix, LN Assess Meth Femor-Inguin must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva,Vagina,Cervix, LN Assess Method Para-aortic must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva,Vagina,Cervix, LN Assess Method Pelvic must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva,Vagina,Cervix, LN Stat Fem-Ing,Para,Pelv must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00510 00520 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina or Cervix, LN Distant Assessment Method must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina,Cervix, LN Distant: Mediastinal, Scalene must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02173; TAG: N4016; NAME: SSDI LDH Pretreatment Level, Blank for Other Schemas (NAACCR)
    public boolean rqrs02173(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00470 00821 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Melanoma of Skin or Myeloma, LDH Pretreatment Level must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02174; TAG: N4014; NAME: SSDI Perineural Invasion, Blank for Other Schemas (NAACCR)
    public boolean rqrs02174(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00150 00200 00640 00690 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.perineuralInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not CutH&N,Colorect,SkinEyelid,LacGland, Perineur Inv must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02175; TAG: N4931; NAME: SSDI, DCO (NAACCR)
    public boolean rqrs02175(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Adenoid Cystic Basaloid Pattern must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.adenopathy)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Adenopathy must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Post-Orchiectomy Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Post-Orchiectomy Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pre-Orchiectomy Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pre-Orchiectomy Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pretreatment Interpretation must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pretreatment Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.anemia)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Anemia must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bSymptoms)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: B Symptoms must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentTotalLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bilirubin Pretreatment Total Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretreatmentUnitOfMeasure)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bilirubin Pretreatment Unit of Measure must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.boneInvasion)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bone Invasion must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Brain Molecular Markers must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Breslow Tumor Thickness must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: CA-125 Pretreatment Interpretation must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: CEA Pretreatment Interpretation must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 19q: Loss of Heterozygosity (LOH) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 1p: Loss of Heterozygosity (LOH) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 3 Status must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome8qStatus)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 8q Status must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Circumferential Resection Margin (CRM) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Creatinine Pretreatment Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentUnitOfMeasure)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Creatinine Pretreatment Unit of Measure must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Esophagus and EGJ Tumor Epicenter must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Percent Positive or Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Summary must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Total Allred Score must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Clin (non-Head and Neck) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Head and Neck Clinical must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Head and Neck Pathological must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Path (non-Head and Neck) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extravascular Matrix Patterns must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Fibrosis Score must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.figoStage)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: FIGO Stage must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPrognosticScoringIndex)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gestational Trophoblastic Prognostic Scoring Index must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Patterns Clinical must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Patterns Pathological must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Score Clinical must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonScorePathological)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Score Pathological must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Tertiary Pattern must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Post-Orchiectomy Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Post-Orchiectomy Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Pre-Orchiectomy Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Pre-Orchiectomy Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IhcSummary)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 IHC Summary must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Dual Probe Copy Number must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Dual Probe Ratio must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Single Probe Copy Number must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshSummary)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Summary must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 Overall Summary must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.heritableTrait)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Heritable Trait must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: High Risk Cytogenetics must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: High Risk Histologic Features must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hivStatus)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HIV Status must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.internationalNormalizedRatioForProthrombinTime)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: International Normalized Ratio Prothrombin Time must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Invasion Beyond Capsule must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ipsilateral Adrenal Gland Involvement must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.jak2)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: JAK2 must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ki67)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ki-67 must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: KIT Gene Immunohistochemistry must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.kras)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: KRAS must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Post-Orchiectomy Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Pre-Orchiectomy Range) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Pretreatment Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Pretreatment Level must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Upper Limits of Normal must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Femoral-Inguinal must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Para-Aortic must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Pelvic must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Distant Assessment Method must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Distant: Mediastinal, Scalene must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels I-III must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels IV-V must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels VI-VII must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Other must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Isolated Tumor Cells (ITC) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnLaterality)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Laterality must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Positive Axillary Level I-II must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnSize)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Size must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Status Femoral-Inguinal, Para-Aortic, Pelvic must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lymphocytosis)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Lymphocytosis must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Major Vein Involvement must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Measured Basal Diameter must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.measuredThickness)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Measured Thickness must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Methylation of O6-Methylguanine-Methyltransferase must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Microsatellite Instability (MSI) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.microvascularDensity)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Microvascular Density must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Mitotic Count Uveal Melanoma must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Mitotic Rate Melanoma must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Multigene Signature Method must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Multigene Signature Results must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: NCCN International Prognostic Index (IPI) must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Cores Examined must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Cores Positive must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Examined Para-Aortic Nodes must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Examined Pelvic Nodes must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Positive Para-Aortic Nodes must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Positive Pelvic Nodes must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Recurrence Score-DCIS must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasive)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Recurrence Score-Invasive must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Risk Level-DCIS must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Risk Level-Invasive must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.organomegaly)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Organomegaly must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Percent Necrosis Post Neoadjuvant must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.perineuralInvasion)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Perineural Invasion must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Peripheral Blood Involvemen must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.peritonealCytology)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Peritoneal Cytology must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.pleuralEffusion)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Pleural Effusion must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Primary Sclerosing Cholangitis must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Profound Immune Suppression must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Percent Positive or Range must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorSummary)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Summary must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Total Allred Score must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.psaLabValue)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: PSA (Prostatic Specific Antigen) Lab Value must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.residualTumorVolumePostCytoreduction)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Residual Tumor Volume Post Cytoreduction must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Response to Neoadjuvant Therapy must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sCategoryClinical)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: S Category Clinical must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sCategoryPathological)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: S Category Pathological must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Sarcomatoid Features must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFactor1)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: SEER Site-Specific Fact 1 must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.separateTumorNodules)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Separate Tumor Nodules must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Serum Albumin Pretreatment Level must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretreatmentLevel)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Serum Beta-2 Microglobulin Pretreatment Level must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.thrombocytopenia)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Thrombocytopenia must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.tumorDeposits)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Tumor Deposits must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Tumor Growth Pattern must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ulceration)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ulceration must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion)) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Visceral and Parietal Pleural Invasion must be blank')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02176; TAG: N2570; NAME: State at DX Geocode 1970/80/90 (NAACCR)
    public boolean rqrs02176(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.stateAtDxGeocode19708090))
            return true
        if (functions.GEN_INLIST(untrimmedline.stateAtDxGeocode19708090, "01-95", "(\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-02177; TAG: N2571; NAME: State at DX Geocode 2000 (NAACCR)
    public boolean rqrs02177(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.stateAtDxGeocode2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.stateAtDxGeocode2000, "01-95", "(\\d\\d)"))
            return true
        return false

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02200; TAG: N0437; NAME: Summary Stage 2000, Date of Diagnosis (NAACCR)
    public boolean rqrs02200(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2000 && dx_year < 2004) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        if (dx_year > 2014 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()} then SEER Summary Stage 2000 cannot be blank')
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis >= 2018, then SEER Summary Stage 2000 must be blank')
        }
        return true

    }

    // ID: RQRS-02201; TAG: N4906; NAME: Summary Stage 2000, Date of Diagnosis (SEER)
    public boolean rqrs02201(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == 2016 || dx_year == 2017) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) && functions.GEN_EMPTY(untrimmedline.derivedSs2000))
                return functions.GEN_ERROR_MSG(binding, 'If Year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()}, then either SEER Summary Stage 2000 or Derived SS2000 must not be blank')
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis >= 2018, then SEER Summary Stage 2000 must be blank')
        }
        return true

    }

    // ID: RQRS-02202; TAG: N0440; NAME: Summary Stage 2000, EOD--LN Involv, ICDO3 (NAACCR)
    public boolean rqrs02202(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "1-8"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "3,4")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0"))
                return false
            else
                return true
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    // ID: RQRS-02209; TAG: N2812; NAME: Summary Stage 2018 (NAACCR)
    public boolean rqrs02209(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "01234789", 1) != 0)
            return true
        return false

    }

    // ID: RQRS-02210; TAG: N2830; NAME: Summary Stage 2018, Date of DX (NAACCR)
    public boolean rqrs02210(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.summaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018 must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018 must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: RQRS-02211; TAG: N3972; NAME: Summary Stage 2018, Date of DX (SEER)
    public boolean rqrs02211(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.summaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018 must be blank for cases diagnosed before 2018')
        }
        return true

    }

    // ID: RQRS-02212; TAG: N4900; NAME: Summary Stage 2018, Schema ID (NAACCR)
    public boolean rqrs02212(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], SS2018 = new char[2]
        
        int dx_year
        
        
        char[] group_SS2018 = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ID ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.RQRS_GEN_RIGHT)))
        
        functions.GEN_STRCPY(group_SS2018, untrimmedline.schemaId)
        functions.GEN_STRCAT(group_SS2018, untrimmedline.summaryStage2018)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SUMST2018, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SUMST2018_SCHEMA_IDSS2018, group_SS2018, ['SCHEMA_ID':SCHEMA_ID, 'SS2018':SS2018])) {
            functions.GEN_SAVE_TEXT(binding, 'am')
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018: ${untrimmedline.summaryStage2018} not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: RQRS-02213; TAG: N0634; NAME: Surgery 98-02, Rad, Rad Surg (SEER IF105)
    public boolean rqrs02213(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        boolean result
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "10-90")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "1-8")) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "1-8"))) && (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-6,9"))
                result = true
            else
                result = false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00") && (functions.GEN_VAL(untrimmedline.rxSummScopeReg9802) == 0) && (functions.GEN_VAL(untrimmedline.rxSummSurgOth9802) == 0)) || (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,7,8"))) {
                if (functions.GEN_VAL(untrimmedline.rxSummSurgRadSeq) == 0)
                    result = true
                else
                    result = false
            }
            else
                result = true
        }
        return result

    }

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

    }

    // ID: RQRS-02215; TAG: N4929; NAME: Surgery Rad, Phase I Rad Surg (SEER)
    public boolean rqrs02215(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int result
        int dx_year
        int seer_init_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5"))) && (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else
                return true
        }
        return true

    }

    // ID: RQRS-02216; TAG: N0429; NAME: Surgery Rad, Rad Surg (SEER IF75)
    public boolean rqrs02216(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int result
        int dx_year
        int seer_init_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5"))) && (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else
                return true
        }
        return true

    }

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

    }

    // ID: RQRS-02218; TAG: N1994; NAME: Surv--Cases Dx After Study Cutoff (SEER)
    public boolean rqrs02218(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
        
        if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode) || functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.survDateDxRecode, untrimmedline.survDatePresumedAlive, ((Integer)context.RQRS_GEN_DT_EXACT))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_UNKNOWN))
            return true
        if (dtcmp > 0) {
            if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "9999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Mos Active Followup must = 9999')
            if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "9"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Flag Active Followup must = 9')
            if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "9999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Mos Presumed Alive must = 9999')
            if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "9"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Flag Presumed Alive must = 9')
        }
        return true

    }

    // ID: RQRS-02219; TAG: N1979; NAME: Surv-Date Active Followup (SEER)
    public boolean rqrs02219(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowUp))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateActiveFollowUp))
            return false
        if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateActiveFollowUp) == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY))
            return false
        if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateActiveFollowUp) == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY))
            return false
        
        return true

    }

    // ID: RQRS-02220; TAG: N1991; NAME: Surv-Date Active Followup, Date Last Cont (SEER)
    public boolean rqrs02220(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowUp))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank, Surv-Date Active Followup must be blank')
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateActiveFollowUp))
            return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Active Followup must be full date and >= Date of Diagnosis')
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.survDateActiveFollowUp, ((Integer)context.RQRS_GEN_DT_EXACT))
        
        if (dtcmp <= 0)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        surv_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateActiveFollowUp)
        surv_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateActiveFollowUp)
        surv_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateActiveFollowUp)
        
        if (dx_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY) || surv_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) {
            if (dx_year <= surv_year)
                return true
            else
                return false
        }
        else {
            if (dx_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY) || surv_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY)) {
                if (dx_year < surv_year)
                    return true
                else {
                    if (dx_year == surv_year && dx_month <= surv_month)
                        return true
                    else
                        return false
                }
            }
            else
                return false
        }
        return false

    }

    // ID: RQRS-02221; TAG: N1993; NAME: Surv-Date Active Followup, Mos, Flag (SEER)
    public boolean rqrs02221(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowUp)) {
            if (!functions.GEN_EMPTY(untrimmedline.survMonthsActiveFollowUp) || !functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp))
                return functions.GEN_ERROR_MSG(binding, 'If Surv-Date Active Followup = blank, Surv-Mos Active Followup and Surv-Flag Active Followup must be blank')
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.survMonthsActiveFollowUp)) {
                if (!functions.GEN_EMPTY(untrimmedline.survDateActiveFollowUp) || !functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp))
                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Mos Active Followup = blank, Surv-Date Active Followup and Surv-Flag Active Followup must be blank')
            }
            else {
                if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp)) {
                    if (!functions.GEN_EMPTY(untrimmedline.survMonthsActiveFollowUp) || !functions.GEN_EMPTY(untrimmedline.survDateActiveFollowUp))
                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = blank, Surv-Date Active Followup and Surv-Mos Active Followup must be blank')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-02222; TAG: N1981; NAME: Surv-Date DX Recode (SEER)
    public boolean rqrs02222(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode))
            return false
        if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateDxRecode) == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY))
            return false
        if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateDxRecode) == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY))
            return false
        
        return true

    }

    // ID: RQRS-02223; TAG: N1995; NAME: Surv-Date DX Recode, Date of Diagnosis (SEER)
    public boolean rqrs02223(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode))
            return false
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis))
            return functions.GEN_ERROR_MSG(binding, 'Year of Surv-Date DX Recode must = year of Date of Diagnosis')
        if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis) > 0 && functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis) < 13) {
            if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis))
                return functions.GEN_ERROR_MSG(binding, 'If month of Date of Diagnosis = 01-12, month of Surv-Date DX Recode must = month of Date of Diagnosis')
        }
        if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis) > 0 && functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis) < 32) {
            if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis))
                return functions.GEN_ERROR_MSG(binding, 'If day of Date of Diagnosis = 01-31, day of Surv-Date DX Recode must = day of Date of Diagnosis')
        }
        
        return true

    }

    // ID: RQRS-02224; TAG: N1980; NAME: Surv-Date Presumed Alive (SEER)
    public boolean rqrs02224(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
            return false
        if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDatePresumedAlive) == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY))
            return false
        if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDatePresumedAlive) == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY))
            return false
        
        return true

    }

    // ID: RQRS-02225; TAG: N1990; NAME: Surv-Date Presumed Alive, Date Last Cont, DX (SEER)
    public boolean rqrs02225(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact)) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
                if (!functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
                    return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank and Vital Status = 0 or 4, Surv-Date Presumed Alive must be blank')
                else
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Presumed Alive must be full date and >= Date of Diagnosis')
        else {
            if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) && functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
                functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank and Vital Status = 1, Surv-Date Presumed Alive must >= Date of Diagnosis')
            else
                return true
        }
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
            return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Presumed Alive must be full date and >= Date of Diagnosis')
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.survDatePresumedAlive, ((Integer)context.RQRS_GEN_DT_EXACT))
        
        if (dtcmp <= 0)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        surv_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDatePresumedAlive)
        surv_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDatePresumedAlive)
        surv_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDatePresumedAlive)
        
        if (dx_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY) || surv_month == ((Integer)context.RQRS_GEN_DT_MONTH_EMPTY)) {
            if (dx_year <= surv_year)
                return true
            else
                return false
        }
        else {
            if (dx_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY) || surv_day == ((Integer)context.RQRS_GEN_DT_DAY_EMPTY)) {
                if (dx_year < surv_year)
                    return true
                else {
                    if (dx_year == surv_year && dx_month <= surv_month)
                        return true
                    else
                        return false
                }
            }
            else
                return false
        }
        return false

    }

    // ID: RQRS-02226; TAG: N1992; NAME: Surv-Date Presumed Alive, Mos, Flag (SEER)
    public boolean rqrs02226(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive)) {
            if (!functions.GEN_EMPTY(untrimmedline.survMonthsPresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
                return functions.GEN_ERROR_MSG(binding, 'If Surv-Date Presumed Alive = blank, Surv-Mos Presumed Alive and Surv-Flag Presumed Alive must be blank')
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.survMonthsPresumedAlive)) {
                if (!functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Mos Presumed Alive = blank, Surv-Date Presumed Alive and Surv-Flag Presumed Alive must be blank')
            }
            else {
                if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive)) {
                    if (!functions.GEN_EMPTY(untrimmedline.survMonthsPresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = blank, Surv-Date Presumed Alive and Surv-Mos Presumed Alive must be blank')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-02227; TAG: N1982; NAME: Surv-Flag Active Followup (SEER)
    public boolean rqrs02227(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp))
            return true
        if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "0-3,8,9"))
            return false
        return true

    }

    // ID: RQRS-02228; TAG: N1987; NAME: Surv-Flag Active Followup, Mos Act Followup (SEER)
    public boolean rqrs02228(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp)) {
            if (!functions.GEN_EMPTY(untrimmedline.survMonthsActiveFollowUp))
                return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = blank, Surv-Mos Active Followup must = blank')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "0000", "(\\d\\d\\d\\d)"))
                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 0, Surv-Mos Active Followup must = 0000')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "1")) {
                    if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "0000-9998", "(\\d\\d\\d\\d)"))
                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 1, Surv-Mos Active Followup must = 0000-9998')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "2")) {
                        if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "0000-0012", "(\\d\\d\\d\\d)"))
                            return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 2, Surv-Mos Active Followup must = 0000-0012')
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "3")) {
                            if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "0000-9998", "(\\d\\d\\d\\d)"))
                                return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 3, Surv-Mos Active Followup must = 0000-9998')
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "8")) {
                                if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "9999", "(\\d\\d\\d\\d)"))
                                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 8, Surv-Mos Active Followup must = 9999')
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "9")) {
                                    if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "9999", "(\\d\\d\\d\\d)"))
                                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 9, Surv-Mos Active Followup must = 9999')
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-02229; TAG: N1989; NAME: Surv-Flag Active Followup,Type Report Src (SEER)
    public boolean rqrs02229(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowUp) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "8,9"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowUp, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source not = 6 or 7, Surv-Flag Active Followup must not = 8')
        }
        return true

    }

    // ID: RQRS-02230; TAG: N1983; NAME: Surv-Flag Presumed Alive (SEER)
    public boolean rqrs02230(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
            return true
        if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "0-3,8,9"))
            return false
        return true

    }

    // ID: RQRS-02231; TAG: N1986; NAME: Surv-Flag Presumed Alive, Mos Presumed Alive (SEER)
    public boolean rqrs02231(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive)) {
            if (!functions.GEN_EMPTY(untrimmedline.survMonthsPresumedAlive))
                return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = blank, Surv-Mos Presumed Alive must = blank')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "0000", "(\\d\\d\\d\\d)"))
                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 0, Surv-Mos Presumed Alive must = 0000')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "1")) {
                    if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "0000-9998", "(\\d\\d\\d\\d)"))
                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 1, Surv-Mos Presumed Alive must = 0000-9998')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "2")) {
                        if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "0000-0012", "(\\d\\d\\d\\d)"))
                            return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 2, Surv-Mos Presumed Alive must = 0000-0012')
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "3")) {
                            if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "0000-9998", "(\\d\\d\\d\\d)"))
                                return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 3, Surv-Mos Presumed Alive must = 0000-9998')
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8")) {
                                if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "9999", "(\\d\\d\\d\\d)"))
                                    return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 8, Surv-Mos Presumed Alive must = 9999')
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "9")) {
                                    if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "9999", "(\\d\\d\\d\\d)"))
                                        return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 9, Surv-Mos Presumed Alive must = 9999')
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-02232; TAG: N1988; NAME: Surv-Flag Presumed Alive, Type Report Src (SEER)
    public boolean rqrs02232(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8,9"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source not = 6 or 7, Surv-Flag Presumed Alive must not = 8')
        }
        return true

    }

    // ID: RQRS-02233; TAG: N1985; NAME: Surv-Mos Active Followup (SEER)
    public boolean rqrs02233(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survMonthsActiveFollowUp))
            return true
        if (!functions.GEN_INLIST(untrimmedline.survMonthsActiveFollowUp, "0000-9999", "(\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: RQRS-02234; TAG: N1984; NAME: Surv-Mos Presumed Alive (SEER)
    public boolean rqrs02234(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.survMonthsPresumedAlive))
            return true
        if (!functions.GEN_INLIST(untrimmedline.survMonthsPresumedAlive, "0000-9999", "(\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: RQRS-02235; TAG: N0173; NAME: Telephone (COC)
    public boolean rqrs02235(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.telephone, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-02236; TAG: N0402; NAME: Text--Dx Proc--Path, Diagnostic Confirm (NAACCR)
    public boolean rqrs02236(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,3,4")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.textDxProcPath, 1, 79)))
                return false
        }
        return true

    }

    // ID: RQRS-02237; TAG: N0403; NAME: Text--Histology Title (NAACCR)
    public boolean rqrs02237(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.textHistologyTitle))
            return false
        return true

    }

    // ID: RQRS-02238; TAG: N0404; NAME: Text--Primary Site Title (NAACCR)
    public boolean rqrs02238(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.textPrimarySiteTitle))
            return false
        return true

    }

    // ID: RQRS-02239; TAG: N2745; NAME: Thrombocytopenia, Date DX (NAACCR)
    public boolean rqrs02239(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.thrombocytopenia))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Thrombocytopenia must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.thrombocytopenia))
            return true
        if (functions.GEN_AT(untrimmedline.thrombocytopenia, "01679", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.thrombocytopenia} not valid code for Thrombocytopenia')
        return true

    }

    // ID: RQRS-02240; TAG: N2935; NAME: Thrombocytopenia, Schema ID, Required (NAACCR)
    public boolean rqrs02240(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00795", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.thrombocytopenia))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02242; TAG: N2015; NAME: TNM Clin Descriptor, Date of Diagnosis (SEER)
    public boolean rqrs02242(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year > 2015 && dx_year < 2018) && (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)))
            return false
        return true

    }

    // ID: RQRS-02243; TAG: N2398; NAME: TNM Clin Descriptor, Stage, Lymphoma (COC)
    public boolean rqrs02243(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737,9738,9811-9818,9823,9827,9837") && (functions.GEN_INLIST(untrimmedline.primarySite, "C770,C771,C772,C773,C774,C775,C779"))) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "1,2,5") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,1A,1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737,9738,9811-9818,9823,9827,9837") && (functions.GEN_INLIST(untrimmedline.primarySite, "C379,C024,C090,C091,C098,C099,C111,C142,C379"))) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "1,2,5") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,1A,1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737,9738,9811-9818,9823,9827,9837") && (functions.GEN_INLIST(untrimmedline.primarySite, "C422"))) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "2") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,1A,1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737,9738,9811-9818,9823,9827,9837") && (functions.GEN_INLIST(untrimmedline.primarySite, "C778"))) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,1A,1B"))
                return false
        }
        return true

    }

    // ID: RQRS-02244; TAG: N2345; NAME: TNM Clin Descriptor, TNM Fields (NPCR)
    public boolean rqrs02244(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT) || !functions.GEN_EMPTY(untrimmedline.tnmClinM) || !functions.GEN_EMPTY(untrimmedline.tnmClinN) || !functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
                return false
        }
        return true

    }

    // ID: RQRS-02245; TAG: N2311; NAME: TNM Clin M c,p pre2016 (NAACCR)
    public boolean rqrs02245(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.tnmClinM, "(p0I\\+)"))
            return false
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "pX, p0"))
            return false
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c,p")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmClinM)
        if (functions.GEN_INLIST(code, "X, 0-1", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_MATCH(code, "(0I\\+\\s)"))
            return true
        return false

    }

    // ID: RQRS-02246; TAG: N2312; NAME: TNM Clin N c,p pre2016 (NAACCR)
    public boolean rqrs02246(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmClinN)
        if (functions.GEN_INLIST(code, "X, 0-4", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_MATCH(code, "(0I\\-\\s)") || functions.GEN_MATCH(code, "(0I\\+\\s)") || functions.GEN_MATCH(code, "(0M\\-\\s)") || functions.GEN_MATCH(code, "(0M\\+\\s)") || functions.GEN_MATCH(code, "(1MI\\s)"))
            return true
        return false

    }

    // ID: RQRS-02247; TAG: N2231; NAME: TNM Clin Stage Group, SSF 2 Lymphoma (COC)
    public boolean rqrs02247(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699, 9702-9727,9735, 9737-9738") && functions.GEN_INLIST(untrimmedline.primarySite, "000-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A, 2A, 3A, 4A") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000, 020"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B, 2B, 3B, 4B") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010, 030"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,2,3,4") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9823,9827,9837") && functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1A, 2A, 3A, 4A") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000, 020"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1B, 2B, 3B, 4B") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010, 030"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1,2,3,4") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818,9837") && functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 424", "(C\\d\\d\\d)", 2, 3)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "4A") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000, 020"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "4B") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010, 030"))
                return false
            if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "4") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "999"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02249; TAG: N4902; NAME: TNM Clin Staged By, Date of Diagnosis (COC)
    public boolean rqrs02249(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStagedBy))
                return false
        }
        return true

    }

    // ID: RQRS-02250; TAG: N2018; NAME: TNM Clin Staged By, Date of Diagnosis (SEER)
    public boolean rqrs02250(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2017)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.tnmClinStagedBy)) && dx_year == 2015)
            return true
        return functions.GEN_INLIST(untrimmedline.tnmClinStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")

    }

    // ID: RQRS-02251; TAG: N2317; NAME: TNM Clin T c,p pre2016 (NAACCR)
    public boolean rqrs02251(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88,SU,SD", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "ISPU,ISPD", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinT, 1, 1), "c,p")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmClinT)
        if (functions.GEN_INLIST(code, "X,A, 0-4", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "IS,1A,1B,1C,1D,1M,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E,A1,A2,B1,B2", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "ISU,ISD,1A1,1A2,1B1,1B2,1MI,2A1,2A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-02252; TAG: N2238; NAME: TNM Clin T, Clin Size, Site Spec - Ed 7 (SEER)
    public boolean rqrs02252(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] CLINT = new char[5], TSIZELOW = new char[4], TSIZEHIGH = new char[4], GPCLINT = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        
        char[] t_GrpTCcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical) || functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "999"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04A")) {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "129, 130-139", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "04E")
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "17B")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "241", "(C\\d\\d\\d)", 2, 3))
                                functions.GEN_STRCPY(SiteGrp, "17D")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "04D")
                                else {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                            functions.GEN_STRCPY(SiteGrp, "08A")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                                functions.GEN_STRCPY(SiteGrp, "08B")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "08C")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                            functions.GEN_STRCPY(SiteGrp, "08F")
                                        else
                                            functions.GEN_STRCPY(SiteGrp, "999")
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                            functions.GEN_STRCPY(SiteGrp, "08D")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                                functions.GEN_STRCPY(SiteGrp, "08F")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                                    functions.GEN_STRCPY(SiteGrp, "16A")
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                            functions.GEN_STRCPY(SiteGrp, "020")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                                functions.GEN_STRCPY(SiteGrp, "022")
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                                        else
                                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04D, 04E, 04F, 007, 015, 024, 025, 027, 028, 029, 030, 032, 47A, 47B") && !functions.GEN_INLIST(SiteGrp, "043, 049, 053, 054, 08A, 08B, 08C, 08D, 13B, 16A, 16B, 17A, 17B, 17D, 17E"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1, c1A, c1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "990"))
                return true
            if (functions.GEN_INLIST(SiteGrp, "025")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2A") && functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "990"))
                    return true
            }
            functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
            if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_CLINTSIZ, context.RQRS_CLINTSIZ_GPCLINT, ['GPCODE':GPCODE, 'CLINT':CLINT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPCLINT':GPCLINT])) {
                if (functions.GEN_STRCMP(untrimmedline.tumorSizeClinical, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeClinical, TSIZEHIGH) > 0) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return functions.GEN_ERROR_MSG(binding, 'TNM Clin T of ${untrimmedline.tnmClinT} is not consistent with Tumor Size Clinical of ${untrimmedline.tumorSizeClinical}')
                }
            }
        }
        return true

    }

    // ID: RQRS-02253; TAG: N2403; NAME: TNM Clin T, Date of Diagnosis (SEER)
    public boolean rqrs02253(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.tnmClinT)))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "cX,c0,c1,c1A,c1A1,c1A2,c1B,c1B1,c1B2,c1C,c1D,c1MI,c2,c2A,c2A1,c2A2,c2B,c2C,c2D")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c3,c3A,c3B,c3C,c3D,c4,c4A,c4B,c4C,c4D,c4E,pA,pIS,pISU,pISD,88"))
                    return false
            }
        }
        else
            return true
        
        return true

    }

    // ID: RQRS-02254; TAG: N2235; NAME: TNM Clin T, SSF 2 Melanoma Conjunctiva (COC)
    public boolean rqrs02254(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C690") || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010,015")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1A, 2A, 2C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020,025")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1B, 2B, 2D", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1C, 2B, 2D", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "035")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "040")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1D, 2B, 2D", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "045")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1D", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return false
        }
        return true

    }

    // ID: RQRS-02255; TAG: N2236; NAME: TNM Clin T, SSF 3 Soft Tissue (COC)
    public boolean rqrs02255(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if ((functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.sex, "2,6") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8934, 8940-9136, 9142-9582")) || (functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.sex, "2,6") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921, 9120-9136, 9142-9582")) || (functions.GEN_INLIST(untrimmedline.primarySite, "380-383,388,470-476,478-479,490-496, 498-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8935, 8940-9136, 9142-9582")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C480") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8934, 8940-9136, 9142-9582"))) {
        
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                return true
            if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
                return true
            if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
                return true
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "1B, 2B", "(c[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                    return false
            }
        }
        return true

    }

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

    }

    // ID: RQRS-02257; TAG: N4921; NAME: TNM Edition Number (SEER)
    public boolean rqrs02257(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0001020304050607088899U7", 2) == 0)
            return false
        return true

    }

    // ID: RQRS-02258; TAG: N3987; NAME: TNM Edition Number, AJCC ID (COC)
    public boolean rqrs02258(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.ajccId, "XX  ") != 0) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") == 0)
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02261; TAG: N2013; NAME: TNM Edition Number, Date of Diagnosis (SEER)
    public boolean rqrs02261(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015)
            return true
        if (dx_year == 2015) {
            if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
                    functions.GEN_SAVE_TEXT(binding, 'If dx_year is 2015, then TNM Edition must be 07, 88 or blank')
                    err_flag = 1
                }
            }
        }
        if (dx_year == 2016 || dx_year == 2017) {
            if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88")) {
                functions.GEN_SAVE_TEXT(binding, 'If dx_year is 2016 or 2017, then TNM Edition must be 07,U7,or 88')
                err_flag = 1
            }
        }
        if (dx_year > 2017) {
            if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "08, 88")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
                    functions.GEN_SAVE_TEXT(binding, 'If dx_year is > 2017, then TNM Edition must be 08, 88, or blank')
                    err_flag = 1
                }
            }
        }
        if (err_flag == 1)
            return false
        else
            return true
        
        return true

    }

    // ID: RQRS-02262; TAG: N4028; NAME: TNM Edition Number, Date of Diagnosis, CoC Flag (NPCR)
    public boolean rqrs02262(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year < 2018)
            return true
        if (dx_year >= 2018 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
        
            if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) && functions.GEN_AT(untrimmedline.tnmEditionNumber, "000888", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number must = 00, 08, or 88')
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02265; TAG: N2347; NAME: TNM Edition Number, TNM Fields (NPCR)
    public boolean rqrs02265(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year == 2015) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) || !functions.GEN_EMPTY(untrimmedline.tnmPathM) || !functions.GEN_EMPTY(untrimmedline.tnmPathM) || !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor) || !functions.GEN_EMPTY(untrimmedline.tnmClinT) || !functions.GEN_EMPTY(untrimmedline.tnmClinM) || !functions.GEN_EMPTY(untrimmedline.tnmClinN) || !functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)) {
                if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
                    return false
            }
        }
        return true

    }

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

    }

    // ID: RQRS-02267; TAG: N2349; NAME: TNM Fields, Type of Reporting Source (SEER)
    public boolean rqrs02267(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "88") || !functions.GEN_INLIST(untrimmedline.tnmClinN, "88") || !functions.GEN_INLIST(untrimmedline.tnmClinM, "88") || !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || !functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || !functions.GEN_INLIST(untrimmedline.tnmPathN, "88") || !functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return false
        }
        return true

    }

    // ID: RQRS-02268; TAG: N2318; NAME: TNM Groups Beh 3 with Insitu 88 (COC)
    public boolean rqrs02268(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        char[] t_tnm_msg = new char[79]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1,2"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStgGrp, "1")) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9811-9818, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "046")) {
                                                    if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                        functions.GEN_STRCPY(SiteGrp, "46A")
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "46B")
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51B")
                                                                    else
                                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "053")) {
        
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "007,08A,08B,08C,08D,08E,08F,009,13B,16A,16B,17B,17C,018") || functions.GEN_INLIST(SiteGrp, "36B,36C, 37A,041,043,47A,47B,51A,51B,57B")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
                    return false
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "039")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
                    return false
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "053,054")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "3")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmClinM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathT, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02269; TAG: N4903; NAME: TNM Items, DX Post 2017 (NAACCR)
    public boolean rqrs02269(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path Descriptor must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: RQRS-02270; TAG: N2240; NAME: TNM M, Mets at DX, Melanoma of Skin (COC)
    public boolean rqrs02270(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxLung))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.metsDxLung, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B, c1C, p1C") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B, c1C, p1B,p1C"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.metsDxLung, "0, 9")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B,p1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B, p1B")) {
            if (!functions.GEN_INLIST(untrimmedline.metsDxLung, "1"))
                return false
        }
        return true

    }

    // ID: RQRS-02271; TAG: N2241; NAME: TNM M, SSF 3 Kidney (COC)
    public boolean rqrs02271(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020, 030")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "p1") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "p1"))
                return false
        }
        return true

    }

    // ID: RQRS-02272; TAG: N2242; NAME: TNM M, SSF 4 Melanoma of Skin (COC)
    public boolean rqrs02272(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "010, 020, 030")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1A, c1B, p1A, p1B") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1A, c1B, p1A,p1B"))
                return false
        }
        return true

    }

    // ID: RQRS-02273; TAG: N2243; NAME: TNM M, SSF 4 Uveal Melanoma (COC)
    public boolean rqrs02273(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "693, 694", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c1, c1A, c1B, c1C, p1, p1A, p1B, p1C") || functions.GEN_INLIST(untrimmedline.tnmPathM, "c1, c1A, c1B, c1C, p1, p1A, p1B, p1C"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "001-030, 991")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c1A, p1A") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c1A, p1A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "031-080, 992")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c1B, p1B") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c1B, p1B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "081-980, 993")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "c1C, p1C") && !functions.GEN_INLIST(untrimmedline.tnmPathM, "c1C, p1C"))
                return false
        }
        return true

    }

    // ID: RQRS-02274; TAG: N2245; NAME: TNM N, SSF 3 Melanoma of Skin (COC)
    public boolean rqrs02274(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "c0,p0,p2C,pX"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "pX,p1A,p2A,p3"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "043")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "045")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "048")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "100")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2C", "(c[A-Za-z0-9][A-Za-z0-9]\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        return true

    }

    // ID: RQRS-02275; TAG: N2246; NAME: TNM N, SSF 3 Merkel Cell (COC)
    public boolean rqrs02275(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440, 442-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8247"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "c0, p0, p2, pX"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin N: ${untrimmedline.tnmClinN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010") && !functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "p1A, p2"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path N: ${untrimmedline.tnmPathN} and CS Site-Specific Factor 3: ${untrimmedline.csSiteSpecificFactor3}')
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "100, 150")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "cX", "(c[A-Za-z0-9]\\s\\s)"))
                return false
        }
        return true

    }

    // ID: RQRS-02276; TAG: N2249; NAME: TNM N, SSF 5 Testis (COC)
    public boolean rqrs02276(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "620, 621, 629", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8590-8670, 8940-8950, 8980-8981, 9060-9090, 9100-9105"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "c1, c2,c3", "(c[A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathN, "p1, p2, p3", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c1", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathN, "p1", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c2", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathN, "p2", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "030")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "c3", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathN, "p3", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "999")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "c0", "(c[A-Za-z0-9]\\s\\s)") && functions.GEN_INLIST(untrimmedline.tnmPathN, "p0", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        return true

    }

    // ID: RQRS-02277; TAG: N2250; NAME: TNM Path cN0 2016 (COC)
    public boolean rqrs02277(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(SiteGrp, "031") && functions.GEN_INLIST(untrimmedline.tnmPathT, "1A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathT, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(untrimmedline.tnmPathT, "ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3) || functions.GEN_INLIST(SiteGrp, "16A,16B,027,028,36A"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "1", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(SiteGrp, "16A,16B,027,028,36A"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "2", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(SiteGrp, "36A"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "0,1,2", "(c[A-Za-z0-9]\\s\\s)", 2, 3))
            return false
        
        return true

    }

    // ID: RQRS-02278; TAG: N1809; NAME: TNM Path Descriptor, Date of Diagnosis (NPCR)
    public boolean rqrs02278(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "0-6,9")

    }

    // ID: RQRS-02279; TAG: N2016; NAME: TNM Path Descriptor, Date of Diagnosis (SEER)
    public boolean rqrs02279(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if ((dx_year < 2016) && (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor)))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
                return false
        }
        
        return true

    }

    // ID: RQRS-02280; TAG: N2251; NAME: TNM Path Descriptor, RX Dates - Ed 7 (COC)
    public boolean rqrs02280(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "12"))
                return true
        }
        return false

    }

    // ID: RQRS-02281; TAG: N2348; NAME: TNM Path Descriptor, TNM Fields (NPCR)
    public boolean rqrs02281(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) || !functions.GEN_EMPTY(untrimmedline.tnmPathM) || !functions.GEN_EMPTY(untrimmedline.tnmPathN) || !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
                return false
        }
        return true

    }

    // ID: RQRS-02282; TAG: N2319; NAME: TNM Path M c,p pre2016 (NAACCR)
    public boolean rqrs02282(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "c1M, c1M1"))
            return false
        if (functions.GEN_MATCH(untrimmedline.tnmPathM, "(p0I\\+)"))
            return false
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "c,p")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmPathM)
        if (functions.GEN_INLIST(code, "X, 0-1", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "1A, 1B, 1C, 1D, 1E, 1M", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "1M1", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        if (functions.GEN_MATCH(code, "(0I\\+\\s)"))
            return true
        return false

    }

    // ID: RQRS-02283; TAG: N3021; NAME: TNM Path M1, Clin T, N (COC)
    public boolean rqrs02283(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int dx_year
        
        char[] GrpStg = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(code, untrimmedline.tnmPathN)
        
        if (functions.GEN_INLIST(code, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else
            functions.GEN_STRCPY(SiteGrp, "999")
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                    functions.GEN_STRCPY(SiteGrp, "08F")
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        char[] t_code = new char[5]
        char[] n_code = new char[5]
        char[] m_code = new char[5]
        
        functions.GEN_STRCPY(t_code, untrimmedline.tnmPathT)
        functions.GEN_STRCPY(n_code, untrimmedline.tnmPathN)
        functions.GEN_STRCPY(m_code, untrimmedline.tnmPathM)
        
        if (functions.GEN_INLIST(n_code, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(SiteGrp, "031") && functions.GEN_INLIST(t_code, "1A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(n_code, "0", "(c[A-Za-z0-9]\\s\\s)", 2, 3)) {
            if (functions.GEN_INLIST(t_code, "A", "(p[A-Za-z0-9]\\s\\s)", 2, 3) || functions.GEN_INLIST(t_code, "IS", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3) || functions.GEN_INLIST(t_code, "ISU, ISD", "(p[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])", 2, 3) || functions.GEN_INLIST(SiteGrp, "16A,16B,027,028,51A,51B,52"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "36A,36B,36C")) {
            if (functions.GEN_STRCMP(t_code, "c", 1) == 0 || functions.GEN_STRCMP(n_code, "c", 1) == 0)
                return true
        }
        if (functions.GEN_STRCMP(t_code, "c", 1) == 0) {
            if (functions.GEN_STRCMP(m_code, "p", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T and TNM Path N require TNM Path M1 for clinical T and N to be assigned')
        }
        if (functions.GEN_STRCMP(n_code, "c", 1) == 0) {
            if (functions.GEN_STRCMP(m_code, "p", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T and TNM Path N require TNM Path M1 for clinical T and N to be assigned')
        }
        return true

    }

    // ID: RQRS-02284; TAG: N2320; NAME: TNM Path N c,p pre2016 (NAACCR)
    public boolean rqrs02284(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "c")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "c0"))
                return false
        }
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "c,p")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmPathN)
        if (functions.GEN_INLIST(code, "X, 0-4", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "0A, 0B, 1A, 1B, 1C, 1M, 2A, 2B, 2C, 3A, 3B, 3C", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_MATCH(code, "(0I\\-\\s)") || functions.GEN_MATCH(code, "(0I\\+\\s)") || functions.GEN_MATCH(code, "(0M\\-\\s)") || functions.GEN_MATCH(code, "(0M\\+\\s)") || functions.GEN_MATCH(code, "(1MI\\s)") || functions.GEN_MATCH(code, "(I\\-\\s\\s)") || functions.GEN_MATCH(code, "(I\\+\\s\\s)") || functions.GEN_MATCH(code, "(M\\-\\s\\s)") || functions.GEN_MATCH(code, "(M\\+\\s\\s)"))
            return true
        return false

    }

    // ID: RQRS-02285; TAG: N2262; NAME: TNM Path Stage Group, Prim Site, Surg - Ed 7 (COC)
    public boolean rqrs02285(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "670-679", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-98"))
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site (${untrimmedline.primarySite}), Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}): RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) must = 30-90.')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0", "([A-Za-z0-9]\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-98"))
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site (${untrimmedline.primarySite}), Histologic Type ICD-O-3 (${untrimmedline.histologyIcdO3}), TNM Path Stage Group (${untrimmedline.tnmPathStageGroup}): RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) must = 20 - 90')
            }
        }
        
        return true

    }

    // ID: RQRS-02286; TAG: N0929; NAME: TNM Path Stage Group, TNM Items, ICDO3 (NAACCR)
    public boolean rqrs02286(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06") || functions.GEN_EMPTY(untrimmedline.histologyIcdO3) || functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9596,9650-9667,9670-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'If TNM Path Stage Group not = 88, then TNM Path T and M must not = 88')
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                    return false
            }
        }
        return true

    }

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

    }

    // ID: RQRS-02288; TAG: N2017; NAME: TNM Path Staged By, Date of Diagnosis (SEER)
    public boolean rqrs02288(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2017)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy)) && dx_year == 2015)
            return true
        return functions.GEN_INLIST(untrimmedline.tnmPathStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")

    }

    // ID: RQRS-02289; TAG: N2324; NAME: TNM Path T c,p pre2016 (NAACCR)
    public boolean rqrs02289(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88,SU,SD", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "ISPU,ISPD", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathT, 1, 1), "c,p")) {
            functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
            functions.GEN_STRCAT(code, " ")
        }
        else
            functions.GEN_STRCPY(code, untrimmedline.tnmPathT)
        if (functions.GEN_INLIST(code, "X,A, 0-4", "([A-Za-z0-9]\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "IS,1A,1B,1C,1D,1M,2A,2B,2C,2D,3A,3B,3C,3D,4A,4B,4C,4D,4E,A1,A2,B1,B2", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(code, "ISU,ISD,1A1,1A2,1B1,1B2,1MI,2A1,2A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: RQRS-02290; TAG: N2265; NAME: TNM Path T, Depth, Melanoma - Ed 7 (COC)
    public boolean rqrs02290(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHT = new char[5], SIZELOW = new char[4], SIZEHIGH = new char[4]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTPcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] ssfdepth = new char[4]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04C")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                            functions.GEN_STRCPY(SiteGrp, "04D")
                        else {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                            if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                    functions.GEN_STRCPY(SiteGrp, "08A")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                        functions.GEN_STRCPY(SiteGrp, "08B")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "08C")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    functions.GEN_STRCPY(SiteGrp, "08F")
                                else
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                    functions.GEN_STRCPY(SiteGrp, "08D")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                        functions.GEN_STRCPY(SiteGrp, "08F")
                                    else
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "011")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                            functions.GEN_STRCPY(SiteGrp, "10B")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                            functions.GEN_STRCPY(SiteGrp, "16A")
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "021")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                    functions.GEN_STRCPY(SiteGrp, "020")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                        functions.GEN_STRCPY(SiteGrp, "022")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                    functions.GEN_STRCPY(SiteGrp, "51B")
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "031, 050"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "031,050")) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988, 999"))
                return true
        }
        if (functions.GEN_INLIST(SiteGrp, "031, 050"))
            functions.GEN_STRCPY(ssfdepth, untrimmedline.csSiteSpecificFactor1)
        if (functions.GEN_INLIST(SiteGrp, "050")) {
            if (functions.GEN_INLIST(ssfdepth, "991"))
                functions.GEN_STRCPY(ssfdepth, "005")
            if (functions.GEN_INLIST(ssfdepth, "992,993,994,995"))
                functions.GEN_STRCPY(ssfdepth, "150")
            if (functions.GEN_INLIST(ssfdepth, "996"))
                functions.GEN_STRCPY(ssfdepth, "980")
            if (functions.GEN_INLIST(ssfdepth, "998") && functions.GEN_INLIST(untrimmedline.tnmPathT, "p1A, p1B, p1C, p2A, p2B, p2C"))
                return false
        }
        if (functions.GEN_INLIST(SiteGrp, "031, 050")) {
            functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        }
        if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['GPCODE':GPCODE, 'PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
            if (functions.GEN_STRCMP(ssfdepth, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdepth, SIZEHIGH) > 0)
                return false
        }
        return true

    }

    // ID: RQRS-02291; TAG: N2267; NAME: TNM Path T, Path Size, Site Spec - Ed 7 (SEER)
    public boolean rqrs02291(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHT = new char[5], TSIZELOW = new char[4], TSIZEHIGH = new char[4], GPPATHT = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        char[] t_GrpTPcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) || functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "999"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827,9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04A")) {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "129, 130-139", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "04E")
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "17B")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "241", "(C\\d\\d\\d)", 2, 3))
                                functions.GEN_STRCPY(SiteGrp, "17D")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "04D")
                                else {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                            functions.GEN_STRCPY(SiteGrp, "08A")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                                functions.GEN_STRCPY(SiteGrp, "08B")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "08C")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                            functions.GEN_STRCPY(SiteGrp, "08F")
                                        else
                                            functions.GEN_STRCPY(SiteGrp, "999")
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                            functions.GEN_STRCPY(SiteGrp, "08D")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                                functions.GEN_STRCPY(SiteGrp, "08F")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                                    functions.GEN_STRCPY(SiteGrp, "16A")
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                            functions.GEN_STRCPY(SiteGrp, "020")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                                functions.GEN_STRCPY(SiteGrp, "022")
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                                        else
                                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04A, 04D, 04E, 007, 015, 024, 025, 027, 028, 029, 030, 032, 47A, 47B") && !functions.GEN_INLIST(SiteGrp, "043, 049, 053, 054, 08A, 08B, 08C, 08D, 13B, 16A, 16B, 17A, 17B, 17D, 17E"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1, p1A, p1MI") && functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "990"))
                return true
            if (functions.GEN_INLIST(SiteGrp, "025")) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p2A") && functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "990"))
                    return true
            }
            functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        
            if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_PATHTSIZ, context.RQRS_PATHTSIZ_GPPATHT, ['GPCODE':GPCODE, 'PATHT':PATHT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPPATHT':GPPATHT])) {
                if (functions.GEN_STRCMP(untrimmedline.tumorSizePathologic, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizePathologic, TSIZEHIGH) > 0) {
                    functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                    functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                    functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                    return functions.GEN_ERROR_MSG(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with Tumor Size Pathologic of ${untrimmedline.tumorSizePathologic}')
                }
            }
        }
        return true

    }

    // ID: RQRS-02292; TAG: N2268; NAME: TNM Path T, SSF 1 Retinoblastoma (COC)
    public boolean rqrs02292(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "692", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9510-9514"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "300, 410, 430, 435")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p1"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "440, 460, 465")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "470")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "490")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p2"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "540, 550, 560")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "570")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "590")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "725, ")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p4A"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "745, 755, 810")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p4"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "765, 775, 790")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p4B"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "960, 970")) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && !functions.GEN_INLIST(untrimmedline.tnmPathT, "pX"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pX"))
                return false
        }
        return true

    }

    // ID: RQRS-02293; TAG: N2269; NAME: TNM Path T, SSF 1, 2, 3 Kidney (COC)
    public boolean rqrs02293(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p1, p1A, p1B, p2, p2A, p2B, pX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path T (${untrimmedline.tnmPathT}) and CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1})')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010, 020,030, 991")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3,p3A,p3B,p3C,p4"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path T (${untrimmedline.tnmPathT}) and CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1})')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pX"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path T (${untrimmedline.tnmPathT}) and CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1})')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3, p3A, p3B, p3C, p4, pX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T: ${untrimmedline.tnmPathT} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020, 040, 050, 070")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3B,p3C,p4,pX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T: ${untrimmedline.tnmPathT} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030, 060, 080, 090")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p3C,p4,pX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T: ${untrimmedline.tnmPathT} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pX"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T: ${untrimmedline.tnmPathT} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010, 030, 040")) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p4"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path T (${untrimmedline.tnmPathT}) and CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3})')
            }
        }
        return true

    }

    // ID: RQRS-02294; TAG: N2270; NAME: TNM Path T, SSF 2, 7 Melanoma Skin (COC)
    public boolean rqrs02294(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "1A, 2A, 3A, 4A", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "2B, 3B, 4B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "1B", "(p[A-Za-z0-9][A-Za-z0-9]\\s)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "000, 990,998"))
                return false
        }
        return true

    }

    // ID: RQRS-02295; TAG: N2359; NAME: TNM Stage, Date Dx,Type Report Source (NPCR)
    public boolean rqrs02295(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group cannot be blank if Date of Diagnosis is greater than or equal to 2016')
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group cannot be blank if Date of Diagnosis is greater than or equal to 2016')
        return true

    }

    // ID: RQRS-02296; TAG: N2272; NAME: TNM T, Breast, Inflam Carcinoma (COC)
    public boolean rqrs02296(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinT, "88")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8530"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c4D", "(c[A-Za-z0-9][A-Za-z0-9]\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p4D", "(p[A-Za-z0-9][A-Za-z0-9]\\s)"))
            return false
        return true

    }

    // ID: RQRS-02297; TAG: N2276; NAME: TNM T, Deep Sites Soft Tissue (COC)
    public boolean rqrs02297(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if ((functions.GEN_INLIST(untrimmedline.primarySite, "481-482,488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8934, 8940-9136, 9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6")) || (functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.sex, "2,6") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921, 9120-9136, 9142-9582")) || (functions.GEN_INLIST(untrimmedline.primarySite, "380-383,388", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8935, 8940-9136, 9142-9582")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C480") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8934, 8940-9136, 9142-9152"))) {
        
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c1B, c2B, cX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Clin T (${untrimmedline.tnmClinT}) and Primary Site (${untrimmedline.primarySite})')
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_AT(untrimmedline.tnmPathDescriptor, "46", 1) == 0) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p1B, p2B,pX"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between TNM Path T (${untrimmedline.tnmPathT}) and Primary Site (${untrimmedline.primarySite})')
            }
        }
        return true

    }

    // ID: RQRS-02298; TAG: N2277; NAME: TNM T, Descriptor, SSF 1 Thyroid (COC)
    public boolean rqrs02298(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C739"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8019, 8022-8029, 8033-8576, 8940-8950, 8980-8981") && !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8020, 8021, 8030, 8031, 8032"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor) && functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "0") && !functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "3") && !functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "3,6"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "0") && functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "3") && functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "3, 6")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020"))
                return false
        }
        return true

    }

    // ID: RQRS-02299; TAG: N2278; NAME: TNM T, N, M - No Primary Found (COC)
    public boolean rqrs02299(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.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))) {
            return true
        }
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1")) {
            return true
        }
        if (functions.GEN_STRCMP(untrimmedline.tnmClinT, "c0  ") == 0) {
            if ((functions.GEN_EMPTY(untrimmedline.tnmClinN) || functions.GEN_AT(untrimmedline.tnmClinN, "cx  c0  c0A c0B ", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmClinM) || functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_AT(untrimmedline.tnmPathT, "pX  p0  ", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_AT(untrimmedline.tnmPathN, "pX  p0  c0  p0I+p0I-p0M+p0M-", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmPathM) || functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+", 4) > 0))
                return functions.GEN_ERROR_MSG(binding, 'If TNM Clin T = ${untrimmedline.tnmClinT}, TNM Clin N, TNM Clin M, TNM Path T, TNM Path N and TNM Path M cannot all = c/p0, c/p X, or blank')
        }
        if (functions.GEN_STRCMP(untrimmedline.tnmPathT, "p0  ") == 0) {
            if ((functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_AT(untrimmedline.tnmClinT, "px  p0  ", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmClinN) || functions.GEN_AT(untrimmedline.tnmClinN, "cx  c0  c0A c0B", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmClinM) || functions.GEN_AT(untrimmedline.tnmClinM, "c0  c0I+", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmPathN) || functions.GEN_AT(untrimmedline.tnmPathN, "pX  p0  c0  p0I+p0I-p0M+p0M-", 4) > 0) && (functions.GEN_EMPTY(untrimmedline.tnmPathM) || functions.GEN_AT(untrimmedline.tnmPathM, "c0  c0I+", 4) > 0))
                return functions.GEN_ERROR_MSG(binding, 'If TNM Path T = ${untrimmedline.tnmPathT}, TNM Clin T, TNM Clin N, TNM Clin M, TNM Path N and TNM Path M cannot all = c/p0, c/p X, or blank')
        }
        return true

    }

    // ID: RQRS-02300; TAG: N2325; NAME: TNM T, Size, Uveal Melanoma (COC)
    public boolean rqrs02300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] GPCODE = new char[4], PATHT = new char[5], SIZELOW = new char[4], SIZEHIGH = new char[4]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTPcode = new char[10]
        char[] t_GrpTCcode = new char[10]
        char[] SiteGrp = new char[5]
        
        char[] ssfdepth = new char[4]
        char[] ssfdiameter = new char[4]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
            functions.GEN_STRCPY(SiteGrp, "51A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999") && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8720-8790"))
                    functions.GEN_STRCPY(SiteGrp, "51A")
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "51A"))
            return true
        functions.GEN_STRCPY(ssfdepth, untrimmedline.csSiteSpecificFactor3)
        functions.GEN_STRCPY(ssfdiameter, untrimmedline.csSiteSpecificFactor2)
        
        if (functions.GEN_EMPTY(ssfdepth) && !functions.GEN_EMPTY(ssfdiameter))
            return false
        if (functions.GEN_EMPTY(ssfdiameter) && !functions.GEN_EMPTY(ssfdepth))
            return false
        if (functions.GEN_INLIST(ssfdepth, "990"))
            functions.GEN_STRCPY(ssfdepth, "001")
        if (functions.GEN_INLIST(ssfdepth, "991"))
            functions.GEN_STRCPY(ssfdepth, "030")
        if (functions.GEN_INLIST(ssfdepth, "992"))
            functions.GEN_STRCPY(ssfdepth, "060")
        if (functions.GEN_INLIST(ssfdepth, "993"))
            functions.GEN_STRCPY(ssfdepth, "090")
        if (functions.GEN_INLIST(ssfdepth, "994"))
            functions.GEN_STRCPY(ssfdepth, "120")
        if (functions.GEN_INLIST(ssfdepth, "995"))
            functions.GEN_STRCPY(ssfdepth, "150")
        if (functions.GEN_INLIST(ssfdepth, "996"))
            functions.GEN_STRCPY(ssfdepth, "151")
        if (functions.GEN_INLIST(ssfdiameter, "990"))
            functions.GEN_STRCPY(ssfdiameter, "001")
        if (functions.GEN_INLIST(ssfdiameter, "991"))
            functions.GEN_STRCPY(ssfdiameter, "030")
        if (functions.GEN_INLIST(ssfdiameter, "992"))
            functions.GEN_STRCPY(ssfdiameter, "060")
        if (functions.GEN_INLIST(ssfdiameter, "993"))
            functions.GEN_STRCPY(ssfdiameter, "090")
        if (functions.GEN_INLIST(ssfdiameter, "994"))
            functions.GEN_STRCPY(ssfdiameter, "120")
        if (functions.GEN_INLIST(ssfdiameter, "995"))
            functions.GEN_STRCPY(ssfdiameter, "150")
        if (functions.GEN_INLIST(ssfdiameter, "996"))
            functions.GEN_STRCPY(ssfdiameter, "180")
        if (functions.GEN_INLIST(ssfdiameter, "997"))
            functions.GEN_STRCPY(ssfdiameter, "181")
        if (functions.GEN_INLIST(ssfdepth, "999"))
            return true
        if (functions.GEN_INLIST(ssfdiameter, "999"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
            if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_TUMDIMTR, context.RQRS_TUMDIMTR_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                if (functions.GEN_STRCMP(ssfdiameter, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdiameter, SIZEHIGH) > 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T: ${untrimmedline.tnmClinT} conflicts with CS Site-Specific Factor 2: ${untrimmedline.csSiteSpecificFactor2}')
            }
            if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                if (functions.GEN_STRCMP(ssfdepth, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdepth, SIZEHIGH) > 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T of ${untrimmedline.tnmClinT} is not consistent with CS Site-Specific Factor 3 of ${untrimmedline.csSiteSpecificFactor3}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        
            if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                if (functions.GEN_STRCMP(ssfdepth, SIZELOW) >= 0 && functions.GEN_STRCMP(ssfdepth, SIZEHIGH) <= 0) {
                    if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDIMTR, context.RQRS_TUMDIMTR_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                        if (functions.GEN_STRCMP(ssfdiameter, SIZELOW) >= 0 && functions.GEN_STRCMP(ssfdiameter, SIZEHIGH) <= 0)
                            return true
                    }
                }
            }
            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDIMTR, context.RQRS_TUMDIMTR_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                    if (functions.GEN_STRCMP(ssfdiameter, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdiameter, SIZEHIGH) > 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with CS Site-Specific Factor 2 of ${untrimmedline.csSiteSpecificFactor2}')
                }
                if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                    if (functions.GEN_STRCMP(ssfdepth, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdepth, SIZEHIGH) > 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with CS Site-Specific Factor 3 of ${untrimmedline.csSiteSpecificFactor3}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
        
                functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
                functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
                if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_TUMDIMTR, context.RQRS_TUMDIMTR_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                    if (functions.GEN_STRCMP(ssfdiameter, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdiameter, SIZEHIGH) > 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT}) not consistent with CS Site-Specific Factor 2 of ${untrimmedline.csSiteSpecificFactor2}')
                }
                if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_TUMDEPTH, context.RQRS_TUMDEPTH_GPPATHT, ['PATHT':PATHT, 'SIZELOW':SIZELOW, 'SIZEHIGH':SIZEHIGH])) {
                    if (functions.GEN_STRCMP(ssfdepth, SIZELOW) < 0 || functions.GEN_STRCMP(ssfdepth, SIZEHIGH) > 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T (${untrimmedline.tnmClinT}) and TNM Path T (${untrimmedline.tnmPathT}) not consistent with CS Site-Specific Factor 3 of ${untrimmedline.csSiteSpecificFactor3}')
                }
            }
        }
        return true

    }

    // ID: RQRS-02301; TAG: N2281; NAME: TNM T, SSF 1 Conjunctiva (COC)
    public boolean rqrs02301(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C690") || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "001-050, 991, 990")) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2"))
                    return false
            }
            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p2"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p2") && functions.GEN_INLIST(untrimmedline.tnmClinT, "c2"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "051-980, 992")) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1"))
                    return false
            }
            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1") && functions.GEN_INLIST(untrimmedline.tnmClinT, "c1"))
                return false
        }
        
        return true

    }

    // ID: RQRS-02302; TAG: N2283; NAME: TNM T, SSF 10 Bile Ducts Intrahepatic (COC)
    public boolean rqrs02302(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C221") || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8160, 8161, 8180"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c4", "(c[A-Za-z0-9]\\s\\s)") || functions.GEN_INLIST(untrimmedline.tnmPathT, "p4", "(p[A-Za-z0-9]\\s\\s)")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c4", "(c[A-Za-z0-9]\\s\\s)") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p4", "(p[A-Za-z0-9]\\s\\s)"))
                return false
        }
        return true

    }

    // ID: RQRS-02303; TAG: N2417; NAME: TNM T, SSF 12, Tumor Size, Carcinoma of Skin (COC)
    public boolean rqrs02303(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440, 442-449, 632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8246, 8248-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1", "(c[A-Za-z0-9]\\s\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "000, 001, 991, 993, 999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T: ${untrimmedline.tnmClinT} conflicts with CS Site-Specific Factor12: ${untrimmedline.csSiteSpecificFactor12}')
            }
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2", "(c[A-Za-z0-9]\\s\\s)")) {
                if (functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "001-020") || functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "001-020")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "002,003,004,005,992"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM T, SSF 1, and tumor size')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1", "(p[A-Za-z0-9]\\s\\s)")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "000, 001, 991, 993, 999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with CS Site-Specific Factor12 of ${untrimmedline.csSiteSpecificFactor12}')
            }
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p2", "(p[A-Za-z0-9]\\s\\s)")) {
                if (functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "001-020") || functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "001-020")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "002,003,004,005,992"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among TNM T, SSF 1, and tumor size')
                }
            }
        }
        return true

    }

    // ID: RQRS-02304; TAG: N2285; NAME: TNM T, SSF 6 Breast (COC)
    public boolean rqrs02304(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[100], CSSSF5 = new char[100], NODES = new char[100], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981, 9020"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "4,6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "pIS")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "pIS"))
                return false
        }
        return true

    }

    // ID: RQRS-02305; TAG: N2286; NAME: TNM T, SSF 6 Skin of Eyelid (COC)
    public boolean rqrs02305(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "C441") || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c3A, c3B, c4") && !functions.GEN_INLIST(untrimmedline.tnmPathT, "p3A, p3B, p4"))
                return false
        }
        return true

    }

    // ID: RQRS-02306; TAG: N2287; NAME: TNM T, SSize, Site Spec - Ed 7 (COC)
    public boolean rqrs02306(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        char[] PATHT = new char[5], TSIZELOW = new char[4], TSIZEHIGH = new char[4], GPPATHT = new char[100], CLINT = new char[5], GPCLINT = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_tnm_msg = new char[79]
        
        char[] t_GrpTPcode = new char[10]
        char[] t_GrpTCcode = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "999"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary) || functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "999"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologyIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.RQRS_AC7G2016, context.RQRS_AC7G2016_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9590-9699,9702-9727,9735,9737-9738"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419, 422-423, 425-440, 442-689, 691-694, 698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9823, 9827, 9837"))
                functions.GEN_STRCPY(SiteGrp, "57A")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "9811-9818, 9837"))
                    functions.GEN_STRCPY(SiteGrp, "57C")
                else {
                    if (functions.GEN_INLIST(SiteGrp, "04A")) {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "129, 130-139", "(C\\d\\d\\d)", 2, 3))
                            functions.GEN_STRCPY(SiteGrp, "04E")
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "17B")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "241", "(C\\d\\d\\d)", 2, 3))
                                functions.GEN_STRCPY(SiteGrp, "17D")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "04D")
                                else {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                        functions.GEN_STRCPY(SiteGrp, "999")
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                                        if (functions.GEN_INLIST(untrimmedline.ageAtDx, "000-044"))
                                            functions.GEN_STRCPY(SiteGrp, "08A")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.ageAtDx, "045-998"))
                                                functions.GEN_STRCPY(SiteGrp, "08B")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "08C")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                            functions.GEN_STRCPY(SiteGrp, "08F")
                                        else
                                            functions.GEN_STRCPY(SiteGrp, "999")
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                                            functions.GEN_STRCPY(SiteGrp, "08D")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                                functions.GEN_STRCPY(SiteGrp, "08F")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060")) {
                                                if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                    functions.GEN_STRCPY(SiteGrp, "10B")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8982-8990"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                                    functions.GEN_STRCPY(SiteGrp, "16A")
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                                            functions.GEN_STRCPY(SiteGrp, "020")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                                functions.GEN_STRCPY(SiteGrp, "022")
                                                        }
                                                    }
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                                            if (!functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                                        else
                                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.sex, "2,6"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(SiteGrp, "003, 04A, 04D, 04E, 007, 015, 024, 025, 027, 028, 029, 030, 032, 47A, 47B") && !functions.GEN_INLIST(SiteGrp, "043, 049, 053, 054, 08A, 08B, 08C, 08D, 13B, 16A, 16B, 17A, 17B, 17D, 17E"))
            return true
        if (functions.GEN_INLIST(SiteGrp, "025") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c2A") || functions.GEN_INLIST(untrimmedline.tnmPathT, "p2A"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1, c1A, c1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                return true
            else {
                functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
                functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
                if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_CLINTSIZ, context.RQRS_CLINTSIZ_GPCLINT, ['GPCODE':GPCODE, 'CLINT':CLINT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPCLINT':GPCLINT])) {
                    if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                        functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                        functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                        functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin T of ${untrimmedline.tnmClinT} is not consistent with Tumor Size Summary of ${untrimmedline.tumorSizeSummary}')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
        
            if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p1, p1A, p1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                return true
            else {
                functions.GEN_STRCPY(t_GrpTPcode, SiteGrp)
                functions.GEN_STRCAT(t_GrpTPcode, untrimmedline.tnmPathT)
        
                if (functions.GEN_LOOKUP(t_GrpTPcode, context.RQRS_PATHTSIZ, context.RQRS_PATHTSIZ_GPPATHT, ['GPCODE':GPCODE, 'PATHT':PATHT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPPATHT':GPPATHT])) {
                    if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) <= 0)
                        return true
                    else {
                        if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                            if (functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                return functions.GEN_ERROR_MSG(binding, 'TNM Path T of ${untrimmedline.tnmPathT} is not consistent with Tumor Size Summary of ${untrimmedline.tumorSizeSummary}')
                            }
                            else {
                                if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                                    if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c1, c1A, c1MI") && functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "990"))
                                        return true
                                    else {
                                        functions.GEN_STRCPY(t_GrpTCcode, SiteGrp)
                                        functions.GEN_STRCAT(t_GrpTCcode, untrimmedline.tnmClinT)
        
                                        if (functions.GEN_LOOKUP(t_GrpTCcode, context.RQRS_CLINTSIZ, context.RQRS_CLINTSIZ_GPCLINT, ['GPCODE':GPCODE, 'CLINT':CLINT, 'TSIZELOW':TSIZELOW, 'TSIZEHIGH':TSIZEHIGH, 'GPCLINT':GPCLINT])) {
                                            if (functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZELOW) < 0 || functions.GEN_STRCMP(untrimmedline.tumorSizeSummary, TSIZEHIGH) > 0) {
                                                functions.GEN_STRCPY(t_tnm_msg, "TNM Chapter: ")
                                                functions.GEN_STRCAT(t_tnm_msg, SiteGrp)
                                                functions.GEN_SAVE_TEXT(binding, '_tnm_ms')
                                                return functions.GEN_ERROR_MSG(binding, 'Tumor Size Summary of ${untrimmedline.tumorSizeSummary} is not consistent with TNM Clin T of ${untrimmedline.tnmClinT} and TNM Path T of ${untrimmedline.tnmPathT}')
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: RQRS-02307; TAG: N2326; NAME: TNM T3, Carcinoma of Skin (COC)
    public boolean rqrs02307(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "440, 442-449,632", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8246, 8248-8576, 8940-8950, 8980-8981"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) && functions.GEN_EMPTY(untrimmedline.tnmClinT))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c3") || functions.GEN_INLIST(untrimmedline.tnmPathT, "p3")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "440, 442-444, 448-449", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        return true

    }

    // ID: RQRS-02308; TAG: N2561; NAME: Total Dose (COC)
    public boolean rqrs02308(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_INLIST(untrimmedline.totalDose, "000000-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: RQRS-02309; TAG: N2692; NAME: Tumor Deposits, Date DX (NAACCR)
    public boolean rqrs02309(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorDeposits))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits))
            return true
        if (functions.GEN_AT(untrimmedline.tumorDeposits, "X1X2X8X9", 2) == 0 && !functions.GEN_MATCH(untrimmedline.tumorDeposits, "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.tumorDeposits} not valid code for Tumor Deposits')
        return true

    }

    // ID: RQRS-02310; TAG: N2992; NAME: Tumor Deposits, Schema ID, Required (NAACCR)
    public boolean rqrs02310(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02311; TAG: N2723; NAME: Tumor Growth Pattern, Date DX (NAACCR)
    public boolean rqrs02311(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Growth Pattern must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern))
            return true
        if (functions.GEN_AT(untrimmedline.tumorGrowthPattern, "12389", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.tumorGrowthPattern} not valid code for Tumor Growth Pattern')
        return true

    }

    // ID: RQRS-02312; TAG: N2966; NAME: Tumor Growth Pattern, Schema ID, Required (NAACCR)
    public boolean rqrs02312(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00230", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern) || functions.GEN_AT(untrimmedline.tumorGrowthPattern, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02313; TAG: N0028; NAME: Tumor Marker 1, Date of Diagnosis (SEER IF65)
    public boolean rqrs02313(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544")) {
            return true
        }
        if (dx_year < 1990 && functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") == false)
            return false
        if (dx_year < 1998) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") == true))
                return true
            else
                return false
        }
        if (dx_year < 2004) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker1, "0,2,4-6,8-9") == true) || (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") == true))
                return true
            else
                return false
        }
        if (dx_year > 2003) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorMarker1))
                return false
        }
        return true

    }

    // ID: RQRS-02314; TAG: N0029; NAME: Tumor Marker 1, Type of Report Srce (SEER IF67)
    public boolean rqrs02314(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544"))
            return true
        if (dx_year > 2003) {
            return true
        }
        if ((dx_year >= 1990 && functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) || (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "619-629", "(C\\d\\d\\d)", 2, 3))) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "0"))
                return false
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
                return false
        }
        return true

    }

    // ID: RQRS-02315; TAG: N0030; NAME: Tumor Marker 2, Date of Diagnosis (SEER IF66)
    public boolean rqrs02315(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544")) {
            return true
        }
        if (dx_year < 1990 && functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") == false)
            return false
        if (dx_year < 1998) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") == true))
                return true
            else
                return false
        }
        if (dx_year < 2004) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9") == true) || (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true && functions.GEN_INLIST(untrimmedline.tumorMarker2, "0,2,4-6,8-9") == true) || (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") == true))
                return true
            else
                return false
        }
        if (dx_year > 2003) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorMarker2))
                return false
        }
        return true

    }

    // ID: RQRS-02316; TAG: N0031; NAME: Tumor Marker 2, Type of Report Srce (SEER IF68)
    public boolean rqrs02316(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544"))
            return true
        if (dx_year > 2003) {
            return true
        }
        if ((dx_year >= 1990 && functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) || (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "619-629", "(C\\d\\d\\d)", 2, 3))) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "0"))
                return false
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "9"))
                return false
        }
        return true

    }

    // ID: RQRS-02317; TAG: N0289; NAME: Tumor Marker 3, Date of Diagnosis (SEER IF73)
    public boolean rqrs02317(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544")) {
            return true
        }
        if (dx_year < 1998 && functions.GEN_INLIST(untrimmedline.tumorMarker3, "9") == false)
            return false
        if (dx_year < 2004) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true) {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "0,2,4-6,8-9") == true)
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "9") == true)
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2003) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorMarker3))
                return false
        }
        return true

    }

    // ID: RQRS-02318; TAG: N0290; NAME: Tumor Marker 3, Type of Report Srce (SEER IF74)
    public boolean rqrs02318(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544"))
            return true
        if (dx_year > 2003) {
            return true
        }
        if (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker3, "0"))
                return false
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker3, "9"))
                return false
        }
        return true

    }

    // ID: RQRS-02319; TAG: N0087; NAME: Tumor Record Number (NAACCR)
    public boolean rqrs02319(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.tumorRecordNumber, "1-99", "(\\d\\d)")

    }

    // ID: RQRS-02320; TAG: N2143; NAME: Tumor Size Clinical (SEER)
    public boolean rqrs02320(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "000-990, 998, 999", "(\\d\\d\\d)")

    }

    // ID: RQRS-02321; TAG: N2144; NAME: Tumor Size Clinical, Date of Diagnosis (SEER)
    public boolean rqrs02321(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
                return false
        }
        if (dx_year < 2016) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If year of Date of Diagnosis < 2016, then Tumor Size Clinical must be blank')
        }
        return true

    }

    // ID: RQRS-02322; TAG: N2327; NAME: Tumor Size Clinical, Primary Site (SEER)
    public boolean rqrs02322(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "199, 209, 180, 182-189,150-155, 158, 159", "(C\\d\\d\\d)", 2, 4) && !functions.GEN_INLIST(untrimmedline.primarySite, "160-166, 168, 169, 340-343, 348, 349, 500-506, 508, 509", "(C\\d\\d\\d)", 2, 4))
                return false
        }
        return true

    }

    // ID: RQRS-02323; TAG: N2289; NAME: Tumor Size Clinical, TNM Clin T (SEER)
    public boolean rqrs02323(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) || functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "c0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "c0")) {
            if (!functions.GEN_INLIST(untrimmedline.tumorSizeClinical, "000"))
                return false
        }
        return true

    }

    // ID: RQRS-02324; TAG: N2145; NAME: Tumor Size Pathologic (SEER)
    public boolean rqrs02324(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "000-990, 998, 999", "(\\d\\d\\d)")

    }

    // ID: RQRS-02325; TAG: N2407; NAME: Tumor Size Pathologic, Date of Diagnosis (SEER)
    public boolean rqrs02325(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015) {
            if (functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
                return false
        }
        if (dx_year < 2016) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2016, then Tumor Size Pathologic must be blank')
        }
        return true

    }

    // ID: RQRS-02326; TAG: N2328; NAME: Tumor Size Pathologic, Primary Site (SEER)
    public boolean rqrs02326(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "199, 209, 180, 182-189,150, 155-158, 159", "(C\\d\\d\\d)", 2, 4) && !functions.GEN_INLIST(untrimmedline.primarySite, "160-166, 168, 169, 340-343, 348, 349, 500-506, 508, 509", "(C\\d\\d\\d)", 2, 4))
                return false
        }
        return true

    }

    // ID: RQRS-02327; TAG: N2425; NAME: Tumor Size Pathologic, SSF 6 Breast (SEER)
    public boolean rqrs02327(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CSSSF4 = new char[100], CSSSF5 = new char[100], NODES = new char[100], SS4SS5 = new char[100]
        
        char[] nodes45 = new char[7]
        char[] pnodes = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || (dx_year < 2016) || (dx_year > 2017))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) || !functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-8576, 8940-8950, 8980-8981, 9020"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "060")) {
            if (functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
                return true
            if (!functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Pathologic (${untrimmedline.tumorSizePathologic}), CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) and Primary Site (${untrimmedline.primarySite}) conflict')
        }
        else
            return true
        
        return true

    }

    // ID: RQRS-02328; TAG: N2291; NAME: Tumor Size Pathologic, TNM Path T (SEER)
    public boolean rqrs02328(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT) || functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "p0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "p0")) {
            if (!functions.GEN_INLIST(untrimmedline.tumorSizePathologic, "000"))
                return false
        }
        return true

    }

    // ID: RQRS-02329; TAG: N0457; NAME: Type of Rep Srce(DC),Seq Num--Cent,ICDO3 (SEER IF04)
    public boolean rqrs02329(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.overRideReportSource, "1")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8000-9589", "(\\d\\d\\d\\d)"))) {
            if (!functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00,60"))
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02331; TAG: N0089; NAME: Type of Report Srce (DC/AO), SEER Fup (SEER IF10)
    public boolean rqrs02331(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (!functions.GEN_INLIST(untrimmedline.seerTypeOfFollowUp, "1"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.seerTypeOfFollowUp, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return false
        }
        return true

    }

    // ID: RQRS-02332; TAG: N0306; NAME: Type of Report Srce(DC), EOD Coding Sys (SEER IF11)
    public boolean rqrs02332(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && (dx_year < 1983)) {
            if (!functions.GEN_INLIST(untrimmedline.eodCodingSys, "0"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02335; TAG: N0405; NAME: Type of Report Srce(DC/AO), Vit Stat (COC)
    public boolean rqrs02335(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
                return functions.GEN_ERROR_TEXT(binding, 'If Type of Reporting Source = 6 or 7, Vital Status must = 0 ')
            }
        }
        return true

    }

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

    }

    // ID: RQRS-02337; TAG: N0315; NAME: Type of Report Srce, Diagnostic Proc (SEER IF20)
    public boolean rqrs02337(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year > 1987) {
            if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                return true
            else
                return false
        }
        if (dx_year < 1983) {
            if (functions.GEN_VAL(untrimmedline.eodCodingSys) == 2) {
                if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                    return false
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9714") && functions.GEN_MATCH(untrimmedline.primarySite, "(C77[0-9])|(C024)|(C09[8-9])|(C111)|(C142)|(C379)|(C422)")) {
                        if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,31,32,40-45"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,40,50,60,70,80,90,91"))
                            return true
                        else
                            return false
                    }
                }
            }
            else {
                if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                    return true
                else
                    return false
            }
        }
        else {
            if (dx_year > 1982 && dx_year < 1988 && functions.GEN_INLIST(untrimmedline.registryId, "0000001529"))
                return true
        }
        if (dx_year > 1982 && dx_year < 1988) {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9667,9670-9698,9702-9714,9740-9741")) {
                if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30-32,40-45"))
                    return true
                else
                    return false
            }
            else {
                if ((functions.GEN_MATCH(untrimmedline.primarySite, "(C44[0-9])") && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790")) || functions.GEN_MATCH(untrimmedline.primarySite, "(C16[0-9])|(C18[0-9])|(C199)|(C209)|(C34[0-9])|(C50[0-9])|(C53[0-9])|(C54[0-9])|(C619)|(C67[0-9])")) {
                    if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,40,50,60,70,80,90,91"))
                        return true
                    else
                        return false
                }
            }
            if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02339; TAG: N0792; NAME: Type of Reporting Source, Date of DX (SEER IF152)
    public boolean rqrs02339(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (dx_year > 2005)
            return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1-8")
        return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1,3-7")

    }

    // ID: RQRS-02340; TAG: N2701; NAME: Ulceration, Date DX (NAACCR)
    public boolean rqrs02340(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ulceration))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ulceration must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ulceration))
            return true
        if (functions.GEN_AT(untrimmedline.ulceration, "0189", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ulceration} not valid code for Ulceration')
        return true

    }

    // ID: RQRS-02341; TAG: N2967; NAME: Ulceration, Schema ID, Required (NAACCR)
    public boolean rqrs02341(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.ulceration) || functions.GEN_AT(untrimmedline.ulceration, "8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02344; TAG: N0408; NAME: Unknown Site, Summary Stage 1977, ICDO2 (NAACCR)
    public boolean rqrs02344(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.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140,9590-9698,9702-9717,9720-9989"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02347; TAG: N0495; NAME: Verify ICDO2 to ICDO3 Conversion (NAACCR)
    public boolean rqrs02347(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] W_HIST2 = new char[5], W_BEH2 = new char[2], W_MORPH2 = new char[6], W_SITE = new char[5]
        char[] W_MORPH2_SITE = new char[12]
        char[] W_HIST2_SITE = new char[11]
        char[] W_HIST3 = new char[5], W_BEH3 = new char[2], W_MORPH3 = new char[6]
        char[] T_HIST3 = new char[5], T_MORPH3 = new char[6]
        char[] ICDO3_HIST = new char[5], ICDO3_BEH = new char[2]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        }
        if ((dx_year > 2000) || functions.GEN_EMPTY(untrimmedline.morphologyIcdO2) || functions.GEN_EMPTY(untrimmedline.morphologyIcdO3) || functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "3,4"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2)) {
            if (functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "85103")) {
                if (functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "85103, 85133"))
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2)) {
            if (functions.GEN_INLIST(untrimmedline.morphologyIcdO2, "85102")) {
                if (functions.GEN_INLIST(untrimmedline.morphologyIcdO3, "85102, 85132")) {
                    return true
                }
            }
        }
        functions.GEN_STRCPY(W_MORPH2, untrimmedline.morphologyIcdO2, 5)
        functions.GEN_STRCPY(W_HIST2, untrimmedline.morphologyIcdO2, 4)
        functions.GEN_STRCPY(W_BEH2, functions.GEN_SUBSTR(untrimmedline.morphologyIcdO2, 5, 1))
        functions.GEN_STRCPY(W_MORPH3, untrimmedline.morphologyIcdO3, 5)
        functions.GEN_STRCPY(W_HIST3, untrimmedline.morphologyIcdO3, 4)
        functions.GEN_STRCPY(W_BEH3, functions.GEN_SUBSTR(untrimmedline.morphologyIcdO3, 5, 1))
        functions.GEN_STRCPY(W_SITE, "   ")
        
        if (functions.GEN_INLIST(W_HIST2, "8510")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "73", "(C\\d\\d\\d)", 2, 2))
                functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
        }
        else {
            if (functions.GEN_INLIST(W_MORPH2, "89300")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "15-21,26,54,64", "(C\\d\\d\\d)", 2, 2))
                    functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
            }
            else {
                if (functions.GEN_INLIST(W_HIST2, "8930,8930")) {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "15-21,26,54", "(C\\d\\d\\d)", 2, 2))
                        functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
                }
                else {
                    if (functions.GEN_INLIST(W_HIST2, "9731")) {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "40,41", "(C\\d\\d\\d)", 2, 2))
                            functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
                    }
                }
            }
        }
        functions.GEN_STRCPY(W_MORPH2_SITE, W_MORPH2)
        functions.GEN_STRCAT(W_MORPH2_SITE, W_SITE)
        
        if (functions.GEN_LOOKUP(W_MORPH2_SITE, context.RQRS_CONV2TO3, context.RQRS_CONV2TO3_MORPH2SITE, ['ICDO3_HIST':ICDO3_HIST, 'ICDO3_BEH':ICDO3_BEH])) {
            functions.GEN_STRCPY(T_MORPH3, ICDO3_HIST)
            functions.GEN_STRCAT(T_MORPH3, ICDO3_BEH) /* check that ICDO3 code matches converted value per table */
            if (functions.GEN_VAL(W_MORPH3) != functions.GEN_VAL(T_MORPH3)) {
                functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-3 not found in conversion table')
                return true
            }
            else
                return true
        }
        if (functions.GEN_VAL(W_BEH2) != functions.GEN_VAL(W_BEH3)) {
            functions.GEN_SET_WARNING(binding, 'Conflict between ICD-O-2 Behavior and ICD-O-3 Behavior')
            return true
        }
        functions.GEN_STRCPY(W_HIST2_SITE, W_HIST2)
        functions.GEN_STRCAT(W_HIST2_SITE, W_SITE) /* if ICDO2 hist/site not found set warning */
        if (!functions.GEN_LOOKUP(W_HIST2_SITE, context.RQRS_CONV2TO3, context.RQRS_CONV2TO3_HIST2SITE, ['ICDO3_HIST':ICDO3_HIST, 'ICDO3_BEH':ICDO3_BEH])) {
            functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-2 not found in conversion table')
            return true
        }
        else {
            functions.GEN_STRCPY(T_HIST3, ICDO3_HIST)
            if (functions.GEN_VAL(W_HIST3) != functions.GEN_VAL(T_HIST3)) {
                functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-3 not found in conversion table')
                return true
            }
        }
        return true

    }

    // ID: RQRS-02348; TAG: N2671; NAME: Visceral and Parietal Pleural Invasion, Date DX (NAACCR)
    public boolean rqrs02348(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Visceral and Parietal Pleural Invasion must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "01234689", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.visceralAndParietalPleuralInvasion} not valid code for Visceral and Parietal Pleural Invasion')
        return true

    }

    // ID: RQRS-02349; TAG: N2872; NAME: Visceral and Parietal Pleural Invasion, Schema ID, Required (NAACCR)
    public boolean rqrs02349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "8") != 0)
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: RQRS-02352; TAG: N0250; NAME: Vital Status, Cause of Death (SEER IF36)
    public boolean rqrs02352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int cod_num
        
        
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
            if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
                return false
        }
        return true

    }

    // ID: RQRS-02353; TAG: 2042; NAME: County at DX Geocode1990 (NAACCR)
    public boolean rqrs02353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        // This edit could not be translated because it contains invalid syntax.
        
        return true

    }

    // ID: RQRS-02354; TAG: N0618; NAME: EOD-4 Extension (SEER)
    public boolean rqrs02354(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodOld4DigitExtent))
            return true
        return functions.GEN_MATCH(untrimmedline.eodOld4DigitExtent, "(\\d)")

    }

    // ID: RQRS-02355; TAG: N0619; NAME: EOD-4 Lymph Nodes (SEER)
    public boolean rqrs02355(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodOld4DigitNodes))
            return true
        return functions.GEN_MATCH(untrimmedline.eodOld4DigitNodes, "(\\d)")

    }

    // ID: RQRS-02356; TAG: N0620; NAME: EOD-4 Tumor Size (SEER)
    public boolean rqrs02356(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.eodOld4DigitSize))
            return true
        return functions.GEN_MATCH(untrimmedline.eodOld4DigitSize, "(\\d\\d)")

    }

    // ID: RQRS-02357; TAG: N2432; NAME: Mets at DX-Other (COC)
    public boolean rqrs02357(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (!functions.GEN_INLIST(untrimmedline.metsDxOther, "0,1,2,8,9"))
            return false
        
        return true

    }

    // ID: RQRS-02358; TAG: N2433; NAME: Mets at DX-Other, TNM Clin M, Path M (COC)
    public boolean rqrs02358(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2016)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        if (functions.GEN_INLIST(untrimmedline.metsDxOther, "1,2")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c0, c0I+") && functions.GEN_EMPTY(untrimmedline.tnmPathM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other=${untrimmedline.metsDxOther} and TNM Path M =${untrimmedline.tnmPathM}, TNM Clin M must not = ${untrimmedline.tnmClinM}')
        }
        if (functions.GEN_INLIST(untrimmedline.metsDxOther, "1,2")) {
            if (functions.GEN_INLIST(untrimmedline.tnmPathM, "c0, c0I+") && functions.GEN_EMPTY(untrimmedline.tnmClinM))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther} and TNM Clin M = ${untrimmedline.tnmClinM}, TNM Path M must not = ${untrimmedline.tnmPathM}')
        }
        if (functions.GEN_INLIST(untrimmedline.metsDxOther, "1,2")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "c0, c0I+") && functions.GEN_INLIST(untrimmedline.tnmPathM, "c0,c0I+"))
                return functions.GEN_ERROR_MSG(binding, 'if Mets at DX-Other = ${untrimmedline.metsDxOther}, both TNM Clin M and TNM Path M must not = no metastasis')
        }
        
        return true

    }

    // ID: RQRS-02359; TAG: N5040; NAME: Rad--Regional Dose: cGy, Date of Diagnosis Pre2018 (COC)
    public boolean rqrs02359(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
                return false
        }
        return true

    }

    // ID: RQRS-02360; TAG: N5039; NAME: Rad--Regional RX Modality, Date of Diagnosis Pre2018 (COC)
    public boolean rqrs02360(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                return false
        }
        return true

    }

    // ID: RQRS-02361; TAG: N0195; NAME: RX Summ--Radiation (NAACCR)
    public boolean rqrs02361(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0-5,7-9")

    }

    // ID: RQRS-02362; TAG: N0198; NAME: Vital Status (SEER FUPSTAT)
    public boolean rqrs02362(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.vitalStatus, "1,4", "(\\d)")

    }

    // ID: RQRS-02363; TAG: N6064; NAME: AJCC TNM Clin/Path T (COC)
    public boolean rqrs02363(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.ajccId, "XX  ") || functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") == 0)
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.RQRS_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.ajccTnmPathT))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.RQRS_GEN_RIGHT)), "pT0") != 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmClinT, ((Integer)context.RQRS_GEN_RIGHT)), "cT0cTX", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.ajccTnmClinT))
                return false
        }
        return true

    }

    // ID: RQRS-02364; TAG: N5036; NAME: AJCC TNM N Suffix, Date of Sentinel Node Biopsy (COC)
    public boolean rqrs02364(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        char[] cnsuff = new char[5]
        char[] pnsuff = new char[5]
        char[] ptnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(cnsuff, " ")
        functions.GEN_STRCAT(cnsuff, untrimmedline.ajccTnmClinNSuffix)
        functions.GEN_STRCPY(pnsuff, " ")
        functions.GEN_STRCAT(pnsuff, untrimmedline.ajccTnmPathNSuffix)
        functions.GEN_STRCPY(ptnsuff, " ")
        functions.GEN_STRCAT(ptnsuff, untrimmedline.ajccTnmPostTherapyNSuffix)
        
        if (functions.GEN_AT(cnsuff, " (sn)") != 0 || functions.GEN_AT(pnsuff, " (sn)") != 0 || functions.GEN_AT(ptnsuff, " (sn)") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) && functions.GEN_AT(untrimmedline.dateSentinelLymphNodeBiopsyFlag, "12") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02365; TAG: N5026; NAME: AJCC TNM Post Therapy Stage, RX Dates (COC)
    public boolean rqrs02365(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR)) || dx_year < 2018) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "08")) {
            return true
        }
        if ((functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.RQRS_GEN_RIGHT)), "88") != 0) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.rxDateMostDefinSurg, ((Integer)context.RQRS_GEN_DT_MAX))
        
            if (dtcmp != ((Integer)context.RQRS_GEN_DT_ERROR)) {
                if (dtcmp < 0)
                    return true
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "12"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "12"))
                return true
        }
        return false

    }

    // ID: RQRS-02366; TAG: N5020; NAME: Autopsy Only, RX, Schema ID (NPCR)
    public boolean rqrs02366(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            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
        }
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00822 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
        }
        else {
            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.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 (!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.rxSummSystemicSurgSeq, "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: RQRS-02367; TAG: N5041; NAME: Brain Molecular Markers, Summary Stage 2018 (NAACCR)
    public boolean rqrs02367(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) || functions.GEN_AT(untrimmedline.brainMolecularMarkers, "88") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "8699", 2) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02368; TAG: N5031; NAME: Breast, Nodes Pos/Ex, EOD Regional Nodes (NAACCR)
    public boolean rqrs02368(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "030050070", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "0", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0099") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} ')
        }
        if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-90,96-98") && functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} and Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

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

    }

    // ID: RQRS-02370; TAG: N3034; NAME: Circumferential Resection Margin (CRM), Colon, Surg Prim Site/Margins (NAACCR)
    public boolean rqrs02370(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin) || functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-28")) {
            if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.7", 4) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-80")) {
            if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.7", 4) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, " 0.0", 4) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgicalMargins, "0", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins}')
        }
        return true

    }

    // ID: RQRS-02371; TAG: N5022; NAME: Date Initial RX SEER, Ca Dir RX, Schema ID (SEER)
    public boolean rqrs02371(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int scope_flag
        int dx_year
        int seer_init_year
        
        scope_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        seer_init_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfInitialRx)
        
        if (seer_init_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98")) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16") || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
            if (functions.GEN_INLIST(untrimmedline.dateOfInitialRxFlag, "11"))
                return false
            else
                return true
        }
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 99999 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                scope_flag = 1
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0"))
                scope_flag = 1
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99")) {
                    scope_flag = 1
                }
            }
        }
        if (seer_init_year != ((Integer)context.RQRS_GEN_DT_EMPTY)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (scope_flag == 1) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99") && functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8"))
                return false
        }
        return true

    }

    // ID: RQRS-02372; TAG: N6071; NAME: Date of Diagnosis, Date Flag, 2019 (NAACCR)
    public boolean rqrs02372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int dx_contact
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_contact = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (dx_contact == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_contact == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_contact < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return false
        if (!functions.GEN_EMPTY(untrimmedline.dateOfDiagnosisFlag))
            return false
        return true

    }

    // ID: RQRS-02373; TAG: N4030; NAME: Date of Sentinel Lymph Node Biopsy Flag, RX Summ Scope Reg LN Sur (COC)
    public boolean rqrs02373(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfSentinelLymphNodeBiopsy) && functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "267", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02374; TAG: N4031; NAME: Date Regional LN Dissection Flag, RX Summ Scope Reg LN Sur (COC)
    public boolean rqrs02374(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) && functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "34567", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02375; TAG: N4209; NAME: Date Regional LN Dissection Flag, RX Summ Scope Reg LN Sur, CoC Flag (SEER)
    public boolean rqrs02375(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) && functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "34567", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02376; TAG: N4210; NAME: Date Regional Lymph Node Dissection, RX Date Surgery (NAACCR)
    public boolean rqrs02376(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLymphNodeDissection, untrimmedline.rxDateSurgery, ((Integer)context.RQRS_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: RQRS-02377; TAG: N6076; NAME: EOD Mets, Type of Reporting Source (SEER)
    public boolean rqrs02377(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "99") != 0) {
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02378; TAG: N6079; NAME: EOD Regional Nodes, Regional Nodes Positive (SEER)
    public boolean rqrs02378(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02379; TAG: N5032; NAME: ER Summary, Breast, ER Percent, Allred (NAACCR)
    public boolean rqrs02379(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorPercentPositiveOrRange, "000XX9XX8", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercentPositiveOrRange)) {
            if (functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "0") != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.estrogenReceptorTotalAllredScore, "00X9X8", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore)) {
            if (functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02380; TAG: N5045; NAME: Extranodal Extension, Head and Neck Path, EOD Regional Nodes (NAACCR)
    public boolean rqrs02380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckPathological, "X.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 3, 1))
        
        if (functions.GEN_AT(code, "00090 00100 ", 6) == 0) {
            if (functions.GEN_AT(ENE, "00", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200250300400450", 3) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(code, "00090 00140 ", 6) == 0) {
            if (functions.GEN_INLIST(ENE, "01-99, X1-X4")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "150500600700", 3) == 0)
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02381; TAG: N3090; NAME: Extranodal Extension, Head and Neck, EOD Regional Nodes (NAACCR)
    public boolean rqrs02381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "8") != 0) || (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckPathological, "X.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 3, 1))
        
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "7", 1) != 0 && functions.GEN_AT(ENE, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                return false
        }
        if (functions.GEN_AT(code, "00090 00100 ", 6) == 0) {
            if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "07", 1) != 0 && functions.GEN_AT(ENE, "00", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200250300400", 3) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(code, "00090 00140 ", 6) == 0) {
            if (functions.GEN_INLIST(ENE, "01-99, X1-X4")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "150500600700", 3) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(code, "00090 00100 00140 00130 ", 6) == 0) {
            if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "12", 1) != 0 && functions.GEN_AT(ENE, "X7") != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "450", 3) == 0)
                    return false
            }
        }
        return true

    }

    // ID: RQRS-02382; TAG: N5044; NAME: Extranodal Extension, Head and Neck, Summary Stage 2018 (NAACCR)
    public boolean rqrs02382(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckClinical) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadAndNeckPathological) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckPathological, "X.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadAndNeckPathological, 3, 1))
        
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "7", 1) != 0 && functions.GEN_AT(ENE, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadAndNeckClinical, "012", 1) != 0 || functions.GEN_INLIST(ENE, "00-09, X1-X4")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02383; TAG: N3043; NAME: Extranodal Extension, Merkel Cell, EOD Regional Nodes (NAACCR)
    public boolean rqrs02383(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "79", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200650999", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "79", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "300350500750", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: RQRS-02384; TAG: N5046; NAME: Extranodal Extension, Merkel Cell, Summary Stage 2018 (NAACCR)
    public boolean rqrs02384(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012", 1) != 0 || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02385; TAG: N3035; NAME: Extranodal Extension, Penis, EOD Regional Nodes (NAACCR)
    public boolean rqrs02385(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "79", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200300", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionPath, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400500", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionPath, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "500", 3) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02386; TAG: N5047; NAME: Extranodal Extension, Penis, Summary Stage 2018 (NAACCR)
    public boolean rqrs02386(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "012", 1) != 0 || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02387; TAG: N2880; NAME: FIGO Stage, Schema ID (NAACCR)
    public boolean rqrs02387(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], FIGO = new char[3]
        
        int dx_year
        
        char[] group_FIGO = new char[8]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.figoStage)) {
            functions.GEN_STRCPY(group_FIGO, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_FIGO, untrimmedline.figoStage)
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_FIGOSTAGE, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_FIGOSTAGE_SCHEMA_IDFIGO, group_FIGO, ['SCHEMA_ID':SCHEMA_ID, 'FIGO':FIGO]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'FIGO Stage must be blank for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: RQRS-02388; TAG: N5048; NAME: FIGO Stage, Summary Stage 2018 (NAACCR)
    public boolean rqrs02388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[70]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 00530 00541 00542 00551 00552 00553 00560 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage) || functions.GEN_AT(untrimmedline.figoStage, "98") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.figoStage, "97", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.figoStage, "97") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02389; TAG: N3953; NAME: Gleason Pathological, Tertiary Pattern, Grade Post Therapy (NAACCR)
    public boolean rqrs02389(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8")))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9", 1) == 0) {
            if ((functions.GEN_AT(GPP, "X9", 2) == 0 && functions.GEN_AT(GPP, "X8", 2) == 0 && !functions.GEN_EMPTY(GPP)) || (functions.GEN_AT(GSP, "X9", 2) == 0 && functions.GEN_AT(GSP, "X8", 2) == 0 && !functions.GEN_EMPTY(GSP)) || (functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X9", 2) == 0 && functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)))
                return false
        }
        return true

    }

    // ID: RQRS-02390; TAG: N3950; NAME: Gleason Pathological, Tertiary Pattern, Sequence (NAACCR)
    public boolean rqrs02390(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq) && functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "24", 1) != 0 || functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "24", 1) != 0) {
            if ((functions.GEN_AT(GPP, "X9") == 0 && functions.GEN_AT(GPP, "X8") == 0 && !functions.GEN_EMPTY(GPP)) || (functions.GEN_AT(GSP, "X9") == 0 && functions.GEN_AT(GSP, "X8") == 0 && !functions.GEN_EMPTY(GSP)) || (functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X9") == 0 && functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") == 0 && !functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)))
                return false
        }
        return true

    }

    // ID: RQRS-02391; TAG: N3951; NAME: Gleason Patterns Clinical, Grade Clinical (NAACCR)
    public boolean rqrs02391(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(GPC, "111213212223313233", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "01") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "34", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "02") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "43", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "03") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "443553", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "04") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "455455", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "5") == 0)
                return false
        }
        
        return true

    }

    // ID: RQRS-02392; TAG: N4213; NAME: Gleason Patterns Pathological, Grade Pathological (NAACCR)
    public boolean rqrs02392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GPP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        if ((functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (clin > path && clin != 9)
            return true
        if (functions.GEN_AT(GPP, "111213212223313233", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "01") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "34", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "02") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "43", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "03") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "443553", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "04") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "455455", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "5") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02393; TAG: N6078; NAME: Gleason Patterns Pathological, Prostate Pathological Extension (SEER)
    public boolean rqrs02393(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GPP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        
        if (functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0 || functions.GEN_AT(GPP, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
            return true
        if (functions.GEN_AT(GPP, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "900") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "900") != 0) {
            if (functions.GEN_AT(GPP, "X7", 2) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02394; TAG: N3038; NAME: Gleason Patterns/Score Clinical, RX Summ--DX/Stg Proc (NAACCR)
    public boolean rqrs02394(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        char[] GSC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0) && (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19,")) {
            if (functions.GEN_AT(untrimmedline.rxSummDxStgProc, "00010304", 2) != 0) {
                if ((functions.GEN_AT(GPC, "X7", 2) == 0 && functions.GEN_AT(GPC, "X8") == 0 && !functions.GEN_EMPTY(GPC)) || (functions.GEN_AT(GSC, "X7", 2) == 0 && functions.GEN_AT(GSC, "X8") == 0 && !functions.GEN_EMPTY(GSC)))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical}, Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}, RX Summ--DX/Stg Proc: ${untrimmedline.rxSummDxStgProc}, and RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
            }
        }
        return true

    }

    // ID: RQRS-02395; TAG: N5049; NAME: Gleason Patterns/Score Pathological, RX Summ--Surg Prim Site, Vital Status (NAACCR)
    public boolean rqrs02395(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-26")) {
            if ((functions.GEN_AT(GPP, "X7", 2) == 0 && functions.GEN_AT(GPP, "X8") == 0 && !functions.GEN_EMPTY(GPP)) || (functions.GEN_AT(GSP, "X7", 2) == 0 && functions.GEN_AT(GSP, "X8") == 0 && !functions.GEN_EMPTY(GSP)))
                return false
        }
        return true

    }

    // ID: RQRS-02396; TAG: N3037; NAME: Gleason Patterns/Score, Clin/Path (NAACCR)
    public boolean rqrs02396(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        char[] GSC = new char[3]
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0) && (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0) && (functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0))
            return true
        if (!functions.GEN_EMPTY(GSC) && functions.GEN_AT(GSC, "X8") == 0) {
            if (functions.GEN_AT(GPC, "11", 2) != 0) {
                if (functions.GEN_AT(GSC, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1221", 2) != 0) {
                if (functions.GEN_AT(GSC, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "132231", 2) != 0) {
                if (functions.GEN_AT(GSC, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSC, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSC, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSC, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "354453", 2) != 0) {
                if (functions.GEN_AT(GSC, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "4554", 2) != 0) {
                if (functions.GEN_AT(GSC, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "55", 2) != 0) {
                if (functions.GEN_AT(GSC, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "X7", 2) != 0) {
                if (functions.GEN_AT(GSC, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical of ${untrimmedline.gleasonPatternsClinical} not valid for Gleason Score Clinical of ${untrimmedline.gleasonScoreClinical}')
            }
        }
        if (!functions.GEN_EMPTY(GSP) && functions.GEN_AT(GSP, "X8") == 0) {
            if (functions.GEN_AT(GPP, "11", 2) != 0) {
                if (functions.GEN_AT(GSP, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1221", 2) != 0) {
                if (functions.GEN_AT(GSP, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "132231", 2) != 0) {
                if (functions.GEN_AT(GSP, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSP, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSP, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSP, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "354453", 2) != 0) {
                if (functions.GEN_AT(GSP, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "4554", 2) != 0) {
                if (functions.GEN_AT(GSP, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "55", 2) != 0) {
                if (functions.GEN_AT(GSP, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "X7", 2) != 0) {
                if (functions.GEN_AT(GSP, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
        }
        return true

    }

    // ID: RQRS-02397; TAG: N4214; NAME: Gleason Score Clinical, Grade Clinical (NAACCR)
    public boolean rqrs02397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GSC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        
        if (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0 || functions.GEN_AT(GSC, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(GSC, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "01") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "0203", 2) == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "04") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "5") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02398; TAG: N3952; NAME: Gleason Score Pathological, Grade Pathological (NAACCR)
    public boolean rqrs02398(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        if (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0 || functions.GEN_AT(GSP, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (clin > path && clin != 9)
            return true
        if (functions.GEN_AT(GSP, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "01") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "0203", 2) == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "04") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "5") == 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02400; TAG: N3083; NAME: Grade Pathological, Post Therapy, RX Summ--Prim Site Surg (NAACCR)
    public boolean rqrs02400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[70]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00790 00795 00811 00812 00821 00822 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C809") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00060") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00, 10-19, 98, 99")) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00, 10-19, 98, 99")) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy: ${untrimmedline.gradePostTherapy} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: RQRS-02401; TAG: N6080; NAME: Grade Post Therapy, Surg Seq (NAACCR)
    public boolean rqrs02401(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.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq) && functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "2467", 1) == 0 && functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "2467", 1) == 0)
            return false
        return true

    }

    // ID: RQRS-02402; TAG: N5030; NAME: Grade, Breast, Behavior ICD-O-3 (NAACCR)
    public boolean rqrs02402(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "LMH", 1) != 0 && functions.GEN_AT(untrimmedline.gradePathological, "LMH", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical}, Grade Pathological: ${untrimmedline.gradePathological}, or Grade Post Therapy: ${untrimmedline.gradePostTherapy} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
            if (functions.GEN_AT(untrimmedline.gradeClinical, "LMH", 1) != 0 && functions.GEN_AT(untrimmedline.gradePostTherapy, "LMH", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical}, Grade Pathological: ${untrimmedline.gradePathological}, or Grade Post Therapy: ${untrimmedline.gradePostTherapy} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
        }
        return true

    }

    // ID: RQRS-02403; TAG: N6066; NAME: HER2 IHC Summary, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs02403(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IhcSummary) || functions.GEN_AT(untrimmedline.her2IhcSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02404; TAG: N6069; NAME: HER2 ISH Dual Probe Copy Number, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs02404(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshDualProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02405; TAG: N6068; NAME: HER2 ISH Dual Probe Ratio, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs02405(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio) || functions.GEN_AT(untrimmedline.her2IshDualProbeRatio, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02406; TAG: N6070; NAME: HER2 ISH Single Probe Copy Number, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs02406(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshSingleProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02407; TAG: N6067; NAME: HER2 ISH Summary, Schema ID, Required, CoC Flag (SEER)
    public boolean rqrs02407(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSummary) || functions.GEN_AT(untrimmedline.her2IshSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02408; TAG: N5034; NAME: HER2 Overall Summary, Breast, IHC, ISH (NAACCR)
    public boolean rqrs02408(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "3") != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "1") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "014", 1) != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "0") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02409; TAG: N3092; NAME: High Risk Histologic Features, Skin, Grade (NAACCR)
    public boolean rqrs02409(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00150", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "0135689", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy) && functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.gradePostTherapy, "3") == 0 && functions.GEN_AT(untrimmedline.gradePathological, "3") == 0 && functions.GEN_AT(untrimmedline.gradeClinical, "3") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "4") != 0) {
            if (functions.GEN_AT(untrimmedline.gradePostTherapy, "4") == 0 && functions.GEN_AT(untrimmedline.gradePathological, "4") == 0 && functions.GEN_AT(untrimmedline.gradeClinical, "4") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02410; TAG: N5050; NAME: Invasion Beyond Capsule, Kidney, Summary Stage 2018 (NAACCR)
    public boolean rqrs02410(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "1345", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "247", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invasion Beyond Capsule: ${untrimmedline.invasionBeyondCapsule} conflicts with Summary Stage 2018: ${untrimmedline.summaryStage2018}')
        }
        return true

    }

    // ID: RQRS-02411; TAG: N3053; NAME: Invasion Beyond Capsule, Kidney, Surgery, EOD Primary Tumor (NAACCR)
    public boolean rqrs02411(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor)) {
            if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "1345", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200300400500600700", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Invasion Beyond Capsule: ${untrimmedline.invasionBeyondCapsule} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invasion Beyond Capsule: ${untrimmedline.invasionBeyondCapsule} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: RQRS-02412; TAG: N5051; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, Summary Stage 2018 (NAACCR)
    public boolean rqrs02412(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "247", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02413; TAG: N3954; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, Surgery, EOD Tumor, Mets (NAACCR)
    public boolean rqrs02413(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27") && functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "023", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement: ${untrimmedline.ipsilateralAdrenalGlandInvolvement} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} and EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "600700", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement: ${untrimmedline.ipsilateralAdrenalGlandInvolvement} conflicts with EOD Mets: ${untrimmedline.eodMets}')
        }
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "70", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement: ${untrimmedline.ipsilateralAdrenalGlandInvolvement} conflicts with Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: RQRS-02414; TAG: N3040; NAME: LN Assessment Methods, Gynecologic, Regional Nodes Examined (NAACCR)
    public boolean rqrs02414(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal) || functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "0") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "0") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00", 2) == 0)
                return false
        }
        if ((functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "1") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "1") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "1") != 0) && (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "2789", 1) == 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "2789", 1) == 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "2789", 1) == 0)) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "95", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "2") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "2") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "2") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-90, 96-98"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "9") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "9") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "9") != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "99", 2) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02415; TAG: N4218; NAME: LN Assessment Methods, Gynecologic, Regional Nodes Examined, CoC Flag (SEER)
    public boolean rqrs02415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodFemoralInguinal) || functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodParaAortic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnAssessmentMethodPelvic) || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "0") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "0") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00", 2) == 0)
                return false
        }
        if ((functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "1") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "1") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "1") != 0) && (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "2789", 1) == 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "2789", 1) == 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "2789", 1) == 0)) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "95", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "2") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "2") != 0 || functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "2") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-90, 96-98"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.lnAssessmentMethodFemoralInguinal, "9") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodParaAortic, "9") != 0 && functions.GEN_AT(untrimmedline.lnAssessmentMethodPelvic, "9") != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "99", 2) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02416; TAG: N3041; NAME: LN Distant Assessment Method, Surgery Other Site (NAACCR)
    public boolean rqrs02416(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[12]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessmentMethod) || functions.GEN_AT(untrimmedline.lnDistantAssessmentMethod, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.lnDistantAssessmentMethod, "2", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Distant Assessment Method must be blank for RX Summ--Surg Oth Reg/Dis: ${untrimmedline.rxSummSurgOthRegDis}')
        }
        return true

    }

    // ID: RQRS-02417; TAG: N3042; NAME: LN Distant, Gynecologic, EOD Mets, Mets at DX-Distant LN (NAACCR)
    public boolean rqrs02417(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[12]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "1070", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Distant: Mediastinal, Scalene: ${untrimmedline.lnDistantMediastinalScalene} conflicts with EOD Mets: ${untrimmedline.eodMets}')
            if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "1") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Distant: Mediastinal, Scalene: ${untrimmedline.lnDistantMediastinalScalene} conflicts with Mets at Dx-Distant LN: ${untrimmedline.metsDxDistantLn}')
        }
        return true

    }

    // ID: RQRS-02418; TAG: N5052; NAME: LN Distant, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean rqrs02418(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[12]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02419; TAG: N3046; NAME: LN Head and Neck, EOD Regional Nodes (NAACCR)
    public boolean rqrs02419(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[12]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "1234567", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                return false
            else
                return true
        }
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                return false
            else
                return true
        }
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "999", 3) == 0)
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-02420; TAG: N5053; NAME: LN Head and Neck, Summary Stage 2018 (NAACCR)
    public boolean rqrs02420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[12]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "1234567", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
            else
                return true
        }
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "09", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "09", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "09", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "09", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
            else
                return true
        }
        return true

    }

    // ID: RQRS-02421; TAG: N3047; NAME: LN Isolated Tumor Cells (ITC), Merkel Cell, Reg Nodes Pos/Ex, EOD--Reg Nodes (NAACCR)
    public boolean rqrs02421(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC): ${untrimmedline.lnIsolatedTumorCells} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC): ${untrimmedline.lnIsolatedTumorCells} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "0099", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC) of ${untrimmedline.lnIsolatedTumorCells} is not consistent with Regional Nodes Examined of ${untrimmedline.regionalNodesExamined}')
        }
        return true

    }

    // ID: RQRS-02422; TAG: N5054; NAME: LN Isolated Tumor Cells (ITC), Merkel Cell, Reg Nodes Pos/Ex, Summary Stage 2018 (NAACCR)
    public boolean rqrs02422(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02423; TAG: N3048; NAME: LN Laterality, Vulva, EOD Regional Nodes (NAACCR)
    public boolean rqrs02423(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00500", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnLaterality, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Laterality: ${untrimmedline.lnLaterality} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: RQRS-02424; TAG: N5056; NAME: LN Laterality, Vulva, Summary Stage 2018 (NAACCR)
    public boolean rqrs02424(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00500", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnLaterality, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02425; TAG: N3076; NAME: LN Positive Axillary Level I-II, Breast, Reg Nodes Pos, AJCC TNM N (NAACCR)
    public boolean rqrs02425(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.ajccId, "48.148.2", 4) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99,X1,X5,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0099", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
            if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN))
                return true
            else {
                if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.RQRS_GEN_RIGHT)), "cN0", 3) == 0) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.RQRS_GEN_RIGHT)), "pN0cN0", 3) == 0) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.RQRS_GEN_RIGHT)), "ypN0", 4) == 0))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with AJCC TNM Path N: ${untrimmedline.ajccTnmPathN}, AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN}, AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: RQRS-02426; TAG: N3049; NAME: LN Positive Axillary Level I-II, Breast, Reg Nodes Pos, EOD--Reg Nodes (NAACCR)
    public boolean rqrs02426(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99,X1,X5,X6")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0099", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X6") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        return true

    }

    // ID: RQRS-02427; TAG: N5055; NAME: LN Positive Axillary Level I-II, Breast, Reg Nodes Pos, Summary Stage 2018 (NAACCR)
    public boolean rqrs02427(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99,X1,X5,X6")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02428; TAG: N3050; NAME: LN Size, Head/Neck, EOD Regional Nodes (NAACCR)
    public boolean rqrs02428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] size = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00130 00131 00132 00133 00140 00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnSize) || functions.GEN_AT(untrimmedline.lnSize, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        functions.GEN_STRCPY(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 1, 2))
        functions.GEN_STRCAT(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 4, 1))
        
        if (functions.GEN_INLIST(size, "001-999,XX1-XX7")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02429; TAG: N5057; NAME: LN Size, Head/Neck, Summary Stage 2018 (NAACCR)
    public boolean rqrs02429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] size = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00130 00131 00132 00133 00140 00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnSize) || functions.GEN_AT(untrimmedline.lnSize, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        functions.GEN_STRCPY(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 1, 2))
        functions.GEN_STRCAT(size, functions.GEN_SUBSTR(untrimmedline.lnSize, 4, 1))
        
        if (functions.GEN_INLIST(size, "001-999,XX1-XX7")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02430; TAG: N3051; NAME: LN Status Femoral Para-Aortic Pelvic, Gynecologic, EOD Regional Nodes (NAACCR)
    public boolean rqrs02430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[15]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic) || functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02431; TAG: N5058; NAME: LN Status Femoral Para-Aortic Pelvic, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean rqrs02431(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[15]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic) || functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnStatusFemoralInguinalParaAorticPelvic, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02432; TAG: N3985; NAME: Lymphovascular Invasion, Penis, EOD Primary Tumor (NAACCR)
    public boolean rqrs02432(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200300400450500550600700", 3) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02433; TAG: N5059; NAME: Lymphovascular Invasion, Penis, Summary Stage 2018 (NAACCR)
    public boolean rqrs02433(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02434; TAG: N3986; NAME: Lymphovascular Invasion,Testis, EOD Primary Tumor (NAACCR)
    public boolean rqrs02434(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "300400500600700", 3) == 0)
                return false
        }
        return true

    }

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

    }

    // ID: RQRS-02436; TAG: N6061; NAME: Major Vein Involvement, Kidney, Summary Stage 2018 (NAACCR)
    public boolean rqrs02436(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "01", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02437; TAG: N3052; NAME: Major Vein Involvement, Kidney, Surgery, EOD Primary Tumor (NAACCR)
    public boolean rqrs02437(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor)) {
            if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "134", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200300400500600700", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Major Vein Involvement: ${untrimmedline.majorVeinInvolvement} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
            }
            if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "2", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "300400500600700", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Major Vein Involvement: ${untrimmedline.majorVeinInvolvement} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Major Vein Involvement: ${untrimmedline.majorVeinInvolvement} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: RQRS-02438; TAG: N5017; NAME: Mets at DX-BBDLLO, Schema ID (SEER)
    public boolean rqrs02438(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.RQRS_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsDxBone) && functions.GEN_EMPTY(untrimmedline.metsDxBrain) && functions.GEN_EMPTY(untrimmedline.metsDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsDxLiver) && functions.GEN_EMPTY(untrimmedline.metsDxLung) && functions.GEN_EMPTY(untrimmedline.metsDxOther))
            return true
        char[] ID = new char[25]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00821 00822 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || functions.GEN_AT(untrimmedline.primarySite, "C420C421C423C424", 4) != 0) {
            if (functions.GEN_AT(untrimmedline.metsDxBone, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxBrain, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxLiver, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxLung, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxOther, "8") == 0)
                return false
        }
        else {
        
            if (functions.GEN_AT(untrimmedline.metsDxBone, "8") != 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxBrain, "8") != 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxDistantLn, "8") != 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxLiver, "8") != 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxLung, "8") != 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsDxOther, "8") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02439; TAG: N3064; NAME: Number of Cores Positive/Examined, Prostate, DX/Stg Proc (NAACCR)
    public boolean rqrs02439(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive) || functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined) || functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummDxStgProc, "00010304", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X7") == 0 || functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Cores Positive: ${untrimmedline.numberOfCoresPositive} and Number of Cores Examined: ${untrimmedline.numberOfCoresExamined} conflict with RX Summ--DX/Stg Proc: ${untrimmedline.rxSummDxStgProc}')
        }
        if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X7") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Cores Positive: ${untrimmedline.numberOfCoresPositive} conflicts with Number of Cores Examined: ${untrimmedline.numberOfCoresExamined}')
        }
        if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X7") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Cores Positive: ${untrimmedline.numberOfCoresPositive} conflicts with Number of Cores Examined: ${untrimmedline.numberOfCoresExamined}')
        }
        return true

    }

    // ID: RQRS-02440; TAG: N3065; NAME: Number of Positive/Examined Para-Aortic Nodes, Corpus (NAACCR)
    public boolean rqrs02440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[18]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedParaAorticNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositiveParaAorticNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true /*list of schema IDs for SSDI with added blank for clarity in edit display*/
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedParaAorticNodes, "00-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02441; TAG: N3066; NAME: Number of Positive/Examined Pelvic Nodes, Corpus (NAACCR)
    public boolean rqrs02441(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[18]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedPelvicNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositivePelvicNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true /*list of schema IDs for SSDI with added blank for clarity in edit display*/
        functions.GEN_STRCPY(ID, "00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedPelvicNodes, "00-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02442; TAG: N3056; NAME: Percent Necrosis Post Neoadjuvant, Bone, DX Confirm, Sequence, Surgery (NAACCR)
    public boolean rqrs02442(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.diagnosticConfirmation)) {
            if (functions.GEN_AT(untrimmedline.diagnosticConfirmation, "1") == 0) {
                if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with Diagnostic Confirmation: ${untrimmedline.diagnosticConfirmation}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq) && !functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)) {
            if (functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "2467", 1) == 0 && functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "2467", 1) == 0) {
                if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurgSeq}, RX Summ--Surg/Rad Seq: ${untrimmedline.rxSummSurgRadSeq}')
            }
        }
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "001519", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: RQRS-02443; TAG: N6073; NAME: Peritoneal Cytology, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean rqrs02443(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "005300054100542", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.peritonealCytology) || functions.GEN_AT(untrimmedline.peritonealCytology, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.peritonealCytology, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02444; TAG: N6074; NAME: Pleural Effusion, Pleura, Summary Stage 2018 (NAACCR)
    public boolean rqrs02444(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00370", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.pleuralEffusion) || functions.GEN_AT(untrimmedline.pleuralEffusion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.pleuralEffusion, "234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02445; TAG: N5033; NAME: PR Summary, Breast, PR Percent, Allred (NAACCR)
    public boolean rqrs02445(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.progesteroneReceptorSummary))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneReceptorPercentPositiveOrRange, "000XX9XX8", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.progesteroneReceptorPercentPositiveOrRange)) {
            if (functions.GEN_AT(untrimmedline.progesteroneReceptorSummary, "0") != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.progesteroneReceptorTotalAllredScore, "00X9X8", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.progesteroneReceptorTotalAllredScore)) {
            if (functions.GEN_AT(untrimmedline.progesteroneReceptorSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02446; TAG: N4025; NAME: Reason for No Radiation, Rad--Location of RX (COC)
    public boolean rqrs02446(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0", 1) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.radLocationOfRx, "1-9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "09", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "9") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02447; TAG: N4024; NAME: Reason for No Radiation, RX Date Rad Ended (COC)
    public boolean rqrs02447(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8") != 0) {
            if (functions.GEN_AT(untrimmedline.rxDateRadiationEndedFlag, "11") == 0)
                return functions.GEN_ERROR_MSG(binding, 'If Reason for No Radiation = 8, then RX Date Rad Ended must = 15')
        }
        if (functions.GEN_AT(untrimmedline.rxDateRadiationEndedFlag, "12") != 0 || (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))) {
            if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") == 0)
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended = 12 or Date of Diagnosis is not empty, then Reason for No Radiation must = 0')
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9") != 0) {
            if (dx_year > 2011) {
                if (functions.GEN_AT(untrimmedline.rxDateRadiationEndedFlag, "10") != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Reason for No Radiation = ${untrimmedline.reasonForNoRadiation} and RX Date Rad Ended Flag > 2011, RX Date Rad Ended must = 10')
            }
        }
        return true

    }

    // ID: RQRS-02448; TAG: N3956; NAME: Response To Neoadjuvant Therapy, Breast, Sequence (NAACCR)
    public boolean rqrs02448(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy) || functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurgSeq) && functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "2467", 1) == 0 && functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "2467", 1) == 0) {
            if (functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "0") == 0)
                return false
        }
        functions.GEN_NOOP()
        
        return true

    }

    // ID: RQRS-02449; TAG: N4027; NAME: RX Date Rad Ended, Radiation Items (COC)
    public boolean rqrs02449(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume) && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTreatmentVolume) && functions.GEN_EMPTY(untrimmedline.radiationTreatmentDiscontinuedEarly) && functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_AT(untrimmedline.rxDateRadiationEndedFlag, "11") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPhasesOfRadTreatmentToThisVolume, "0099", 2) == 0 || functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTreatmentVolume, "0099", 2) == 0 || functions.GEN_AT(untrimmedline.radiationTreatmentDiscontinuedEarly, "0099", 2) == 0 || functions.GEN_AT(untrimmedline.totalDose, "000000999999", 6) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02450; TAG: N5024; NAME: RX Hosp--Scope Reg LN Sur, Schema ID (COC)
    public boolean rqrs02450(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-02451; TAG: N5023; NAME: RX Hosp--Surg Prim Site, Schema ID, Primary Site (COC)
    public boolean rqrs02451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite)) {
            return true
        }
        char[] ID = new char[30]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00821 00822 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && !functions.GEN_INLIST(untrimmedline.primarySite, "422,770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
        }
        else {
        
        
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0) {
                    functions.GEN_STRCPY(Schema_SITE, Sitelow)
                    functions.GEN_STRCAT(Schema_SITE, Sitehigh)
                    functions.GEN_STRCAT(Schema_SITE, untrimmedline.schemaId)
                }
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site not valid')
            }
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOWSITEHIGHSCHEMA, Schema_SITE, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0 && functions.GEN_STRCMP(untrimmedline.schemaId, Schema) <= 0)
                    functions.GEN_STRCPY(Sitegrp, Grpcode)
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "41") != 0) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                functions.GEN_STRCAT(Sitegrp, untrimmedline.rxHospSurgPrimSite)
        
                if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SURG03_GROUPCODE, Sitegrp, [:]))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02452; TAG: N5019; NAME: RX Summ--Scope Reg LN Sur, Schema ID (SEER)
    public boolean rqrs02452(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO3))
            return true
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: RQRS-02453; TAG: N2613; NAME: RX Summ--Surg Prim Site, Lymphoma (COC)
    public boolean rqrs02453(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccId, 2), "79") == 0)
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "60,61,62") == 0) {
            if (functions.GEN_AT(untrimmedline.ajccTnmPathStageGroup, "99") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02454; TAG: N5015; NAME: RX Summ--Surg Prim Site, Schema ID, Primary Site (COC)
    public boolean rqrs02454(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        char[] ID = new char[30]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00821 00822 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && !functions.GEN_INLIST(untrimmedline.primarySite, "422,770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
        }
        else {
        
        
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0) {
                    functions.GEN_STRCPY(Schema_SITE, Sitelow)
                    functions.GEN_STRCAT(Schema_SITE, Sitehigh)
                    functions.GEN_STRCAT(Schema_SITE, untrimmedline.schemaId)
                }
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site not valid')
            }
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOWSITEHIGHSCHEMA, Schema_SITE, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0 && functions.GEN_STRCMP(untrimmedline.schemaId, Schema) <= 0)
                    functions.GEN_STRCPY(Sitegrp, Grpcode)
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "41") != 0) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
                if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SURG03_GROUPCODE, Sitegrp, [:]))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02455; TAG: N5016; NAME: RX Summ--Surg Prim Site, Schema ID, Primary Site (SEER)
    public boolean rqrs02455(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            return true
        }
        char[] ID = new char[30]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00060 00821 00822 00830 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && !functions.GEN_INLIST(untrimmedline.primarySite, "422,770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
        }
        else {
        
        
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0) {
                    functions.GEN_STRCPY(Schema_SITE, Sitelow)
                    functions.GEN_STRCAT(Schema_SITE, Sitehigh)
                    functions.GEN_STRCAT(Schema_SITE, untrimmedline.schemaId)
                }
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site not valid')
            }
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SCHEMASURG19_SITELOWSITEHIGHSCHEMA, Schema_SITE, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0 && functions.GEN_STRCMP(untrimmedline.schemaId, Schema) <= 0)
                    functions.GEN_STRCPY(Sitegrp, Grpcode)
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site: ${untrimmedline.primarySite} is not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "41") != 0) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
                if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.RQRS_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.RQRS_SURG03_GROUPCODE, Sitegrp, [:]))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: RQRS-02456; TAG: N5018; NAME: RX Summ--Surgical Margins, Schema ID (COC)
    public boolean rqrs02456(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalMargins))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgicalMargins, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: RX Summ--Surgical Margins must = 9')
        }
        char[] ID1 = new char[25]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00821 00822 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this Schema ID, Primary Site')
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) == 8) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) != 0)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) == 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) != 8)
                return false
        }
        return true

    }

    // ID: RQRS-02457; TAG: N5025; NAME: RX Summ--Treatm Stat, Treatment, Schema ID (NACCR)
    public boolean rqrs02457(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        char[] nodesnine = new char[2]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || (functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)))
            functions.GEN_STRCPY(nodesnine, "1")
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0,2")) {
                if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(nodesnine, "1"))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00"))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && !functions.GEN_INLIST(nodesnine, "1")) || functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99")) {
        
                        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99"))
                            return true
                        else
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                    }
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
            }
        }
        
        return true

    }

    // ID: RQRS-02458; TAG: N6065; NAME: RX Summ--Treatm Stat, Treatment, Schema ID, blanks (NACCR)
    public boolean rqrs02458(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        char[] nodesnine = new char[2]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || (functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3)))
            functions.GEN_STRCPY(nodesnine, "1")
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0,2")) {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(nodesnine, "1")) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))) && (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummChemo)) && (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummHormone)) && (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) && (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8") || functions.GEN_EMPTY(untrimmedline.rxSummOther)) && (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00") || functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality)))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) && functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) && functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) && functions.GEN_EMPTY(untrimmedline.rxSummBrm) && functions.GEN_EMPTY(untrimmedline.rxSummChemo) && functions.GEN_EMPTY(untrimmedline.rxSummHormone) && functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr) && functions.GEN_EMPTY(untrimmedline.rxSummOther) && functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99")) {
        
                    if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) && ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9") && functions.GEN_EMPTY(nodesnine)) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(nodesnine, "1")) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) && (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummBrm)) && (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummChemo)) && (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummHormone)) && (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) && (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9") || functions.GEN_EMPTY(untrimmedline.rxSummOther)) && (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99") || functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality)))
                        return true
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
        }
        
        return true

    }

    // ID: RQRS-02459; TAG: N3059; NAME: Sarcomatoid Features, Histologic Type ICD-O-3 (NAACCR)
    public boolean rqrs02459(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures) || functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "XX8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8260, 8290, 8310-8312, 8316-8319, 8480, 8510")) {
            if (functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "XX7", 3) != 0)
                return false
        }
        if (!functions.GEN_INLIST(untrimmedline.histologyIcdO3, "8260, 8290, 8310-8312, 8316-8319, 8480, 8510")) {
            if (functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "XX7", 3) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02460; TAG: N2836; NAME: Sentinel Lymph Nodes Ex, Reg Nodes Ex, Date RLN Dissection (COC)
    public boolean rqrs02460(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (sen != 0 && (sen != 95 && sen != 98 && sen != 99)) {
            if (sen == reg) {
                if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Sentinel Lymph Nodes Examined = Regional Nodes Examined, Date Regional Lymph Node Dissection must be blank and Date Regional Lymph Node Dissection Flag indicate reason why')
            }
            if (reg > sen && (reg != 95 && reg != 98 && reg != 99)) {
                if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_AT(untrimmedline.dateRegionalLymphNodeDissectionFlag, "12"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Regional Nodes Examined > Sentinel Lymph Nodes Examined, Date Regional Lymph Node Dissection must not be blank or Date Regional Lymph Node Dissection Flag must = 12')
            }
        }
        return true

    }

    // ID: RQRS-02461; TAG: N4207; NAME: Sentinel Lymph Nodes Ex, Reg Nodes Ex, Date RLN Dissection (SEER)
    public boolean rqrs02461(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (sen != 0 && (sen != 95 && sen != 98 && sen != 99)) {
            if (sen == reg) {
                if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissectionFlag))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Sentinel Lymph Nodes Examined = Regional Nodes Examined, Date Regional Lymph Node Dissection must be blank and Date Regional Lymph Node Dissection Flag indicate reason why')
            }
            if (reg > sen && (reg != 95 && reg != 98 && reg != 99)) {
                if (functions.GEN_EMPTY(untrimmedline.dateRegionalLymphNodeDissection) || functions.GEN_AT(untrimmedline.dateRegionalLymphNodeDissectionFlag, "12"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Regional Nodes Examined > Sentinel Lymph Nodes Examined, Date Regional Lymph Node Dissection must not be blank or Date Regional Lymph Node Dissection Flag must = 12')
            }
        }
        return true

    }

    // ID: RQRS-02462; TAG: N3958; NAME: Separate Tumor Nodules, Lung, EOD Primary Tumor (NAACCR)
    public boolean rqrs02462(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "14", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "500550600650700", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "700", 3) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02463; TAG: N6062; NAME: Separate Tumor Nodules, Lung, Summary Stage 2018 (NAACCR)
    public boolean rqrs02463(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "14", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02464; TAG: N6077; NAME: SSDIs, Benign Brain and CNS (NAACCR)
    public boolean rqrs02464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO3)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossOfHeterozygosity)) {
            if (functions.GEN_AT(untrimmedline.chromosome1pLossOfHeterozygosity, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 1p: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome1pLossOfHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossOfHeterozygosity)) {
            if (functions.GEN_AT(untrimmedline.chromosome19qLossOfHeterozygosity, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 19q: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome19qLossOfHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3} ')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MethylguanineMethyltransferase)) {
            if (functions.GEN_AT(untrimmedline.methylationOfO6MethylguanineMethyltransferase, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Methylation of O6-Methylguanine-Methyltransferase: ${untrimmedline.methylationOfO6MethylguanineMethyltransferase} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorIcdO3}')
            }
        }
        return true

    }

    // ID: RQRS-02465; TAG: N5000; NAME: Summary Stage 2018, Behavior Code ICDO3 (NAACCR)
    public boolean rqrs02465(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) == 0) {
                if (functions.GEN_AT(untrimmedline.summaryStage2018, "9") == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.behaviorIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02466; TAG: N5029; NAME: Summary Stage 2018, EOD (SEER)
    public boolean rqrs02466(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor) && functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) && functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "050") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "124", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070", 3) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0128", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000030050070888987999", 3) == 0 && functions.GEN_AT(untrimmedline.schemaId, "00811") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050070987999", 3) != 0 && functions.GEN_AT(untrimmedline.schemaId, "00811") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "012348", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "000588", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10203040506070", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7") == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02467; TAG: N5021; NAME: Surgery, RX Date Surgery, Schema ID (COC)
    public boolean rqrs02467(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int exception
        int dx_year
        
        exception = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        char[] ID1 = new char[50]
        char[] ID2 = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID1, "00721 00722 00723 00821 00830 99999 ")
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0 || (functions.GEN_AT(code, ID2, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologyIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 700-729,751-753,761-768,809", "(C\\d\\d\\d)", 2, 3))
            exception = 1
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98")) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "12"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If surgery performed and RX Date Surgery is blank, RX Date Surgery Flag must = 12')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || ((exception == 1 && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Summ--Scope Reg LN Sur = ${untrimmedline.rxSummScopeRegLnSur}, and RX Summ--Surg Oth Reg/Dis = ${untrimmedline.rxSummSurgOthRegDis}, RX Date Surgery Flag must = 11')
        }
        return true

    }

    // ID: RQRS-02468; TAG: N3031; NAME: Testis Serum Markers, Orchiectomy (NAACCR)
    public boolean rqrs02468(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] AFP = new char[7]
        char[] hCG = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8") != 0) && (functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8") != 0) && (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.sCategoryPathological) || functions.GEN_AT(untrimmedline.sCategoryPathological, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        functions.GEN_STRCPY(AFP, functions.GEN_SUBSTR(untrimmedline.afpPostOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(AFP, functions.GEN_SUBSTR(untrimmedline.afpPostOrchiectomyLabValue, 7, 1))
        
        functions.GEN_STRCPY(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPostOrchiectomyLabValue, 1, 5))
        functions.GEN_STRCAT(hCG, functions.GEN_SUBSTR(untrimmedline.hcgPostOrchiectomyLabValue, 7, 1))
        
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "0012", 2) != 0) {
            if (functions.GEN_AT(AFP, "XXXXX9", 6) == 0 || functions.GEN_AT(hCG, "XXXXX9", 6) == 0 || functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.sCategoryPathological, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Testis Serum Markers must be coded "no orchiectomy performed" if no orchiectomy performed')
        }
        return true

    }

    // ID: RQRS-02469; TAG: N6075; NAME: Thyroid, Nodes Pos/Ex, EOD Regional Nodes (NAACCR)
    public boolean rqrs02469(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0073000740", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "0099", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "98") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: RQRS-02470; TAG: N5043; NAME: Tumor Deposits, Colorectal, Summary Stage 2018 (NAACCR)
    public boolean rqrs02470(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99,X1,X2")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02471; TAG: N3959; NAME: Tumor Deposits, Colorectal, Surgery, AJCC TNM N (NAACCR)
    public boolean rqrs02471(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.ajccId, "20  ") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
            if (functions.GEN_AT(untrimmedline.tumorDeposits, "X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_AT(untrimmedline.tumorDeposits, "00X9", 2) != 0 && (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN))) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.RQRS_GEN_RIGHT)), "pN1c", 4) != 0 || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.RQRS_GEN_RIGHT)), "pN1c", 4) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with AJCC TNM Path N: ${untrimmedline.ajccTnmPathN} and AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN}')
            if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99,X1,X2")) {
                if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.RQRS_GEN_RIGHT)), "pN0pNX", 3) != 0 || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.RQRS_GEN_RIGHT)), "ypN0ypNX", 4) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with AJCC TNM Path N: ${untrimmedline.ajccTnmPathN} and AJCC TNM Post Therapy N: ${untrimmedline.ajccTnmPostTherapyN}')
            }
        }
        return true

    }

    // ID: RQRS-02472; TAG: N3960; NAME: Tumor Deposits, Colorectal, Surgery, EOD Regional Nodes (NAACCR)
    public boolean rqrs02472(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
            if (functions.GEN_AT(untrimmedline.tumorDeposits, "X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.eodRegionalNodes)) {
            if (functions.GEN_AT(untrimmedline.tumorDeposits, "00X9", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
            if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99,X1,X2")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200300800") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Deposits: ${untrimmedline.tumorDeposits} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
        }
        return true

    }

    // ID: RQRS-02473; TAG: N5028; NAME: Tumor Size Clin, Path, Summ (NAACCR)
    public boolean rqrs02473(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int clin, path, summ, dx_year
        
        clin = functions.GEN_VAL(untrimmedline.tumorSizeClinical)
        path = functions.GEN_VAL(untrimmedline.tumorSizePathologic)
        summ = functions.GEN_VAL(untrimmedline.tumorSizeSummary)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical) && functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) && functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) && functions.GEN_AT(untrimmedline.tumorSizePathologic, "999000", 3) == 0) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-90") && functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "24", 1) == 0 && functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "24", 1) == 0) {
                if (functions.GEN_STRCMP(untrimmedline.tumorSizePathologic, untrimmedline.tumorSizeSummary) == 0)
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} and Tumor Size Summary: ${untrimmedline.tumorSizeSummary}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") || functions.GEN_AT(untrimmedline.rxSummSurgRadSeq, "24", 1) != 0 || functions.GEN_AT(untrimmedline.rxSummSystemicSurgSeq, "24", 1) != 0 || functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) || functions.GEN_AT(untrimmedline.tumorSizePathologic, "999000", 3) != 0) {
            if (functions.GEN_STRCMP(untrimmedline.tumorSizeClinical, untrimmedline.tumorSizeSummary) == 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Summary: ${untrimmedline.tumorSizeSummary}')
        }
        return true

    }

    // ID: RQRS-02474; TAG: N3062; NAME: Visceral and Parietal Pleura Invasion, Lung, EOD Primary Tumor (NAACCR)
    public boolean rqrs02474(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "1246", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "450500550600650700", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Visceral and Parietal Pleural Invasion: ${untrimmedline.visceralAndParietalPleuralInvasion} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        if (functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "3", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "500550600650700", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Visceral and Parietal Pleural Invasion: ${untrimmedline.visceralAndParietalPleuralInvasion} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        return true

    }

    // ID: RQRS-02475; TAG: N6063; NAME: Visceral and Parietal Pleura Invasion, Lung, Summary Stage 2018 (NAACCR)
    public boolean rqrs02475(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.visceralAndParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.visceralAndParietalPleuralInvasion, "12346", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        return true

    }

    // ID: RQRS-02476; TAG: 500; NAME: DX 1985-2017, 1st Contact 1985-2019 NCDB
    public boolean rqrs02476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int cont_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        cont_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return false
        if (dx_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return false
        if (cont_year == ((Integer)context.RQRS_GEN_DT_EMPTY))
            return false
        if (cont_year == ((Integer)context.RQRS_GEN_DT_ERROR))
            return false
        if (dx_year > 2017)
            return false
        if (cont_year > 2019)
            return false
        if (dx_year < 1985)
            return false
        if (cont_year < 1985)
            return false
        
        return true

    }

    // ID: RQRS-02477; TAG: N6081; NAME: Invasion Beyond Capsule, Kidney, Surgery (NAACCR)
    public boolean rqrs02477(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02478; TAG: N6082; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, Surgery (NAACCR)
    public boolean rqrs02478(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolvement) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27") && functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "023", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolvement, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02479; TAG: N6083; NAME: Major Vein Involvement, Kidney, Surgery (NAACCR)
    public boolean rqrs02479(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02480; TAG: N6085; NAME: Percent Necrosis Post Neoadjuvant, Bone, DX Confirm (NAACCR)
    public boolean rqrs02480(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.diagnosticConfirmation))
            return true
        if (functions.GEN_AT(untrimmedline.diagnosticConfirmation, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with Diagnostic Confirmation: ${untrimmedline.diagnosticConfirmation}')
        }
        return true

    }

    // ID: RQRS-02481; TAG: N6084; NAME: Tumor Deposits, Colorectal, Surgery (NAACCR)
    public boolean rqrs02481(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.RQRS_GEN_DT_EMPTY) || dx_year == ((Integer)context.RQRS_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
            if (functions.GEN_AT(untrimmedline.tumorDeposits, "X9", 2) == 0)
                return false
        }
        return true

    }

    // ID: RQRS-02482; TAG: NC001; NAME: NCDB Record Version 160
    public boolean rqrs02482(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_STRCMP(untrimmedline.naaccrRecordVersion, "160") != 0)
            return false
        return true

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy