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.seer.SeerCompiledRules.groovy Maven / Gradle / Ivy
package com.imsweb.validation.edits.seer
import com.imsweb.validation.functions.StagingContextFunctions
import com.imsweb.validation.runtime.CompiledRules
import groovy.transform.CompileStatic
@CompileStatic
class SeerCompiledRules implements CompiledRules {
@Override
public String getValidatorId() {
return 'seer'
}
@Override
public String getValidatorVersion() {
return 'SE24-024-11'
}
@Override
public Map>> getMethodParameters() {
return [
'lines' : [Binding.class, Map.class, StagingContextFunctions.class, List.class],
'lines.line' : [Binding.class, Map.class, StagingContextFunctions.class, List.class, Map.class]
]
}
// ID: Address_at_DX_State; NAME: Addr at DX--State (NAACCR)
public boolean address_at_dx_state(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return ((Map)context.Diagnosis_State).containsKey(line.addrAtDxState)
}
// ID: Age_at_Diagnosis; NAME: Age at Diagnosis (SEER AGEDX)
public boolean age_at_diagnosis(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return functions.matches(line.ageAtDiagnosis, /^(999|0\d\d|1[0-1]\d|120)$/)
}
// ID: AJCC_TNM_Post_Therapy_Clin_Stage_Group; NAME: AJCC TNM Post Therapy Clin (yc) Stage Group (COC)
public boolean ajcc_tnm_post_therapy_clin_stage_group(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.ajccTnmPostTherapyClinStageGrp == null
}
// ID: Behavior_Code_ICD-O-3; NAME: Behavior ICDO3 (COC)
public boolean behavior_code_icdO3(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.behaviorCodeIcdO3 == null || functions.matches(line.behaviorCodeIcdO3, /^[0123]$/)
}
// ID: Behavior_Code_ICD-O-3_Submission; NAME: SEER Submission Edit 01 (SEER)
public boolean behavior_code_icdO3_submission(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.behaviorCodeIcdO3 != null
}
// ID: Behavior_ICDO3_Submission; NAME: SEER Submission Edit 02 (SEER)
public boolean behavior_icdo3_submission(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if ( line.dateOfDiagnosisYear >= '2001'
&& line.dateOfDiagnosisYear <= '2003'
&& line.behaviorCodeIcdO3 != '2'
&& line.behaviorCodeIcdO3 != '3'
)
return false
return true
}
// ID: Birthplace_Country; NAME: Birthplace--Country (NAACCR)
public boolean birthplace_country(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return ((Map)context.Country_State).containsKey(line.birthplaceCountry)
}
// ID: Birthplace_State; NAME: Birthplace--State (NAACCR)
public boolean birthplace_state(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return ((Map)context.State).containsKey(line.birthplaceState)
}
// ID: Cancer_Status; NAME: Cancer Status (NAACCR)
public boolean cancer_status(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.cancerStatus == null || functions.matches(line.cancerStatus, /^[129]$/)
}
// ID: Cause_of_Death; NAME: Cause of Death (SEER COD)
public boolean cause_of_death(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return functions.matches(line.causeOfDeath, /^[A-Z0-9][0-9][0-9][0-9]?$/)
}
// ID: Census_Cod_Sys_1970-80-90; NAME: Census Cod Sys 1970/80/90 (SEER RESSYST)
public boolean census_cod_sys_19708090(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if ( line.censusCodSys19708090 != null
&& !(functions.matches(line.censusCodSys19708090, /^[0-3\s]$/))
)
return false
return true
}
// ID: Census_Tr_Cert_1970-80-90; NAME: Census Tr Cert 1970/80/90 (SEER CENSCERT)
public boolean census_tr_cert_19708090(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if ( line.censusTrCert19708090 != null && !(functions.matches(line.censusTrCert19708090, /^[1234569\s]$/)))
return false
return true
}
// ID: Census_Tr_Certainty_2000; NAME: Census Tr Certainty 2000 (SEER)
public boolean census_tr_certainty_2000(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTrCertainty2000 == null || functions.matches(line.censusTrCertainty2000, /^[1234569\s]$/)
}
// ID: Census_Tr_Certainty_2010; NAME: Census Tr Certainty 2010 (SEER)
public boolean census_tr_certainty_2010(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTrCertainty2010 == null || functions.matches(line.censusTrCertainty2010, /^[1234569\s]$/)
}
// ID: Census_Tr_Certainty_2020; NAME: Census Tr Certainty 2020 (NAACCR)
public boolean census_tr_certainty_2020(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTractCertainty2020 == null || functions.matches(line.censusTractCertainty2020, /^[1234569\s]$/)
}
// ID: Census_Tract_1970-80-90; NAME: Census Tract 1970/80/90 (SEER TRACT)
public boolean census_tract_19708090(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.censusTract19708090 != null && line.censusTract19708090 != '000000' && line.censusTract19708090 != '999999'
&& (!(functions.matches(line.censusTract19708090, /^[0-9]{6}$/)) || !functions.between(line.censusTract19708090, '000100', '9999998')))
return false
return true
}
// ID: Census_Tract_2000; NAME: Census Tract 2000 (SEER)
public boolean census_tract_2000(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTract2000 == null || line.censusTract2000 == '000000' || (functions.matches(line.censusTract2000, /^[0-9]{6}$/) && functions.between(line.censusTract2000, '000100', '999999'))
}
// ID: Census_Tract_2010; NAME: Census Tract 2010 (SEER)
public boolean census_tract_2010(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTract2010 == null || line.censusTract2010 == '000000' || (functions.matches(line.censusTract2010, /^[0-9]{6}$/) && functions.between(line.censusTract2010, '000100', '999999'))
}
// ID: Census_Tract_2020; NAME: Census Tract 2020 (NAACCR)
public boolean census_tract_2020(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusTract2020 == null || line.censusTract2020 == '000000' || (functions.matches(line.censusTract2020, /^[0-9]{6}$/) && functions.between(line.censusTract2020, '000100', '999999'))
}
// ID: Census_Tract_Block_Group_2000; NAME: Census Block Group 2000 (NAACCR)
public boolean census_tract_block_group_2000(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusBlockGroup2000 == null || functions.matches(line.censusBlockGroup2000, /^[0-9]$/)
}
// ID: Census_Tract_Block_Group_708090; NAME: Census Block Grp 1970-90 (NAACCR)
public boolean census_tract_block_group_708090(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.censusBlockGrp197090 == null || functions.matches(line.censusBlockGrp197090, /^[0-9]$/)
}
// ID: CoC_Accredited_Flag; NAME: CoC Accredited Flag (NPCR)
public boolean coc_accredited_flag(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.cocAccreditedFlag == null || functions.matches(line.cocAccreditedFlag, /^[012]$/)
}
// ID: Coding_System_for_EOD; NAME: Coding System for EOD (SEER EODSYST)
public boolean coding_system_for_eod(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.codingSystemForEod == null || functions.matches(line.codingSystemForEod, /^[0-4\s]$/)
}
// ID: County_at_DX_Analysis; NAME: County at DX Analysis (NAACCR)
public boolean county_at_dx_analysis(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxAnalysis == null || functions.matches(line.countyAtDxAnalysis, /^\d\d[1-9]|\d[1-9]0|[1-9]\d0$/)
}
// ID: County_at_DX_Geocode1990; NAME: County at DX Geocode 1970/80/90 (NAACCR)
public boolean county_at_dx_geocode1990(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxGeocode1990 == null || (functions.matches(line.countyAtDxGeocode1990, /^\d\d\d$/) && line.countyAtDxGeocode1990 != '000')
}
// ID: County_at_DX_Geocode2000; NAME: County at DX Geocode2000 (NAACCR)
public boolean county_at_dx_geocode2000(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxGeocode2000 == null || (functions.matches(line.countyAtDxGeocode2000, /^\d\d\d$/) && line.countyAtDxGeocode2000 != '000')
}
// ID: County_at_DX_Geocode2010; NAME: County at DX Geocode2010 (NAACCR)
public boolean county_at_dx_geocode2010(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxGeocode2010 == null || (functions.matches(line.countyAtDxGeocode2010, /^\d\d\d$/) && line.countyAtDxGeocode2010 != '000')
}
// ID: County_at_DX_Geocode2020; NAME: County at DX Geocode2020 (NAACCR)
public boolean county_at_dx_geocode2020(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxGeocode2020 == null || (functions.matches(line.countyAtDxGeocode2020, /^\d\d\d$/) && line.countyAtDxGeocode2020 != '000')
}
// ID: County_Submission; NAME: SEER Submission Edit 01 (SEER)
public boolean county_submission(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.countyAtDxAnalysis != null
}
// ID: Covid_19_Antibody_Test; NAME: Covid-19 Antibody Test and Date
public boolean covid_19_antibody_test(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.covid19AntibodyTest != '1' || line.covid19AntibodyTestDateYear != null
}
// ID: Covid_19_Antibody_Test_Date; NAME: Covid-19 Antibody Test Date
public boolean covid_19_antibody_test_date(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.covid19AntibodyTestDateYear == null)
return (line.covid19AntibodyTestDateMonth == null && line.covid19AntibodyTestDateDay == null)
if (line.covid19AntibodyTestDateYear < '2019')
return false
Integer year = functions.asInt(line.covid19AntibodyTestDateYear)
Integer month = functions.asInt(line.covid19AntibodyTestDateMonth)
Integer day = functions.asInt(line.covid19AntibodyTestDateDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if ((line.covid19AntibodyTestDateMonth == null && line.covid19AntibodyTestDateDay != null) || (month > 12 || (line.covid19AntibodyTestDateMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.covid19AntibodyTestDateMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.covid19AntibodyTestDateDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: Covid_19_Decision_To_Delay_Date; NAME: Covid-19 Decision to Delay Date
public boolean covid_19_decision_to_delay_date(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.covid19DecisionToDelayDateYear == null)
return (line.covid19DecisionToDelayDateMonth == null && line.covid19DecisionToDelayDateDay == null)
if (line.covid19DecisionToDelayDateYear < '2019')
return false
Integer year = functions.asInt(line.covid19DecisionToDelayDateYear)
Integer month = functions.asInt(line.covid19DecisionToDelayDateMonth)
Integer day = functions.asInt(line.covid19DecisionToDelayDateDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if ((line.covid19DecisionToDelayDateMonth == null && line.covid19DecisionToDelayDateDay != null) || (month > 12 || (line.covid19DecisionToDelayDateMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.covid19DecisionToDelayDateMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.covid19DecisionToDelayDateDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: Covid_19_Delayed_CA_Events; NAME: Covid-19 Delayed CA Events and Decision to Delay Date
public boolean covid_19_delayed_ca_events(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.covid19DelayedCAEvents != '1' || line.covid19DecisionToDelayDateYear != null
}
// ID: Covid_19_Diagnosed; NAME: Covid-19 Diagnosis and Date
public boolean covid_19_diagnosed(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.covid19Diagnosed != '1' || line.covid19DxDateYear != null
}
// ID: Covid_19_Diagnosis_Date; NAME: Covid-19 Diagnosis Date
public boolean covid_19_diagnosis_date(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.covid19DxDateYear == null)
return (line.covid19DxDateMonth == null && line.covid19DxDateDay == null)
if (line.covid19DxDateYear < '2019')
return false
Integer year = functions.asInt(line.covid19DxDateYear)
Integer month = functions.asInt(line.covid19DxDateMonth)
Integer day = functions.asInt(line.covid19DxDateDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if ((line.covid19DxDateMonth == null && line.covid19DxDateDay != null) || (month > 12 || (line.covid19DxDateMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.covid19DxDateMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.covid19DxDateDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: Covid_19_Viral_Test; NAME: Covid-19 Viral Test and Date
public boolean covid_19_viral_test(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.covid19ViralTest != '1' || line.covid19ViralTestDateYear != null
}
// ID: Covid_19_Viral_Test_Date; NAME: Covid-19 Viral Test Date
public boolean covid_19_viral_test_date(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.covid19ViralTestDateYear == null)
return (line.covid19ViralTestDateMonth == null && line.covid19ViralTestDateDay == null)
if (line.covid19ViralTestDateYear < '2019')
return false
Integer year = functions.asInt(line.covid19ViralTestDateYear)
Integer month = functions.asInt(line.covid19ViralTestDateMonth)
Integer day = functions.asInt(line.covid19ViralTestDateDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if ((line.covid19ViralTestDateMonth == null && line.covid19ViralTestDateDay != null) || (month > 12 || (line.covid19ViralTestDateMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.covid19ViralTestDateMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.covid19ViralTestDateDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: CS_Extension; NAME: CS Extension (CS)
public boolean cs_extension(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csExtension == null || functions.matches(line.csExtension, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Lymph_Nodes; NAME: CS Lymph Nodes (CS)
public boolean cs_lymph_nodes(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csLymphNodes == null || functions.matches(line.csLymphNodes, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Mets_at_DX; NAME: CS Mets at DX (CS)
public boolean cs_mets_at_dx(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsAtDx == null || functions.matches(line.csMetsAtDx, /(^[0-9][0-9]$)|(^\s\s$)/)
}
// ID: CS_Mets_at_DX_Bone; NAME: CS Mets at DX-Bone (CS)
public boolean cs_mets_at_dx_bone(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsAtDxBone == null || functions.matches(line.csMetsAtDxBone, /^[0189]$/)
}
// ID: CS_Mets_at_DX_Brain; NAME: CS Mets at DX-Brain (CS)
public boolean cs_mets_at_dx_brain(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsAtDxBrain == null || functions.matches(line.csMetsAtDxBrain, /^[0189]$/)
}
// ID: CS_Mets_at_DX_Liver; NAME: CS Mets at DX-Liver (CS)
public boolean cs_mets_at_dx_liver(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsAtDxLiver == null || functions.matches(line.csMetsAtDxLiver, /^[0189]$/)
}
// ID: CS_Mets_at_DX_Lung; NAME: CS Mets at DX-Lung (CS)
public boolean cs_mets_at_dx_lung(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsAtDxLung == null || functions.matches(line.csMetsAtDxLung, /^[0189]$/)
}
// ID: CS_Mets_Eval; NAME: CS Mets Eval (CS)
public boolean cs_mets_eval(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csMetsEval == null || functions.matches(line.csMetsEval, /^[01235689\s]$/)
}
// ID: CS_Reg_Node_Eval; NAME: CS Lymph Nodes Eval (CS)
public boolean cs_reg_node_eval(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csLymphNodesEval == null || functions.matches(line.csLymphNodesEval, /^[01235689\s]$/)
}
// ID: CS_Site-Specific_Factor_1; NAME: CS Site-Specific Factor 1 (CS)
public boolean cs_siteSpecific_factor_1(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor1 == null || functions.matches(line.csSiteSpecificFactor1, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_2; NAME: CS Site-Specific Factor 2 (CS)
public boolean cs_siteSpecific_factor_2(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor2 == null || functions.matches(line.csSiteSpecificFactor2, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_3; NAME: CS Site-Specific Factor 3 (CS)
public boolean cs_siteSpecific_factor_3(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor3 == null || functions.matches(line.csSiteSpecificFactor3, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_4; NAME: CS Site-Specific Factor 4 (CS)
public boolean cs_siteSpecific_factor_4(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor4 == null || functions.matches(line.csSiteSpecificFactor4, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_5; NAME: CS Site-Specific Factor 5 (CS)
public boolean cs_siteSpecific_factor_5(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor5 == null || functions.matches(line.csSiteSpecificFactor5, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_6; NAME: CS Site-Specific Factor 6 (CS)
public boolean cs_siteSpecific_factor_6(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor6 == null || functions.matches(line.csSiteSpecificFactor6, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_7; NAME: CS Site-Specific Factor 7 (CS)
public boolean cs_siteSpecific_factor_7(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor7 == null || functions.matches(line.csSiteSpecificFactor7, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_8; NAME: CS Site-Specific Factor 8 (CS)
public boolean cs_siteSpecific_factor_8(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor8 == null || functions.matches(line.csSiteSpecificFactor8, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_9; NAME: CS Site-Specific Factor 9 (CS)
public boolean cs_siteSpecific_factor_9(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor9 == null || functions.matches(line.csSiteSpecificFactor9, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_10; NAME: CS Site-Specific Factor10 (CS)
public boolean cs_siteSpecific_factor_10(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor10 == null || functions.matches(line.csSiteSpecificFactor10, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_11; NAME: CS Site-Specific Factor11 (CS)
public boolean cs_siteSpecific_factor_11(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor11 == null || functions.matches(line.csSiteSpecificFactor11, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_12; NAME: CS Site-Specific Factor12 (CS)
public boolean cs_siteSpecific_factor_12(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor12 == null || functions.matches(line.csSiteSpecificFactor12, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_13; NAME: CS Site-Specific Factor13 (CS)
public boolean cs_siteSpecific_factor_13(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor13 == null || functions.matches(line.csSiteSpecificFactor13, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_14; NAME: CS Site-Specific Factor14 (CS)
public boolean cs_siteSpecific_factor_14(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor14 == null || functions.matches(line.csSiteSpecificFactor14, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_15; NAME: CS Site-Specific Factor15 (CS)
public boolean cs_siteSpecific_factor_15(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor15 == null || functions.matches(line.csSiteSpecificFactor15, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_16; NAME: CS Site-Specific Factor16 (CS)
public boolean cs_siteSpecific_factor_16(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor16 == null || functions.matches(line.csSiteSpecificFactor16, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_17; NAME: CS Site-Specific Factor17 (CS)
public boolean cs_siteSpecific_factor_17(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor17 == null || functions.matches(line.csSiteSpecificFactor17, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_18; NAME: CS Site-Specific Factor18 (CS)
public boolean cs_siteSpecific_factor_18(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor18 == null || functions.matches(line.csSiteSpecificFactor18, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_19; NAME: CS Site-Specific Factor19 (CS)
public boolean cs_siteSpecific_factor_19(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor19 == null || functions.matches(line.csSiteSpecificFactor19, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_20; NAME: CS Site-Specific Factor20 (CS)
public boolean cs_siteSpecific_factor_20(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor20 == null || functions.matches(line.csSiteSpecificFactor20, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_21; NAME: CS Site-Specific Factor21 (CS)
public boolean cs_siteSpecific_factor_21(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor21 == null || functions.matches(line.csSiteSpecificFactor21, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_22; NAME: CS Site-Specific Factor22 (CS)
public boolean cs_siteSpecific_factor_22(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor22 == null || functions.matches(line.csSiteSpecificFactor22, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_23; NAME: CS Site-Specific Factor23 (CS)
public boolean cs_siteSpecific_factor_23(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor23 == null || functions.matches(line.csSiteSpecificFactor23, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_24; NAME: CS Site-Specific Factor24 (CS)
public boolean cs_siteSpecific_factor_24(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor24 == null || functions.matches(line.csSiteSpecificFactor24, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Site-Specific_Factor_25; NAME: CS Site-Specific Factor25 (CS)
public boolean cs_siteSpecific_factor_25(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csSiteSpecificFactor25 == null || functions.matches(line.csSiteSpecificFactor25, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Tumor_Size; NAME: CS Tumor Size (CS)
public boolean cs_tumor_size(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csTumorSize == null || functions.matches(line.csTumorSize, /(^[0-9][0-9][0-9]$)|(^\s\s\s$)/)
}
// ID: CS_Tumor_Size_Ext_Eval; NAME: CS Tumor Size/Ext Eval (CS)
public boolean cs_tumor_size_ext_eval(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csTumorSizeExtEval == null || functions.matches(line.csTumorSizeExtEval, /^[0-5689\s]$/)
}
// ID: CS_Version_Derived; NAME: CS Version Derived (CS)
public boolean cs_version_derived(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.csVersionDerived == null || (functions.matches(line.csVersionDerived, /^0205\d\d$/) && line.csVersionDerived <= functions.getCsVersion())
}
// ID: CS_Version_Input_Current; NAME: CS Version Input Current (CS)
public boolean cs_version_input_current(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.csVersionInputCurrent == null)
return true
if (line.csVersionInputCurrent <= functions.getCsVersion()) {
Integer version = functions.asInt(line.csVersionInputCurrent)
return ['020550','020540','020530','020520','020510'].contains(line.csVersionInputCurrent) ||
version > 20550
}
return false
}
// ID: CS_Version_Input_Original; NAME: CS Version Input Original (CS)
public boolean cs_version_input_original(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
if (line.csVersionInputOriginal == null)
return true
if (['020440','020302','020200','020100','020001','010401','010400','010300','010200','010100','010005','010004','010003','010002','010000','000937'].contains(line.csVersionInputOriginal))
return true
Integer version = functions.asInt(line.csVersionInputOriginal)
if (version > functions.asInt(functions.getCsVersion()))
return false
if (line.csVersionInputOriginal.startsWith('0205'))
return version >= 20550
return false
}
// ID: DateBirthEdit; NAME: Date of Birth (NAACCR)
public boolean datebirthedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateOfBirthYear)
Integer month = functions.asInt(line.dateOfBirthMonth)
Integer day = functions.asInt(line.dateOfBirthDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.dateOfBirthYear == null)
return line.dateOfBirthMonth == null && line.dateOfBirthDay == null
if ((line.dateOfBirthMonth == null && line.dateOfBirthDay != null) || (month > 12 || (month != null && month < 1)))
return false
if (!functions.between(year, 1810, yearCur))
return false
if (line.dateOfBirthMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateOfBirthDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
// check for day of the month too big (need to check leap years too)
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: DateDiagnosisEdit; NAME: Date of Diagnosis (NAACCR DATEEDIT)
public boolean datediagnosisedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateOfDiagnosisYear)
Integer month = functions.asInt(line.dateOfDiagnosisMonth)
Integer day = functions.asInt(line.dateOfDiagnosisDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.dateOfDiagnosisYear == null)
return line.dateOfDiagnosisMonth == null && line.dateOfDiagnosisDay == null
if ((line.dateOfDiagnosisMonth == null && line.dateOfDiagnosisDay != null) || (month > 12 || (line.dateOfDiagnosisMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.dateOfDiagnosisMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateOfDiagnosisDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: DateFollowUpEdit; NAME: Date of Last Contact (NAACCR DATEEDIT)
public boolean datefollowupedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateOfLastContactYear)
Integer month = functions.asInt(line.dateOfLastContactMonth)
Integer day = functions.asInt(line.dateOfLastContactDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.dateOfLastContactYear == null)
return (line.dateOfLastContactMonth == null && line.dateOfLastContactDay == null)
if ((line.dateOfLastContactMonth == null && line.dateOfLastContactDay != null) || (month > 12 || (line.dateOfLastContactMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.dateOfLastContactMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateOfLastContactDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: DateRegionalLymphNodeDissectionEdit; NAME: Date Regional Lymph Node Dissection (COC)
public boolean dateregionallymphnodedissectionedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateRegionalLNDissectionYear)
Integer month = functions.asInt(line.dateRegionalLNDissectionMonth)
Integer day = functions.asInt(line.dateRegionalLNDissectionDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.dateRegionalLNDissectionYear == null)
return (line.dateRegionalLNDissectionMonth == null && line.dateRegionalLNDissectionDay == null)
if ((line.dateRegionalLNDissectionMonth == null && line.dateRegionalLNDissectionDay != null) || (month > 12 || (line.dateRegionalLNDissectionMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.dateRegionalLNDissectionMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateRegionalLNDissectionDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: DateSentinelLymphNodeBiopsyEdit; NAME: Date of Sentinel Lymph Node Biopsy (COC)
public boolean datesentinellymphnodebiopsyedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateSentinelLymphNodeBiopsyYear)
Integer month = functions.asInt(line.dateSentinelLymphNodeBiopsyMonth)
Integer day = functions.asInt(line.dateSentinelLymphNodeBiopsyDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.dateSentinelLymphNodeBiopsyYear == null)
return (line.dateSentinelLymphNodeBiopsyMonth == null && line.dateSentinelLymphNodeBiopsyDay == null)
if ((line.dateSentinelLymphNodeBiopsyMonth == null && line.dateSentinelLymphNodeBiopsyDay != null) || (month > 12 || (line.dateSentinelLymphNodeBiopsyMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.dateSentinelLymphNodeBiopsyMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateSentinelLymphNodeBiopsyDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: DateTherapyEdit; NAME: Date Initial RX SEER (NAACCR)
public boolean datetherapyedit(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
Integer year = functions.asInt(line.dateInitialRxSeerYear)
Integer month = functions.asInt(line.dateInitialRxSeerMonth)
Integer day = functions.asInt(line.dateInitialRxSeerDay)
Integer yearCur = functions.getCurrentYear()
Integer monthCur = functions.getCurrentMonth()
Integer dayCur = functions.getCurrentDay()
if (line.registryId == '0000001544' && line.dateOfDiagnosisYear < '2000')
return true
if (line.dateInitialRxSeerYear == null)
return (line.dateInitialRxSeerMonth == null && line.dateInitialRxSeerDay == null)
if ((line.dateInitialRxSeerMonth == null && line.dateInitialRxSeerDay != null) || (month > 12 || (line.dateInitialRxSeerMonth != null && month < 1)))
return false
if (!functions.between(year, 1930, yearCur))
return false
if (line.dateInitialRxSeerMonth == null) //by now year fits and day is null if month is null
return true
if (year == yearCur && month > monthCur)
return false
if (line.dateInitialRxSeerDay == null) //by now year and month fit
return true
if (year == yearCur && month == monthCur && day > dayCur)
return false
Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)
}
// ID: Day_BRM; NAME: RX Date BRM (COC)
public boolean day_brm(Binding binding, Map context, StagingContextFunctions functions, List> lines, Map line) throws Exception {
return line.rxDateBrmDay == null || functions.matches(line.rxDateBrmDay, /^(0[1-9]|[12][0-9]|3[0-1])$/)
}
// ID: Day_Chemo; NAME: RX Date Chemo (COC)
public boolean day_chemo(Binding binding, Map context, StagingContextFunctions functions, List