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.naaccr.NaaccrTranslatedCompiledRules1.groovy Maven / Gradle / Ivy
package com.imsweb.validation.edits.translated.naaccr
import com.imsweb.validation.functions.MetafileContextFunctions
import com.imsweb.validation.runtime.CompiledRules
import groovy.transform.CompileStatic
@CompileStatic
class NaaccrTranslatedCompiledRules1 implements CompiledRules {
@Override
public String getValidatorId() {
return 'naaccr-translated'
}
@Override
public String getValidatorVersion() {
return 'NAACCR-011-01'
}
@Override
public Map>> getMethodParameters() {
return [
'untrimmedlines' : [Binding.class, Map.class, MetafileContextFunctions.class, List.class],
'untrimmedlines.untrimmedline' : [Binding.class, Map.class, MetafileContextFunctions.class, List.class, Map.class]
]
}
@Override
public boolean containsRuleId(String id) {
return 'NAACCR-00001' <= id && id <= 'NAACCR-00292'
}
// ID: NAACCR-00001; TAG: N0148; NAME: Abstracted By (COC)
public boolean naaccr00001(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.abstractedBy))
return true
return functions.GEN_MATCH(untrimmedline.abstractedBy, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")
}
// ID: NAACCR-00002; TAG: N0201; NAME: Abstracted By (NAACCR)
public boolean naaccr00002(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_MATCH(untrimmedline.abstractedBy, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")
}
// ID: NAACCR-00003; TAG: N0360; NAME: Abstracted By, Date of Diagnosis (COC)
public boolean naaccr00003(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.abstractedBy))
return false
}
return true
}
// ID: NAACCR-00004; TAG: N0551; NAME: Accession Number, Class of Case, Seq Number (NAACCR)
public boolean naaccr00004(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dolc_year, dofc_year, dx_year
char[] ac_yy = new char[5]
char[] message = new char[70]
if (functions.GEN_INLIST(untrimmedline.overRideAcsnClassSeq, "1")) {
return true
}
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
dofc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
if (dofc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
if (dolc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
functions.GEN_STRCPY(message, "OR must be set if Seq Num 00, 01, 60, or 61 added after accession year")
functions.GEN_STRCPY(ac_yy, functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4))
if (functions.GEN_INLIST(untrimmedline.classOfCase, "00,10-14")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
if (dx_year < 1996) {
if (functions.GEN_VAL(ac_yy) < dx_year) {
functions.GEN_SAVE_TEXT(binding, message)
return functions.GEN_ERROR_MSG(binding, 'Conflict among Class of Case, Accession Number--Hosp, Sequence Number--Hospital, Date of Diagnosis')
}
}
else {
if (functions.GEN_VAL(ac_yy) != dofc_year) {
functions.GEN_SAVE_TEXT(binding, message)
return false
}
}
}
}
if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
if ((functions.GEN_VAL(ac_yy) != dofc_year) || (dolc_year != dofc_year)) {
functions.GEN_SAVE_TEXT(binding, message)
return false
}
}
}
if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
if (!functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
if (dolc_year != dofc_year) {
functions.GEN_SAVE_TEXT(binding, message)
return false
}
}
}
return true
}
// ID: NAACCR-00005; TAG: N0034; NAME: Accession Number--Hosp (COC)
public boolean naaccr00005(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_MATCH(untrimmedline.accessionNumberHosp, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return false
if (functions.GEN_INLIST(untrimmedline.accessionNumberHosp, "00000", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)", 5, 5))
return false
if ((functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4)) > 1929) && (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4)) <= functions.GEN_DATE_YEAR_IOP(binding, functions.GEN_DT_TODAY())))
return true
else
return false
return true
}
// ID: NAACCR-00006; TAG: N0156; NAME: Addr Current--City (SEER)
public boolean naaccr00006(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCity))
return true
if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrCurrentCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
return true
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentCity, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrCurrentCity, idx, 2), "(\\s\\s)"))
return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
idx = idx + 1
}
return functions.GEN_MATCH(untrimmedline.addrCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")
}
// ID: NAACCR-00007; TAG: N0350; NAME: Addr Current--City (NAACCR)
public boolean naaccr00007(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int len
int idx
if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrCurrentCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
return true
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentCity, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrCurrentCity, idx, 2), "(\\s\\s)"))
return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
idx = idx + 1
}
return functions.GEN_MATCH(untrimmedline.addrCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")
}
// ID: NAACCR-00008; TAG: N0342; NAME: Addr Current--City, Date of Diagnosis (COC)
public boolean naaccr00008(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCity))
return false
}
return true
}
// ID: NAACCR-00009; TAG: N1684; NAME: Addr Current--Country (SEER)
public boolean naaccr00009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry))
return true
if (!functions.GEN_LOOKUP(untrimmedline.addrCurrentCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00010; TAG: N1667; NAME: Addr Current--Country (NAACCR)
public boolean naaccr00010(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_LOOKUP(untrimmedline.addrCurrentCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00011; TAG: N1685; NAME: Addr Current--Country, Date of Diagnosis (COC)
public boolean naaccr00011(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry))
return false
}
functions.GEN_ERROR_MSG(binding, 'Addr Current--Country cannot be ${untrimmedline.addrCurrentCountry} if Date of Diagnosis is greater than 2012')
if (dx_year > 2012) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
return false
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
return false
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
return false
}
return true
}
// ID: NAACCR-00012; TAG: N1686; NAME: Addr Current--Country, Date of Diagnosis (NAACCR)
public boolean naaccr00012(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry))
return true
if (dx_year > 2012) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
return false
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
return false
if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
return false
}
return true
}
// ID: NAACCR-00013; TAG: N1700; NAME: Addr Current--Country, State (NAACCR)
public boolean naaccr00013(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] cntry_state = new char[6]
if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
return true
functions.GEN_STRCPY(cntry_state, untrimmedline.addrCurrentCountry)
functions.GEN_STRCAT(cntry_state, untrimmedline.addrCurrentState)
if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
return false
return true
}
// ID: NAACCR-00014; TAG: N0150; NAME: Addr Current--No/Street (SEER)
public boolean naaccr00014(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet)) {
return true
}
if (!functions.GEN_MATCH(untrimmedline.addrCurrentNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentNoStreet, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00015; TAG: N0351; NAME: Addr Current--No/Street (NAACCR)
public boolean naaccr00015(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_MATCH(untrimmedline.addrCurrentNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentNoStreet, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00016; TAG: N0362; NAME: Addr Current--No/Street, Date of Diagnosis (COC)
public boolean naaccr00016(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
return false
}
return true
}
// ID: NAACCR-00017; TAG: N0336; NAME: Addr Current--Postal Code (SEER)
public boolean naaccr00017(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode))
return true
return functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")
}
// ID: NAACCR-00018; TAG: N0170; NAME: Addr Current--Postal Code (NAACCR)
public boolean naaccr00018(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")
}
// ID: NAACCR-00019; TAG: N0352; NAME: Addr Current--Postal Code, Addr Current--State (NAACCR)
public boolean naaccr00019(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
return true
if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
return true
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "AA,AE,AP"))
return true
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "88888, 888888888")) {
if (!functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return false
else
return true
}
if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999, 999999, 999999999")) {
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return false
}
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return true
if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999,999999999"))
return true
else
return false
}
else {
if (!functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
return false
}
if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addrCurrentPostalCode, 1, 5)) < 10)
return false
return true
}
// ID: NAACCR-00020; TAG: N0337; NAME: Addr Current--Postal Code, Date of Diagnosis (COC)
public boolean naaccr00020(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode))
return false
}
return true
}
// ID: NAACCR-00021; TAG: N0338; NAME: Addr Current--State (SEER)
public boolean naaccr00021(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentState))
return true
return functions.GEN_LOOKUP(untrimmedline.addrCurrentState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])
}
// ID: NAACCR-00022; TAG: N0197; NAME: Addr Current--State (NAACCR)
public boolean naaccr00022(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_LOOKUP(untrimmedline.addrCurrentState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])
}
// ID: NAACCR-00023; TAG: N0339; NAME: Addr Current--State, Date of Diagnosis (COC)
public boolean naaccr00023(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrCurrentState))
return false
}
return true
}
// ID: NAACCR-00024; TAG: N0538; NAME: Addr Current--Supplementl (SEER)
public boolean naaccr00024(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrCurrentSupplementl))
return true /* must be left justified */
if (!functions.GEN_MATCH(untrimmedline.addrCurrentSupplementl, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrCurrentSupplementl))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentSupplementl, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentSupplementl, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00025; TAG: N0037; NAME: Addr at DX--City (COC)
public boolean naaccr00025(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCity))
return true
if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrAtDxCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
return true
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxCity, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrAtDxCity, idx, 2), "(\\s\\s)"))
return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
idx = idx + 1
}
return functions.GEN_MATCH(untrimmedline.addrAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")
}
// ID: NAACCR-00026; TAG: N0799; NAME: Addr at DX--City (NAACCR)
public boolean naaccr00026(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int len
int idx
if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrAtDxCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
return true
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxCity, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrAtDxCity, idx, 2), "(\\s\\s)"))
return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
idx = idx + 1
}
return functions.GEN_MATCH(untrimmedline.addrAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")
}
// ID: NAACCR-00027; TAG: N0341; NAME: Addr at DX--City, Date of Diagnosis (COC)
public boolean naaccr00027(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCity))
return false
}
return true
}
// ID: NAACCR-00028; TAG: N1680; NAME: Addr at DX--Country (COC)
public boolean naaccr00028(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry))
return true
if (!functions.GEN_LOOKUP(untrimmedline.addrAtDxCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00029; TAG: N1666; NAME: Addr at DX--Country (NAACCR)
public boolean naaccr00029(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_LOOKUP(untrimmedline.addrAtDxCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00030; TAG: N1681; NAME: Addr at DX--Country, Date of Diagnosis (COC)
public boolean naaccr00030(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry))
return false
}
functions.GEN_ERROR_MSG(binding, 'Addr at DX--Country cannot be ${untrimmedline.addrAtDxCountry} if Date of Diagnosis is greater than 2012')
if (dx_year > 2012) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
return false
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
return false
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
return false
}
return true
}
// ID: NAACCR-00031; TAG: N1683; NAME: Addr at DX--Country, Date of Diagnosis (NAACCR)
public boolean naaccr00031(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry))
return true
if (dx_year > 2012) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
return false
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
return false
if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
return false
}
return true
}
// ID: NAACCR-00032; TAG: N1699; NAME: Addr at DX--Country, State (NAACCR)
public boolean naaccr00032(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] cntry_state = new char[6]
if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return true
functions.GEN_STRCPY(cntry_state, untrimmedline.addrAtDxCountry)
functions.GEN_STRCAT(cntry_state, untrimmedline.addrAtDxState)
if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
return false
return true
}
// ID: NAACCR-00033; TAG: N0149; NAME: Addr at DX--No/Street (SEER)
public boolean naaccr00033(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet)) {
return true
}
if (!functions.GEN_MATCH(untrimmedline.addrAtDxNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxNoStreet, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00034; TAG: N0348; NAME: Addr at DX--No/Street (NAACCR)
public boolean naaccr00034(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_MATCH(untrimmedline.addrAtDxNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxNoStreet, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00035; TAG: N0361; NAME: Addr at DX--No/Street, Date of Diagnosis (COC)
public boolean naaccr00035(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
return false
}
return true
}
// ID: NAACCR-00036; TAG: N0123; NAME: Addr at DX--Postal Code (NAACCR)
public boolean naaccr00036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")
}
// ID: NAACCR-00037; TAG: N0349; NAME: Addr at DX--Postal Code, Addr at DX--State (COC)
public boolean naaccr00037(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999, 999999999"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "88888, 888888888")) {
if (!functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return false
else
return true
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999, 999999999")) {
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return false
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT", "([A-Za-z0-9][A-Za-z0-9])")) {
if (functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999,999999999"))
return true
else
return false
}
else {
if (!functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
return false
}
if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addrAtDxPostalCode, 1, 5)) < 10)
return false
return true
}
// ID: NAACCR-00038; TAG: N0334; NAME: Addr at DX--State (COC)
public boolean naaccr00038(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return true
return functions.GEN_LOOKUP(untrimmedline.addrAtDxState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])
}
// ID: NAACCR-00039; TAG: N0122; NAME: Addr at DX--State (NAACCR)
public boolean naaccr00039(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_LOOKUP(untrimmedline.addrAtDxState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])
}
// ID: NAACCR-00040; TAG: N0335; NAME: Addr at DX--State, Date of Diagnosis (COC)
public boolean naaccr00040(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 1995) {
if (functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return false
}
return true
}
// ID: NAACCR-00041; TAG: N0909; NAME: Addr at DX--State, Postal Code Range (NAACCR)
public boolean naaccr00041(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] state = new char[3], st_ziplow = new char[100], ziplow = new char[6], ziphigh = new char[6]
char[] StateZip = new char[20]
if (functions.GEN_EMPTY(untrimmedline.addrAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999999")) {
return true
}
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP,CD,US,XX,YY,ZZ"))
return true
if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT")) {
return true
}
functions.GEN_STRCPY(StateZip, untrimmedline.addrAtDxState)
functions.GEN_STRCAT(StateZip, untrimmedline.addrAtDxPostalCode, 5)
if (functions.GEN_RLOOKUP(StateZip, context.NAACCR_STATEZIP, context.NAACCR_STATEZIP_ST_ZIPLOW, ['STATE':state, 'ZIPLOW':ziplow, 'ZIPHIGH':ziphigh, 'ST_ZIPLOW':st_ziplow])) {
if (functions.GEN_STRCMP(untrimmedline.addrAtDxState, state) == 0 && functions.GEN_STRCMP(untrimmedline.addrAtDxPostalCode, ziplow, 5) >= 0 && functions.GEN_STRCMP(untrimmedline.addrAtDxPostalCode, ziphigh, 5) <= 0)
return true
else
return true
}
return true
}
// ID: NAACCR-00042; TAG: N0537; NAME: Addr at DX--Supplementl (NPCR)
public boolean naaccr00042(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.addrAtDxSupplementl)) {
return true
}
if (!functions.GEN_MATCH(untrimmedline.addrAtDxSupplementl, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
return false
}
char[] searchchar = new char[2]
int len
int idx
if (functions.GEN_EMPTY(untrimmedline.addrAtDxSupplementl))
return false
len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxSupplementl, ((Integer)context.NAACCR_GEN_RIGHT))))
idx = 1
while (idx < len) {
functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxSupplementl, idx, 1), 1)
if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
return false
idx = idx + 1
}
return true
}
// ID: NAACCR-00043; TAG: N0026; NAME: Age at Diagnosis (SEER AGEDX)
public boolean naaccr00043(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-120,999", "(\\d\\d\\d)")
}
// ID: NAACCR-00044; TAG: N0363; NAME: Age at Diagnosis, Text--Usual Industry (NAACCR)
public boolean naaccr00044(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int wrk_age, diag_age
int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 1996)
return true
if (functions.GEN_EMPTY(untrimmedline.ageAtDiagnosis)) {
birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
if (birth_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
if ((birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
wrk_age = 999
return true
}
else {
if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)))
wrk_age = dx_year - birth_year
else
wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
}
if (dx_month == birth_month) {
if ((dx_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY))) {
if (dx_day < birth_day)
wrk_age = (wrk_age - 1)
}
}
if (wrk_age == 999)
return true
}
else
wrk_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualIndustry))
return false
return true
}
// ID: NAACCR-00045; TAG: N0364; NAME: Age at Diagnosis, Text--Usual Occupation (NAACCR)
public boolean naaccr00045(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int wrk_age, diag_age
int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 1996)
return true
if (functions.GEN_EMPTY(untrimmedline.ageAtDiagnosis)) {
birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
if (birth_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
if ((birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
wrk_age = 999
return true
}
else {
if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)))
wrk_age = dx_year - birth_year
else
wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
}
if (dx_month == birth_month) {
if ((dx_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY))) {
if (dx_day < birth_day)
wrk_age = (wrk_age - 1)
}
}
if (wrk_age == 999)
return true
}
else
wrk_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualOccupation))
return false
return true
}
// ID: NAACCR-00046; TAG: N0025; NAME: Age, Birth Date, Date of Diagnosis (NAACCR IF13)
public boolean naaccr00046(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int wrk_age, diag_age
int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000")) {
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "2,3"))
return true
}
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
if (birth_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
diag_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (diag_age == 999) {
if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)))
return true
else
return false
}
if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
if (diag_age == 999)
return true
else
return false
}
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)))
wrk_age = dx_year - birth_year
else
wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY))) {
if (diag_age == wrk_age || diag_age == (wrk_age - 1))
return true
else
return false
}
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
if (dx_month == birth_month) {
if ((dx_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) || (birth_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY))) {
if (diag_age == wrk_age || diag_age == (wrk_age - 1))
return true
else
return false
}
else {
if (dx_day < birth_day)
wrk_age = (wrk_age - 1)
}
}
if (diag_age == wrk_age)
return true
else
return false
return true
}
// ID: NAACCR-00047; TAG: N0473; NAME: Age, Histologic Type, COD, ICDO3 (SEER IF43)
public boolean naaccr00047(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) == 9800 && functions.GEN_VAL(untrimmedline.ageAtDiagnosis) < 30 && functions.GEN_INLIST(untrimmedline.causeOfDeath, "2040,C910"))
return false
return true
}
// ID: NAACCR-00048; TAG: N0718; NAME: Age, Primary Site, Morph ICDO3--Adult (SEER)
public boolean naaccr00048(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1"))
return true
if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001) {
return true
}
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp < 15)
return true
if (agetemp < 20) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d3)")))
return false
}
if (agetemp < 30) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9732, 9823, 9863, 9875, 9876, 9945", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp < 40) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 5) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 14) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8960,9946", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 45) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
return true
}
// ID: NAACCR-00049; TAG: N0717; NAME: Age, Primary Site, Morph ICDO3--Pediatric (NPCR)
public boolean naaccr00049(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001)
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp > 14) {
return true
}
if (agetemp < 3) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
return false
}
if (agetemp > 9 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9490,9500"))
return false
}
if (agetemp > 5 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514"))
return false
}
if (agetemp > 8 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960,8964"))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8963") && functions.GEN_INLIST(untrimmedline.primarySite, "649,809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 9) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8231,8240,8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8312"))
return false
}
if (agetemp > 5 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8970"))
return false
}
if (agetemp < 9) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8140,8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8230,8231,8240,8241,8244-8246,8260-8263,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8160-8180"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9180-9200"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9220-9230"))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9231,9240") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 4) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9260") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419,809", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9363,9364") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp > 7 && agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9060-9102") && functions.GEN_INLIST(untrimmedline.primarySite, "000-559,570-619,630-699,739-750,754-809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 5) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8380,8381,8441-8473"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8500-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8330-8350"))
return false
}
if (agetemp < 6) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 5) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8090-8110,8140,8143,8147,8190,8200") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240,8246,8247,8260,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8390-8420,8430,8480,8542,8560,8570-8573,8940") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 5) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8082,8120-8155,8190-8263,8290,8310,8314-8323") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8430-8440,8480-8580,8940,8941") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
return false
}
if (agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9053"))
return false
}
if (agetemp < 15) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
return false
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9100") && functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209,210-218,239", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "240-249,250-259,384,500-509,559,540-549,609", "(C\\d\\d\\d)", 2, 3))
return false
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240-8245") && functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
return false
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8140") && functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
return false
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732,9823,9863,9875,9876,9945"))
return false
}
return true
}
// ID: NAACCR-00050; TAG: N0001; NAME: Age, Primary Site, Morphology ICDO2 (SEER IF15)
public boolean naaccr00050(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO2))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year > 2000)
return true
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3")) {
return true
}
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp < 15) {
if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(9100\\d)")))
return false
}
if (agetemp < 20) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "00000-82399,82450-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(\\d\\d\\d\\d3)")))
return false
}
if (agetemp < 30) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9732, 9863, 9868, 9890, 9823", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp < 40) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 5) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9510-9512", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 14) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "8960", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 45) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
return true
}
// ID: NAACCR-00051; TAG: N0449; NAME: Age, Primary Site, Morphology ICDO3 (SEER IF15)
public boolean naaccr00051(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int agetemp
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year > 2000)
return true
if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3"))
return true
if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
return true /* don't test further if age is unknown */
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
return true
agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
if (agetemp < 15) {
if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(9100\\d)")))
return false
}
if (agetemp < 20) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d3)")))
return false
}
if (agetemp < 30) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9732, 9823, 9863, 9875, 9876, 9945", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp < 40) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 5) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 14) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8960,9946", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
if (agetemp > 45) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
return false
}
return true
}
// ID: NAACCR-00052; TAG: N0902; NAME: Ambig Term DX, Date Conclusive DX (SEER IF162)
public boolean naaccr00052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx) || (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx) && functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag)))
return true
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0")) {
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11")) {
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "1")) {
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "15"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "15")) {
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "1"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "2")) {
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11,15"))
return false
else
return true
}
if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "9")) {
if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "10,12"))
return true
else
return false
}
return true
}
// ID: NAACCR-00053; TAG: N0741; NAME: Ambiguous Terminology DX (SEER)
public boolean naaccr00053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
return true
return functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0-2,9")
}
// ID: NAACCR-00054; TAG: N1381; NAME: Ambiguous Terminology DX, Date of DX (CCCR)
public boolean naaccr00054(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if ((dx_year > 2007) && (dx_year < 2013)) {
if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
return false
}
if (dx_year < 2008) {
if (!functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Ambiguous Terminology DX must be blank')
}
return true
}
// ID: NAACCR-00055; TAG: N0882; NAME: Ambiguous Terminology DX, Date of DX (SEER IF157)
public boolean naaccr00055(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if ((dx_year > 2006) && (dx_year < 2013)) {
if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
return false
}
if (dx_year < 2007) {
if (!functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Ambiguous Terminology DX must be blank')
}
return true
}
// ID: NAACCR-00056; TAG: N0524; NAME: Archive FIN (COC)
public boolean naaccr00056(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.archiveFin))
return true
if (functions.GEN_INLIST(untrimmedline.archiveFin, "0010,0020, 0006", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)", 1, 4))
return true
return false
}
// ID: NAACCR-00057; TAG: N0550; NAME: Archive FIN, Date of Diagnosis (COC)
public boolean naaccr00057(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 2002) {
if (functions.GEN_EMPTY(untrimmedline.archiveFin))
return false
}
return true
}
// ID: NAACCR-00058; TAG: N0831; NAME: Autopsy Only, RX (NPCR)
public boolean naaccr00058(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year, err_flag
err_flag = 0
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2006 || dx_year > 2017)
return true
if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
return true
}
if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98", "(\\d\\d)")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Prim Site')
err_flag = 1
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
err_flag = 1
}
}
else {
if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
err_flag = 1
}
}
if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,9")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Reason for No Surgery')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--BRM')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Chemo')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Hormone')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "0")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Other')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Transplnt/Endocr')
err_flag = 1
}
if (dx_year < 2018) {
if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Rad--Regional RX Modality')
err_flag = 1
}
}
if (dx_year == 2018) {
if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Phase I Radiation Treatment Modality')
err_flag = 1
}
}
if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg/Rad Seq')
err_flag = 1
}
if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0")) {
functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Systemic/Sur Seq')
err_flag = 1
}
if (err_flag == 1)
return false
return true
}
// ID: NAACCR-00059; TAG: N0624; NAME: Behav ICDO2, Date of DX, ICDO2 Conv Flag (SEER IF85)
public boolean naaccr00059(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year < 2001) {
if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
return false
}
if (dx_year > 2000) {
if (!functions.GEN_EMPTY(untrimmedline.behaviorIcdO2)) {
if (!functions.GEN_INLIST(untrimmedline.icdO2ConversionFlag, "0,5,6"))
return false
}
}
return true
}
// ID: NAACCR-00060; TAG: N0626; NAME: Behav ICDO3, Date of DX, ICDO3 Conv Flag (SEER IF87)
public boolean naaccr00060(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) {
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return false
}
if (dx_year < 2001) {
if (!functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3)) {
if (!functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "1,3"))
return false
}
}
return true
}
// ID: NAACCR-00061; TAG: N0638; NAME: Behavior (73-91) ICD-O-1 (SEER)
public boolean naaccr00061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO1))
return true
return functions.GEN_INLIST(untrimmedline.behaviorIcdO1, "0-3")
}
// ID: NAACCR-00062; TAG: N0331; NAME: Behavior Code ICDO2, Sequence Number--Hosp (COC)
public boolean naaccr00062(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) && (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8931,9393,9538,9950,9960-9962,9980-9984,9989")))
return true
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88", "(\\d\\d)"))
return true
else
return false
}
return true
}
// ID: NAACCR-00063; TAG: N0653; NAME: Behavior Code ICDO3, Seq Num--Central (SEER IF114)
public boolean naaccr00063(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1"))
return true
}
}
if (dx_year > 2000) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
return false
}
}
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,98,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
return true
else
return false
}
if (dx_year > 2000) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-00064; TAG: N0470; NAME: Behavior Code ICDO3, Sequence Number--Hosp (COC)
public boolean naaccr00064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_EMPTY(untrimmedline.sequenceNumberHospital))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001 && (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8931,9393,9538,9950,9960-9962,9980-9984,9989")))
return true
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88", "(\\d\\d)"))
return true
else
return false
}
if ((dx_year > 2003) && (dx_year != ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-00065; TAG: N0238; NAME: Behavior ICDO2 (COC)
public boolean naaccr00065(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
return true
return functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,2,3")
}
// ID: NAACCR-00066; TAG: N0737; NAME: Behavior ICDO2, Behavior ICDO3 (SEER IF115)
public boolean naaccr00066(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
return false
}
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
return false
}
return true
}
// ID: NAACCR-00067; TAG: N0468; NAME: Behavior ICDO2, Date of Diagnosis (NAACCR)
public boolean naaccr00067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year < 2001) {
if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
return false
}
return true
}
// ID: NAACCR-00068; TAG: N0492; NAME: Behavior ICDO2, Histology ICDO2 (NAACCR)
public boolean naaccr00068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "1")) {
if (((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8931,9393,9538,9950,9960-9962,9980-9984,9989"))
return true
else
return false
}
return true
}
// ID: NAACCR-00069; TAG: N0365; NAME: Behavior ICDO2, Summary Stage 1977 (NAACCR)
public boolean naaccr00069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-00070; TAG: N0469; NAME: Behavior ICDO3 (COC)
public boolean naaccr00070(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
return functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,2,3")
}
// ID: NAACCR-00071; TAG: N0837; NAME: Behavior ICDO3 Conversion (NAACCR)
public boolean naaccr00071(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0-3")
}
// ID: NAACCR-00072; TAG: N0467; NAME: Behavior ICDO3, Date of Diagnosis (NAACCR)
public boolean naaccr00072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (dx_year > 2000) {
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return false
}
return true
}
// ID: NAACCR-00073; TAG: N0654; NAME: Behavior ICDO3, Site, Histology ICDO3 (NAACCR)
public boolean naaccr00073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
if (dx_year > 2003 && functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3))
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1")) {
if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473"))
return true
}
return false
}
// ID: NAACCR-00074; TAG: N0838; NAME: Behavior ICDO3, Summary Stage 1977 (NAACCR)
public boolean naaccr00074(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-00075; TAG: N0439; NAME: Behavior ICDO3, Summary Stage 2000 (NAACCR)
public boolean naaccr00075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-00076; TAG: N0002; NAME: Birthplace (SEER POB)
public boolean naaccr00076(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.birthplace))
return true
return functions.GEN_ILOOKUP(untrimmedline.birthplace, context.NAACCR_BPLACE, context.NAACCR_BPLACE_CODE, [:])
}
// ID: NAACCR-00077; TAG: N1673; NAME: Birthplace--Geocode, Country, State (NAACCR)
public boolean naaccr00077(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] bplace_cntry_state = new char[9]
if (functions.GEN_EMPTY(untrimmedline.birthplace) || functions.GEN_EMPTY(untrimmedline.birthplaceCountry) || functions.GEN_EMPTY(untrimmedline.birthplaceState))
return true
functions.GEN_STRCPY(bplace_cntry_state, untrimmedline.birthplace)
functions.GEN_STRCAT(bplace_cntry_state, untrimmedline.birthplaceCountry)
functions.GEN_STRCAT(bplace_cntry_state, untrimmedline.birthplaceState)
if (!functions.GEN_LOOKUP(bplace_cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_GEOCNTRYST, [:]))
return false
return true
}
// ID: NAACCR-00078; TAG: N1688; NAME: Birthplace--Country (COC)
public boolean naaccr00078(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry))
return true
if (!functions.GEN_LOOKUP(untrimmedline.birthplaceCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00079; TAG: N1668; NAME: Birthplace--Country (NAACCR)
public boolean naaccr00079(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_LOOKUP(untrimmedline.birthplaceCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
return false
return true
}
// ID: NAACCR-00080; TAG: N1689; NAME: Birthplace--Country, Date of Diagnosis (COC)
public boolean naaccr00080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year > 2002) {
if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry))
return false
}
functions.GEN_ERROR_MSG(binding, 'Birthplace--Country cannot be ${untrimmedline.birthplaceCountry} if Date of Diagnosis is greater than 2012')
return true
}
// ID: NAACCR-00081; TAG: N1690; NAME: Birthplace--Country, Date of Diagnosis (NAACCR)
public boolean naaccr00081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry))
return true
if (dx_year > 2012) {
if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
return false
if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
return false
if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
return false
}
return true
}
// ID: NAACCR-00082; TAG: N1672; NAME: Birthplace--Country, Birthplace--State (NAACCR)
public boolean naaccr00082(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] cntry_state = new char[6]
if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry) || functions.GEN_EMPTY(untrimmedline.birthplaceState))
return true
if (functions.GEN_INLIST(untrimmedline.birthplaceState, "XX") && functions.GEN_INLIST(untrimmedline.birthplaceCountry, "ZZX"))
return false
functions.GEN_STRCPY(cntry_state, untrimmedline.birthplaceCountry)
functions.GEN_STRCAT(cntry_state, untrimmedline.birthplaceState)
if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
return false
return true
}
// ID: NAACCR-00083; TAG: N1694; NAME: Birthplace--State (COC)
public boolean naaccr00083(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.birthplaceState))
return true
if (!functions.GEN_LOOKUP(untrimmedline.birthplaceState, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_STATE, [:]))
return false
return true
}
// ID: NAACCR-00084; TAG: N1671; NAME: Birthplace--State (NAACCR)
public boolean naaccr00084(Binding binding, Map