Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.imsweb.validation.edits.translated.npcr.NpcrTranslatedCompiledRules.groovy Maven / Gradle / Ivy
package com.imsweb.validation.edits.translated.npcr
import com.imsweb.validation.functions.MetafileContextFunctions
import com.imsweb.validation.runtime.CompiledRules
import groovy.transform.CompileStatic
@CompileStatic
class NpcrTranslatedCompiledRules implements CompiledRules {
@Override
public String getValidatorId() {
return 'npcr-translated'
}
@Override
public String getValidatorVersion() {
return 'NPCR-012-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: NPCR-00003; TAG: N0003; NAME: Diagnostic Confirmation (SEER DXCONF)
public boolean npcr00003(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: NPCR-00005; TAG: N2889; NAME: HER2 Overall Summary, Breast, Schema ID, Required (NAACCR)
public boolean npcr00005(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.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_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: NPCR-00006; TAG: N0005; NAME: Laterality (SEER LATERAL)
public boolean npcr00006(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: NPCR-00008; TAG: N0007; NAME: Primary Site (SEER SITE)
public boolean npcr00008(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.NPCR_SITE_TBL, context.NPCR_SITE_TBL_SITECODE, [:])
}
// ID: NPCR-00009; TAG: N0653; NAME: Behavior Code ICDO3, Seq Num--Central (SEER IF114)
public boolean npcr00009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1"))
return true
}
}
if (dx_year > 2000) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
return false
}
}
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,98,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
return true
else
return false
}
if (dx_year > 2000) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
return true
else
return false
}
}
return true
}
// ID: NPCR-00010; TAG: N0654; NAME: Behavior ICDO3, Site, Histology ICDO3 (NAACCR)
public boolean npcr00010(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
if (dx_year > 2003 && functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3))
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1")) {
if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473"))
return true
}
return false
}
// ID: NPCR-00011; TAG: N0655; NAME: CS Tumor Size (CS)
public boolean npcr00011(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: NPCR-00012; TAG: N0011; NAME: Race 1 (SEER RACE)
public boolean npcr00012(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: NPCR-00014; TAG: N0012; NAME: Sex (SEER Sex)
public boolean npcr00014(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: NPCR-00016; TAG: N0013; NAME: Sex, Primary Site (SEER IF17)
public boolean npcr00016(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: NPCR-00018; TAG: N0014; NAME: Spanish/Hispanic Origin (SEER SPANORIG)
public boolean npcr00018(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: NPCR-00022; TAG: N0017; NAME: Type of Report Srce (AO), Date of Dx (SEER IF02)
public boolean npcr00022(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.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_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.NPCR_GEN_DT_EMPTY))
return true
if (dolc_year == ((Integer)context.NPCR_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: NPCR-00023; TAG: N0662; NAME: CS Site-Specific Factor 1 (CS)
public boolean npcr00023(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: NPCR-00024; TAG: N0018; NAME: Type of Report Srce(DC/AO), Diag Conf (SEER IF05)
public boolean npcr00024(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: NPCR-00025; TAG: N0663; NAME: CS Site-Specific Factor 2 (CS)
public boolean npcr00025(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: NPCR-00026; TAG: N0019; NAME: Type of Reporting Source (SEER RPRTSRC)
public boolean npcr00026(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: NPCR-00030; TAG: N0024; NAME: Date of Last Contact, Date of Diag (NAACCR IF19)
public boolean npcr00030(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.NPCR_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.NPCR_GEN_DT_MONTH_EMPTY) || last_month == ((Integer)context.NPCR_GEN_DT_MONTH_EMPTY)) {
if (dx_year <= last_year)
return true
else
return false
}
else {
if (dx_day == ((Integer)context.NPCR_GEN_DT_DAY_EMPTY) || last_day == ((Integer)context.NPCR_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: NPCR-00031; TAG: N0025; NAME: Age, Birth Date, Date of Diagnosis (NAACCR IF13)
public boolean npcr00031(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int wrk_age, diag_age
int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000")) {
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "2,3"))
return true
}
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
if (birth_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
diag_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (diag_age == 999) {
if ((dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NPCR_GEN_DT_EMPTY)))
return true
else
return false
}
if ((dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NPCR_GEN_DT_EMPTY))) {
if (diag_age == 999)
return true
else
return false
}
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
if ((birth_month == ((Integer)context.NPCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NPCR_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.NPCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NPCR_GEN_DT_MONTH_EMPTY))) {
if (diag_age == wrk_age || diag_age == (wrk_age - 1))
return true
else
return false
}
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
if (dx_month == birth_month) {
if ((dx_day == ((Integer)context.NPCR_GEN_DT_DAY_EMPTY)) || (birth_day == ((Integer)context.NPCR_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: NPCR-00032; TAG: N0026; NAME: Age at Diagnosis (SEER AGEDX)
public boolean npcr00032(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-120,999", "(\\d\\d\\d)")
}
// ID: NPCR-00033; TAG: N0027; NAME: Edit Over-rides (SEER REVIEWFL)
public boolean npcr00033(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHistology, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAgeSiteMorph, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSeqnoDxconf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatSeqno, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSurgDxconf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideReportSource, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideIllDefineSite, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideLeukLymphoma, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDt, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatEod, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)|(\\s)"))
return true
else
return false
return true
}
// ID: NPCR-00035; TAG: N0673; NAME: Derived SS2000 (CS)
public boolean npcr00035(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: NPCR-00036; TAG: N0033; NAME: NAACCR Record Version (NAACCR)
public boolean npcr00036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_STRCMP(untrimmedline.naaccrRecordVersion, "240") != 0)
return false
return true
}
// ID: NPCR-00037; TAG: N2292; NAME: Tumor Size Summary, Primary Site (COC)
public boolean npcr00037(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.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2016 || dx_year > 2018)
return true
if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
return true
if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "998")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "199, 209, 180, 182-189,150-155, 158, 159", "(C\\d\\d\\d)", 2, 4) && !functions.GEN_INLIST(untrimmedline.primarySite, "160-166, 168, 169, 340-343, 348, 349, 500-506, 508, 509", "(C\\d\\d\\d)", 2, 4))
return false
}
return true
}
// ID: NPCR-00040; TAG: N2924; NAME: Progesterone Receptor Summary, Schema ID, Required (NAACCR)
public boolean npcr00040(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.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_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.progesteroneRecepSummary))
return false
}
return true
}
// ID: NPCR-00041; TAG: N0058; NAME: Patient ID Number (SEER CASENUM)
public boolean npcr00041(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: NPCR-00044; TAG: N0062; NAME: Record Type (NAACCR)
public boolean npcr00044(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: NPCR-00048; TAG: N2938; NAME: Brain Molecular Markers, Date DX (NAACCR)
public boolean npcr00048(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_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 (dx_year < 2024) {
if (functions.GEN_INLIST(untrimmedline.brainMolecularMarkers, "10-23", "(\\d\\d)"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid code for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
}
if (!functions.GEN_INLIST(untrimmedline.brainMolecularMarkers, "01-23, 85-88, 99", "(\\d\\d)"))
functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.brainMolecularMarkers} not valid code for Brain Molecular Markers')
return true
}
// ID: NPCR-00050; TAG: N0713; NAME: ICD Revision, Vital Stat, Date Last Contact (NPCR)
public boolean npcr00050(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.NPCR_GEN_DT_EMPTY))
return true
if (dolc_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
if (dolc_year > 1978 && dolc_year < 1999) {
if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0,1"))
return true
else
return false
}
else {
if (dolc_year == 1999) {
if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9,1"))
return true
else
return false
}
else {
if (dolc_year > 1999) {
if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1"))
return true
else
return false
}
}
}
}
if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
return false
}
return true
}
// ID: NPCR-00051; TAG: N0714; NAME: PIN III ICDO3, Date of Diagnosis (SEER IF110)
public boolean npcr00051(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 2000) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8148") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
return false
}
return true
}
// ID: NPCR-00052; TAG: N0075; NAME: Date Initial RX SEER (NAACCR)
public boolean npcr00052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.dateInitialRxSeer))
return true
if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateInitialRxSeer))
return true
else {
functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
return false
}
return true
}
// ID: NPCR-00053; TAG: N0717; NAME: Age, Primary Site, Morph ICDO3--Pediatric (NPCR)
public boolean npcr00053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001)
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp > 14) {
return true
}
if (agetemp < 3) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
return false
}
if (agetemp > 9 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9490,9500"))
return false
}
if (agetemp > 5 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514"))
return false
}
if (agetemp > 8 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960,8964"))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8963") && functions.GEN_INLIST(untrimmedline.primarySite, "649,809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 9) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8231,8240,8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8312"))
return false
}
if (agetemp > 5 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8970"))
return false
}
if (agetemp < 9) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8140,8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8230,8231,8240,8241,8244-8246,8260-8263,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8160-8180"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9180-9200"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9220-9230"))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9231,9240") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 4) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9260") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419,809", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9363,9364") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp > 7 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9060-9102") && functions.GEN_INLIST(untrimmedline.primarySite, "000-559,570-619,630-699,739-750,754-809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8380,8381,8441-8473"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8500-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8330-8350"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 5) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8090-8110,8140,8143,8147,8190,8200") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240,8246,8247,8260,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8390-8420,8430,8480,8542,8560,8570-8573,8940") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 5) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8082,8120-8155,8190-8263,8290,8310,8314-8323") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8430-8440,8480-8580,8940,8941") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9053"))
return false
}
if (agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
return false
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9100") && functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209,210-218,239", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "240-249,250-259,384,500-509,559,540-549,609", "(C\\d\\d\\d)", 2, 3))
return false
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240-8245") && functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
return false
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8140") && functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732,9823,9863,9875,9876,9945"))
return false
}
return true
}
// ID: NPCR-00054; TAG: N0718; NAME: Age, Primary Site, Morph ICDO3--Adult (SEER)
public boolean npcr00054(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
char[] Morph = new char[6]
char[] Histo = new char[5]
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001) {
return true
}
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp < 15)
return true
functions.GEN_STRCPY(Histo, untrimmedline.histologicTypeIcdO3)
functions.GEN_STRCPY(Morph, Histo)
functions.GEN_STRCAT(Morph, untrimmedline.behaviorCodeIcdO3)
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(Morph, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(Morph, "(\\d\\d\\d\\d3)")))
return false
}
if (agetemp < 30) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(Histo, "9732, 9823, 9863, 9875, 9876, 9945", "(\\d\\d\\d\\d)"))
return false
}
if (agetemp < 40) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(Histo, "8140", "(\\d\\d\\d\\d)"))
return false
}
if (agetemp > 5) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(Histo, "9510-9514", "(\\d\\d\\d\\d)"))
return false
}
if (agetemp > 14) {
if (functions.GEN_INLIST(Histo, "8960,9946", "(\\d\\d\\d\\d)"))
return false
}
if (agetemp > 45) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(Histo, "9100", "(\\d\\d\\d\\d)"))
return false
}
return true
}
// ID: NPCR-00060; TAG: N0090; NAME: Vital Status (COC)
public boolean npcr00060(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: NPCR-00063; TAG: N0091; NAME: Cause of Death (SEER COD)
public boolean npcr00063(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: NPCR-00064; TAG: N0093; NAME: ICD Revision Number, Cause of Death (SEER IF37)
public boolean npcr00064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int cod_num
char[] COD = new char[5]
if (functions.GEN_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)")) {
functions.GEN_STRCPY(COD, functions.GEN_SUBSTR(untrimmedline.causeOfDeath, 1, 3))
functions.GEN_STRCAT(COD, "9")
}
if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\d)"))
functions.GEN_STRCPY(COD, untrimmedline.causeOfDeath)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_ICD10COD, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_ICD10COD_CODE, COD, [:]))
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "7")) {
if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.NPCR_ICD7COD, context.NPCR_ICD7COD_CODE, [:]))
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "8")) {
if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.NPCR_ICD8COD, context.NPCR_ICD8COD_CODE, [:]))
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.NPCR_ICD9COD, context.NPCR_ICD9COD_CODE, [:]))
return false
}
}
}
}
return true
}
// ID: NPCR-00065; TAG: N0094; NAME: Type of Report Srce(DC/AO), COD (SEER IF09)
public boolean npcr00065(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: NPCR-00066; TAG: N0096; NAME: Date Initial RX SEER, Date Last Cont (NAACCR IF35)
public boolean npcr00066(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.NPCR_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.dateInitialRxSeer))
return true
dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateInitialRxSeer, untrimmedline.dateOfLastContact, ((Integer)context.NPCR_GEN_DT_MIN))
if (dtcmp == ((Integer)context.NPCR_GEN_DT_ERROR)) {
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateInitialRxSeer)) {
functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER is invalid: %DC')
return false
}
else {
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
return false
}
}
}
else {
if (dtcmp <= 0)
return true
else
return false
}
return true
}
// ID: NPCR-00067; TAG: N0736; NAME: Non-Reportable Skin ICDO3 (SEER IF117)
public boolean npcr00067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8110"))
return false
return true
}
// ID: NPCR-00068; TAG: N0739; NAME: NHIA Derived Hisp Origin (NAACCR)
public boolean npcr00068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.nhiaDerivedHispOrigin))
return true
return functions.GEN_INLIST(untrimmedline.nhiaDerivedHispOrigin, "0-8")
}
// ID: NPCR-00069; TAG: N0122; NAME: Addr at DX--State (NAACCR)
public boolean npcr00069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_LOOKUP(untrimmedline.addrAtDxState, context.NPCR_STATE, context.NPCR_STATE_CODE, [:])
}
// ID: NPCR-00070; TAG: N0123; NAME: Addr at DX--Postal Code (NAACCR)
public boolean npcr00070(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")
}
// ID: NPCR-00072; TAG: N0750; NAME: Follow-up Source Central (NAACCR)
public boolean npcr00072(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: NPCR-00073; TAG: N0751; NAME: Follow-up Source Central, Date of DX (NPCR)
public boolean npcr00073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_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: NPCR-00075; TAG: N0753; NAME: IHS Link (NPCR)
public boolean npcr00075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.ihsLink))
return true
return functions.GEN_INLIST(untrimmedline.ihsLink, "0,1")
}
// ID: NPCR-00082; TAG: N2991; NAME: PSA (Prostatic Specific Antigen) Lab Value, Schema ID, Required (NAACCR)
public boolean npcr00082(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.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_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: NPCR-00084; TAG: N0157; NAME: Date 1st Crs RX COC (COC)
public boolean npcr00084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc))
return true
if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.date1stCrsRxCoc))
return true
else {
functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC: %DC')
return false
}
return true
}
// ID: NPCR-00085; TAG: N3006; NAME: Schema Discriminator 2, Date DX (NAACCR)
public boolean npcr00085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2018) {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 must be blank for cases diagnosed before 2018')
}
if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
return true
if (functions.GEN_AT(untrimmedline.schemaDiscriminator2, "1289", 1) == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.schemaDiscriminator2} is not a valid value for Schema Discriminator 2')
if (functions.GEN_AT(untrimmedline.schemaDiscriminator2, "8") != 0) {
if (dx_year >= 2021)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} must not be used for 2021+ diagnoses')
}
return true
}
// ID: NPCR-00086; TAG: N0811; NAME: Primary Payer at DX (NPCR)
public boolean npcr00086(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: NPCR-00087; TAG: N1594; NAME: Summary Stage 2000, Over-ride CS 20 (NPCR)
public boolean npcr00087(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: NPCR-00088; TAG: N3007; NAME: Schema ID, Site, Histo, Schema Discriminator 2 (NAACCR)
public boolean npcr00088(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[6], GPNAME = new char[31], SCDSCR2 = new char[2]
char[] SITE_LO = new char[5], SITE_HI = new char[5]
int dx_year
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] Hist = new char[5]
char[] t_schema_msg = new char[100]
char[] group = new char[5]
char[] flag = new char[2]
functions.GEN_STRCPY(flag, "00")
functions.GEN_STRCPY(group, "00000")
char[] Site_Hist = new char[30]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR) || dx_year < 2018)
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_EMPTY(untrimmedline.primarySite))
return true
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
functions.GEN_STRCPY(Hist, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISC2SEER_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISC2SEER_REF_SITE_LO, Site, ['SITE_LO':SITE_LO, 'SITE_HI':SITE_HI])) {
if (functions.GEN_STRCMP(Site, SITE_LO) >= 0 && functions.GEN_STRCMP(Site, SITE_HI) <= 0) {
functions.GEN_STRCPY(Site_Hist, SITE_LO)
functions.GEN_STRCAT(Site_Hist, Hist)
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for Primary Site: ${untrimmedline.primarySite}')
return true
}
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for Primary Site: ${untrimmedline.primarySite}')
return true
}
if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISCRIM2SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISCRIM2SEER_SITELOWHISTLOW, Site_Hist, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR2':SCDSCR2])) {
if (functions.GEN_STRCMP(SITE_LO, SITELOW) == 0 && functions.GEN_STRCMP(Hist, HISTLOW) >= 0 && functions.GEN_STRCMP(Hist, HISTHIGH) <= 0) {
functions.GEN_STRCPY(Site_Hist, SITE_LO)
functions.GEN_STRCAT(Site_Hist, HISTLOW)
functions.GEN_STRCAT(Site_Hist, untrimmedline.schemaDiscriminator2)
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
return true
}
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
return true
}
if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISCRIM2SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISCRIM2SEER_SITELOWHISTLOWSCDSCR2, Site_Hist, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR2':SCDSCR2]))
functions.GEN_STRCPY(group, GPCODE)
else {
if ((functions.GEN_AT(Site, "C111") != 0 && functions.GEN_AT(untrimmedline.schemaId, "00090") != 0) || (functions.GEN_AT(Site, "C160") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8020") != 0 && functions.GEN_AT(untrimmedline.schemaId, "00170") != 0)) {
if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
return true
}
else
functions.GEN_STRCPY(flag, "99")
}
if (functions.GEN_AT(flag, "99") != 0) {
if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_TEXT(binding, 'Combination of site, histology requires Schema Disc 2 for correct Schema ID')
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
functions.GEN_SAVE_TEXT(binding, 'Reported value Schema Disc 2 incorrect for combination of site, histology')
}
if (functions.GEN_AT(flag, "00") != 0 && functions.GEN_AT(group, "00000") == 0) {
if (functions.GEN_AT(group, "0010000111", 5) != 0 && functions.GEN_AT(untrimmedline.primarySite, "C111") != 0) {
if (functions.GEN_AT(untrimmedline.schemaId, "0010000111", 5) != 0)
return true
}
if (functions.GEN_AT(group, "0016100169", 5) != 0 && functions.GEN_AT(untrimmedline.primarySite, "C160") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8020") != 0) {
if (functions.GEN_AT(untrimmedline.schemaId, "0016100169", 5) != 0)
return true
}
if (functions.GEN_STRCMP(untrimmedline.schemaId, group) != 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema Discriminator 2 is incorrect for reported Schema ID: ")
functions.GEN_STRCAT(t_schema_msg, untrimmedline.schemaId)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
}
}
return true
}
// ID: NPCR-00093; TAG: N6131; NAME: Schema ID, Site, Histo, Schema Discriminator 1 (NPCR)
public boolean npcr00093(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[6], GPNAME = new char[31], SCDSCR1 = new char[2]
char[] SITE_LO = new char[5], SITE_HI = new char[5]
int dx_year
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] Hist = new char[5]
char[] t_schema_msg = new char[100]
char[] group = new char[5]
char[] flag = new char[2]
functions.GEN_STRCPY(flag, "00")
functions.GEN_STRCPY(group, "00000")
char[] Site_Hist = new char[30]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR) || dx_year < 2018)
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_EMPTY(untrimmedline.primarySite)) {
return true
}
if (functions.GEN_AT(untrimmedline.schemaId, "00430007300074000821", 5) != 0) {
if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
return true
}
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
functions.GEN_STRCPY(Hist, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISC1SEER_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISC1SEER_REF_SITE_LO, Site, ['SITE_LO':SITE_LO, 'SITE_HI':SITE_HI])) {
if (functions.GEN_STRCMP(Site, SITE_LO) >= 0 && functions.GEN_STRCMP(Site, SITE_HI) <= 0) {
functions.GEN_STRCPY(Site_Hist, SITE_LO)
functions.GEN_STRCAT(Site_Hist, Hist)
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for Primary Site: ${untrimmedline.primarySite}')
return true
}
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for Primary Site: ${untrimmedline.primarySite}')
return true
}
if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISCRIM1SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISCRIM1SEER_SITELOWHISTLOW, Site_Hist, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1])) {
if (functions.GEN_STRCMP(SITE_LO, SITELOW) == 0 && functions.GEN_STRCMP(Hist, HISTLOW) >= 0 && functions.GEN_STRCMP(Hist, HISTHIGH) <= 0) {
functions.GEN_STRCPY(Site_Hist, SITE_LO)
functions.GEN_STRCAT(Site_Hist, HISTLOW)
functions.GEN_STRCAT(Site_Hist, untrimmedline.schemaDiscriminator1)
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
return true
}
}
else {
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
return true
}
if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_DISCRIM1SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_DISCRIM1SEER_SITELOWHISTLOWSCDSCR1, Site_Hist, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1]))
functions.GEN_STRCPY(group, GPCODE)
else
functions.GEN_STRCPY(flag, "99")
if (functions.GEN_AT(flag, "99") != 0) {
if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_TEXT(binding, 'Combination of site, histology requires Schema Disc 1 for correct Schema ID')
if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
functions.GEN_SAVE_TEXT(binding, 'Reported value Schema Disc 1 incorrect for combination of site and histology')
}
if (functions.GEN_AT(flag, "00") != 0 && functions.GEN_AT(group, "00000") == 0) {
if (functions.GEN_AT(group, "0010000111", 5) != 0) {
if (functions.GEN_AT(untrimmedline.schemaId, "0010000111", 5) != 0)
return true
}
if (functions.GEN_AT(group, "0016100169", 5) != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8020") != 0) {
if (functions.GEN_AT(untrimmedline.schemaId, "0016100169", 5) != 0)
return true
}
if (functions.GEN_STRCMP(untrimmedline.schemaId, group) != 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema Discriminator 1 is incorrect for Reported Schema ID: ")
functions.GEN_STRCAT(t_schema_msg, untrimmedline.schemaId)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
}
}
return true
}
// ID: NPCR-00101; TAG: N1616; NAME: Summ Stg 2000, Site, Hist ICDO3, Rpt Srce (NAACCR)
public boolean npcr00101(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
return true
else {
return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only; SEER Summary Stage 2000 must = 9')
}
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9738, 9811-9818,9837") && !functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823,9827") && !functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424,441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
}
else {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
}
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9738,9811-9818, 9820-9837") && functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
}
else {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
}
else {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
}
}
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740,9750-9752,9755-9758,9930")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9764")) {
if (dx_year < 2010) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2010, Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
}
else {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis > 2009,Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
}
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731-9992")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-4,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-4, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9700-9701")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "692,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "380-384,388,390-399,470-479,480-488,490-499", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "400-403,408-409,410-414,418-419", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "751-753", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-2,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-2, 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "420-429,760-765,767,768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'Unknown or Ill-Defined Site; SEER Summary Stage 2000 must = 9')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8530")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "2,4,5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 2, 4, 5, 7, or 9')
}
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-5,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-5, 7, or 9')
return true
}
// ID: NPCR-00104; TAG: 1799; NAME: County at DX, Addr at DX--State (Subm)
public boolean npcr00104(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] cnty_state = new char[6]
if (functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return true
if (functions.GEN_INLIST(untrimmedline.countyAtDx, "000"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "CD,US,XX,YY,ZZ"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP"))
return true
functions.GEN_STRCPY(cnty_state, untrimmedline.countyAtDx)
functions.GEN_STRCAT(cnty_state, untrimmedline.addrAtDxState)
if (functions.GEN_LOOKUP(cnty_state, context.NPCR_CNTYALL, context.NPCR_CNTYALL_CNTYSTAT, [:]))
return true
return false
}
// ID: NPCR-00105; TAG: N0176; NAME: Census Tract 2000 (SEER)
public boolean npcr00105(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: NPCR-00107; TAG: 2104; NAME: CS Items - NPCR Required - SSF 1 (Subm) - 2016+
public boolean npcr00107(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
functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_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.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
return true
}
if (dx_year > 2015) {
if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))) && (functions.GEN_INLIST(t_schema_name, "Breast,Brain,IntracranialGland,CNSOther")))
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')
}
return true
}
// ID: NPCR-00108; TAG: N3022; NAME: Brain Molecular Markers, Schema ID, Required (NAACCR)
public boolean npcr00108(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.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2018)
return true
char[] ID = new char[14]
char[] ID2 = new char[25]
char[] code = new char[7]
functions.GEN_STRCPY(ID, "00721 00722 ")
functions.GEN_STRCPY(ID2, "09721 09722 09724 ")
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
}
if (functions.GEN_AT(code, ID2, 6) != 0) {
if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) || functions.GEN_AT(untrimmedline.brainMolecularMarkers, "88") != 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers must not be blank or not applicable for Schema ID: ${untrimmedline.schemaId} cases diagnosed 2023 and later')
}
return true
}
// ID: NPCR-00109; TAG: 1801; NAME: CS Items - NPCR Required - SSF 1 (Subm) - pre2016
public boolean npcr00109(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new 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, err_flag
err_flag = 0
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2004 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1") && (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
return true
}
if (functions.GEN_EMPTY(untrimmedline.overRideCs20)) {
if (dx_year > 2009) {
if (functions.GEN_INLIST(t_schema_name, "Breast")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If DX year = 2010-2015, CS Site-Specific Factor 1 cannot be blank or 988 for this schema')
}
}
}
if (dx_year > 2010) {
if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If DX year = 2011-2015, CS Site-Specific Factor 1 cannot be blank or 988 for this schema')
}
}
}
}
else {
if ((dx_year > 2011) && (dx_year < 2016) && (functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))) {
if (functions.GEN_INLIST(t_schema_name, "Breast,Brain,CNSOther,IntracranialGland")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Site-Specific Factor 1 must not be blank or 988 for this schema')
}
}
}
}
return true
}
// ID: NPCR-00115; TAG: N0832; NAME: ICD Revision Number (NPCR)
public boolean npcr00115(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: NPCR-00119; TAG: 2110; NAME: CS Items - NPCR Required - SSF 15 (Subm) - 2016+
public boolean npcr00119(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.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_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.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
return true
}
if ((functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988") || (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15))) && (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 Factor15 cannot be 988 or blank')
return true
}
// ID: NPCR-00121; TAG: 1802; NAME: CS Items - NPCR Required - SSF 15 (Subm) - pre2016
public boolean npcr00121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new 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, err_flag
err_flag = 0
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2004 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1") && (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,"))
return true
if (dx_year > 2010 && functions.GEN_EMPTY(untrimmedline.overRideCs20)) {
if (functions.GEN_INLIST(t_schema_name, "Breast")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If DX year = 2011-2015, CS Site-Specific Factor15 cannot be blank or 988 for this schema')
}
}
}
else {
if ((dx_year > 2011) && (dx_year < 2016) && (functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))) {
if (functions.GEN_INLIST(t_schema_name, "Breast")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Site-Specific Factor15 must not be blank or 988 for this schema')
}
}
}
}
return true
}
// ID: NPCR-00122; TAG: N0837; NAME: Behavior ICDO3 Conversion (NAACCR)
public boolean npcr00122(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0-3")
}
// ID: NPCR-00123; TAG: 2107; NAME: CS Items - NPCR Required - SSF 2 (Subm) - 2016+
public boolean npcr00123(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
functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 1)
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_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.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
return true
}
if (dx_year > 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')
}
return true
}
// ID: NPCR-00124; TAG: N0838; NAME: Behavior ICDO3, Summary Stage 1977 (NAACCR)
public boolean npcr00124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
}
return true
}
// ID: NPCR-00125; TAG: 1803; NAME: CS Items - NPCR Required - SSF 2 (Subm) - pre2016
public boolean npcr00125(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new 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, err_flag
err_flag = 0
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR))
return true
if (dx_year < 2004 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1") && (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,"))
return true
if (dx_year > 2009 && functions.GEN_EMPTY(untrimmedline.overRideCs20)) {
if (functions.GEN_INLIST(t_schema_name, "Breast")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If DX year = 2010-2015, CS Site-Specific Factor 2 cannot be blank or 988 for this schema')
}
}
}
else {
if ((dx_year > 2011) && (dx_year < 2016) && (functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))) {
if (functions.GEN_INLIST(t_schema_name, "Breast")) {
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988")) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Over-ride CS 20 = \'1\' and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Site-Specific Factor 2 must not be blank or 988 for this schema')
}
}
}
}
return true
}
// ID: NPCR-00126; TAG: N0839; NAME: Hemato ICDO3, Summ Stg 1977 (NAACCR)
public boolean npcr00126(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731-9989"))
return true
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731,9734,9740,9750-9752,9755-9758,9764,9930")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 1, 7, or 9 for this histology')
}
else {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
return true
else
return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 7 for this histology')
}
return true
}
// ID: NPCR-00127; TAG: N3032; NAME: Brain Molecular Markers, Morphology ICD-O-3 (NAACCR)
public boolean npcr00127(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
char[] morph = new char[6]
char[] ID = new char[40]
char[] code = new char[7]
functions.GEN_ALLOW_FUTURE_DATE_IOP(binding, 2)
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR) || dx_year < 2018)
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
functions.GEN_STRCPY(morph, untrimmedline.histologicTypeIcdO3)
functions.GEN_STRCAT(morph, untrimmedline.behaviorCodeIcdO3)
if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
return true
}
functions.GEN_STRCPY(ID, "00721 00722 09721 09722 09724 ")
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(morph, "94003") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "0304", 2) != 0) {
if (functions.GEN_AT(morph, "94013") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "05", 2) != 0) {
if (functions.GEN_AT(morph, "94403") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "06", 2) != 0) {
if (functions.GEN_AT(morph, "94503") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "07", 2) != 0) {
if (functions.GEN_AT(morph, "94513") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "08", 2) != 0) {
if (functions.GEN_AT(morph, "94713") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "09", 2) != 0) {
if (functions.GEN_AT(morph, "94783") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "85", 2) != 0) {
if (functions.GEN_INLIST(morph, "94003,94013,94403,94503,94513,94713,94783"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (dx_year >= 2024) {
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "10111213", 2) != 0) {
if (functions.GEN_AT(morph, "93853") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "1415161718", 2) != 0) {
if (functions.GEN_AT(morph, "93963") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "1920", 2) != 0) {
if (functions.GEN_AT(morph, "94211") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "21", 2) != 0) {
if (functions.GEN_AT(morph, "94303") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "2223", 2) != 0) {
if (functions.GEN_AT(morph, "95003") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "85", 2) != 0) {
if (functions.GEN_INLIST(morph, "93853,93963,94211,94303,95003"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(morph, "94211") != 0) {
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "1920", 2) != 0)
return true
}
}
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86") != 0) {
if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86") == 0)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} and Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers}')
}
return true
}
// ID: NPCR-00129; TAG: N0840; NAME: Histologic Type ICDO3 Conversion (NAACCR)
public boolean npcr00129(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.NPCR_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_HISICDO3_HISTOLOGY, untrimmedline.histologicTypeIcdO3, [:]))
return false
return true
}
// ID: NPCR-00130; TAG: N1672; NAME: Birthplace--Country, Birthplace--State (NAACCR)
public boolean npcr00130(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.NPCR_CNTRY_ST, context.NPCR_CNTRY_ST_CNTRY_ST, [:]))
return false
return true
}
// ID: NPCR-00132; TAG: N0841; NAME: Lymphoma ICDO3, Site, Summ Stg 1977 (NAACCR)
public boolean npcr00132(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
return true
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699, 9702-9729")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4"))
return false
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1"))
return false
}
}
return true
}
// ID: NPCR-00133; TAG: N0842; NAME: Unknown Site, Hist ICDO3, Summ Stg 1977 (NAACCR)
public boolean npcr00133(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9590-9699,9702-9729,9731-9989"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
return true
else
return false
}
return true
}
// ID: NPCR-00134; TAG: 1944; NAME: CS Over-ride CS 20, Date of Diagnosis (Subm)
public boolean npcr00134(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_ERROR)) {
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
}
if ((dx_year == ((Integer)context.NPCR_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')
}
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')
}
}
if (functions.GEN_INLIST(untrimmedline.registryId, "0012000000,0012100000,0012300000,0012300001,0012300002,0012300003,0012300004", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (functions.GEN_INLIST(untrimmedline.registryId, "0012600000,0012900000,0013100000,0013900000", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
return true
}
if (dx_year < 2012) {
if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")) {
if (!functions.GEN_EMPTY(untrimmedline.overRideCs20))
return false
}
}
return true
}
// ID: NPCR-00135; TAG: 1816; NAME: CS Over-rides (Subm)
public boolean npcr00135(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.overRideCs20) || functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))
return true
else
return functions.GEN_SAVE_ERROR_TEXT(binding, 'Over-ride CS 20 must be blank or = 1')
return true
}
// ID: NPCR-00136; TAG: N0199; NAME: Date 1st Crs RX COC, Date of Diagnosis (COC)
public boolean npcr00136(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.date1stCrsRxCoc) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
return true
dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.date1stCrsRxCoc, untrimmedline.dateOfDiagnosis, ((Integer)context.NPCR_GEN_DT_MIN))
if (dtcmp == ((Integer)context.NPCR_GEN_DT_ERROR)) {
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.date1stCrsRxCoc))
functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC is invalid: %DC')
else {
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
}
return false
}
else {
if (dtcmp >= 0)
return true
else
return false
}
return true
}
// ID: NPCR-00137; TAG: 1805; NAME: CS Site-Specific Factor 1, Schema (Subm)
public boolean npcr00137(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
char[] CS_code = new char[4]
int t_schema_number, t_max_schemas, t_result
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
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,Prostate,Brain,CNSOther,IntracranialGland,Prostate"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
return true
}
}
functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor1)
t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 10, 1, CS_code)
if (t_result <= 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
return false
}
return true
}
// ID: NPCR-00138; TAG: 1806; NAME: CS Site-Specific Factor 2, Schema (Subm)
public boolean npcr00138(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
char[] CS_code = new char[4]
int t_schema_number, t_max_schemas, t_result
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (!functions.GEN_INLIST(t_schema_name, "Breast"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
return true
}
}
functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor2)
t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 11, 1, CS_code)
if (t_result <= 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
return false
}
return true
}
// ID: NPCR-00139; TAG: N1678; NAME: Census Tr Poverty Indictr (SEER)
public boolean npcr00139(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.censusTrPovertyIndictr))
return true
if (!functions.GEN_INLIST(untrimmedline.censusTrPovertyIndictr, "1-4,9"))
return false
return true
}
// ID: NPCR-00141; TAG: N2812; NAME: Summary Stage 2018 (NAACCR)
public boolean npcr00141(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: NPCR-00142; TAG: 2024; NAME: CS Site-Specific Factor 8, Schema (Subm)
public boolean npcr00142(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
char[] CS_code = new char[4]
int t_schema_number, t_max_schemas, t_result
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
return true
}
functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor8)
t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 17, 1, CS_code)
if (t_result <= 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
return false
}
return true
}
// ID: NPCR-00143; TAG: N2803; NAME: Grade, Schema ID (NAACCR)
public boolean npcr00143(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[36], Grade = new char[2]
int dx_year
char[] name = new char[50]
char[] group_cgrade = new char[7]
char[] group_pgrade = new char[7]
char[] group_ycgrade = new char[7]
char[] group_ypgrade = new char[7]
char[] ed = new char[2]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_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.NPCR_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_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.NPCR_GEN_RIGHT)))
functions.GEN_STRCPY(ed, functions.GEN_SUBSTR(untrimmedline.schemaId, 1, 2))
if (functions.GEN_AT(ed, "09") != 0) {
if (!functions.GEN_EMPTY(untrimmedline.gradeClinical)) {
functions.GEN_STRCPY(group_cgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_cgrade, untrimmedline.gradeClinical)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADE09_SCHEMA_IDGRADE, group_cgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePathological)) {
functions.GEN_STRCPY(group_pgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_pgrade, untrimmedline.gradePathological)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADE09_SCHEMA_IDGRADE, group_pgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin)) {
functions.GEN_STRCPY(group_ycgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_ycgrade, untrimmedline.gradePostTherapyClin)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADE09_SCHEMA_IDGRADE, group_ycgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Clin (yc): ${untrimmedline.gradePostTherapyClin} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
functions.GEN_STRCPY(group_ypgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_ypgrade, untrimmedline.gradePostTherapy)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADE09_SCHEMA_IDGRADE, group_ypgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
}
else {
if (!functions.GEN_EMPTY(untrimmedline.gradeClinical)) {
functions.GEN_STRCPY(group_cgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_cgrade, untrimmedline.gradeClinical)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADEED8_SCHEMA_IDGRADE, group_cgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePathological)) {
functions.GEN_STRCPY(group_pgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_pgrade, untrimmedline.gradePathological)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADEED8_SCHEMA_IDGRADE, group_pgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin)) {
functions.GEN_STRCPY(group_ycgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_ycgrade, untrimmedline.gradePostTherapyClin)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADEED8_SCHEMA_IDGRADE, group_ycgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Clin (yc): ${untrimmedline.gradePostTherapyClin} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
functions.GEN_STRCPY(group_ypgrade, untrimmedline.schemaId)
functions.GEN_STRCAT(group_ypgrade, untrimmedline.gradePostTherapy)
if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NPCR_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NPCR_GRADEED8_SCHEMA_IDGRADE, group_ypgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
functions.GEN_SAVE_TEXT(binding, name)
functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} is not valid for Schema ID: ${untrimmedline.schemaId}')
}
}
}
return true
}
// ID: NPCR-00145; TAG: 2025; NAME: CS Site-Specific Factor10, Schema (Subm)
public boolean npcr00145(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
char[] CS_code = new char[4]
int t_schema_number, t_max_schemas, t_result
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
return true
}
functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor10)
t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 19, 1, CS_code)
if (t_result <= 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
return false
}
return true
}
// ID: NPCR-00150; TAG: 1808; NAME: CS Site-Specific Factor15, Schema (Subm)
public boolean npcr00150(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new 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, dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NPCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NPCR_GEN_DT_ERROR) || dx_year < 2010)
return true
if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (!functions.GEN_INLIST(t_schema_name, "Breast"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
return true
}
}
functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor15)
t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 24, 1, CS_code)
if (t_result <= 0) {
functions.GEN_STRCPY(t_schema_msg, "Schema: ")
functions.GEN_STRCAT(t_schema_msg, t_schema_name)
functions.GEN_SAVE_TEXT(binding, t_schema_msg)
return false
}
return true
}
// ID: NPCR-00151; TAG: N1688; NAME: Birthplace--Country (COC)
public boolean npcr00151(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.NPCR_CNTRY_ST, context.NPCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NPCR-00153; TAG: N0217; NAME: Diagnostic Confirm, Seq Num--Central (SEER IF23)
public boolean npcr00153(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: NPCR-00154; TAG: 1810; NAME: Date Initial RX SEER, Date of DX (Subm)
public boolean npcr00154(Binding binding, Map context, MetafileContextFunctions functions, List