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.NaaccrTranslatedCompiledRules6.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 NaaccrTranslatedCompiledRules6 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-01413' <= id && id <= 'NAACCR-01713'
}
// ID: NAACCR-01413; TAG: N0039; NAME: TNM Path Stage Group (COC)
public boolean naaccr01413(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 > 2015)
return true
if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
return true
if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0-4", "(\\d\\s\\s\\s)"))
return true
if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0A,0S,1A,A1,A2,1B,B1,B2,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
return true
if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "1E,1S,2E,2S,3E,3S,4E,4S", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
return true
if (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
return true
return false
}
// ID: NAACCR-01414; TAG: N0862; NAME: TNM Path Stage Group, TNM Items, ICDO3 (COC)
public boolean naaccr01414(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9667,9670-9729"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
return functions.GEN_ERROR_MSG(binding, 'If TNM Path Stage Group not = 88, then TNM Path T and M must not = 88')
}
}
else {
if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
return false
}
}
return true
}
// ID: NAACCR-01415; TAG: N0929; NAME: TNM Path Stage Group, TNM Items, ICDO3 (NAACCR)
public boolean naaccr01415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06") || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9667,9670-9729"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
return functions.GEN_ERROR_MSG(binding, 'If TNM Path Stage Group not = 88, then TNM Path T and M must not = 88')
}
}
else {
if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88") || functions.GEN_INLIST(untrimmedline.tnmPathM, "88") || functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
return false
}
}
return true
}
// ID: NAACCR-01416; TAG: N0927; NAME: TNM Path Staged By (COC)
public boolean naaccr01416(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
return true
return functions.GEN_INLIST(untrimmedline.tnmPathStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")
}
// ID: NAACCR-01417; TAG: N0146; NAME: TNM Path Staged By (NAACCR)
public boolean naaccr01417(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
return true
return functions.GEN_INLIST(untrimmedline.tnmPathStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")
}
// ID: NAACCR-01418; TAG: N0928; NAME: TNM Path Staged By, Date of Diagnosis (COC)
public boolean naaccr01418(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 2008) {
if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
return false
}
if (dx_year > 2015 && dx_year < 2018) {
if (functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy))
return false
}
return true
}
// ID: NAACCR-01420; TAG: N0173; NAME: Telephone (SEER)
public boolean naaccr01420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_MATCH(untrimmedline.telephone, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
return false
}
// ID: NAACCR-01421; TAG: N0402; NAME: Text--Dx Proc--Path, Diagnostic Confirm (NAACCR)
public boolean naaccr01421(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,3,4")) {
if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.textDxProcPath, 1, 79)))
return false
}
return true
}
// ID: NAACCR-01422; TAG: N0403; NAME: Text--Histology Title (NAACCR)
public boolean naaccr01422(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.textHistologyTitle))
return false
return true
}
// ID: NAACCR-01423; TAG: N0404; NAME: Text--Primary Site Title (NAACCR)
public boolean naaccr01423(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.textPrimarySiteTitle))
return false
return true
}
// ID: NAACCR-01424; TAG: N0015; NAME: Tumor Marker 1 (SEER TUMMARK1)
public boolean naaccr01424(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.tumorMarker1))
return true
return functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6,8,9")
}
// ID: NAACCR-01425; TAG: N0028; NAME: Tumor Marker 1, Date of Diagnosis (SEER IF65)
public boolean naaccr01425(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 >= 1996 && dx_year <= 2003) {
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001561", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
}
if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year < 2004 && functions.GEN_INLIST(untrimmedline.registryId, "0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
return true
}
if (dx_year < 1990) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") || functions.GEN_EMPTY(untrimmedline.tumorMarker1))
return true
else
return false
}
if (dx_year < 1998) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9"))
return false
}
if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") && !functions.GEN_EMPTY(untrimmedline.tumorMarker1))
return false
}
}
if (dx_year < 2004) {
if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9")) || (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3,8-9")) || (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "0,2,4-6,8-9")))
return false
if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 619, 620-629", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker1, "9") && !functions.GEN_EMPTY(untrimmedline.tumorMarker1))
return false
}
}
if (dx_year > 2003) {
if (!functions.GEN_EMPTY(untrimmedline.tumorMarker1))
return false
}
return true
}
// ID: NAACCR-01426; TAG: N0191; NAME: Tumor Marker 1, Primary Site, Morph ICDO2 (COC)
public boolean naaccr01426(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 1998)
return true
if (functions.GEN_EMPTY(untrimmedline.tumorMarker1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO2))
return true
if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180-189,199,209,220,221,569,619", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "95003")) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3, 8,9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6, 8, 9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-01427; TAG: N0477; NAME: Tumor Marker 1, Primary Site, Morph ICDO3 (COC)
public boolean naaccr01427(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 1998)
return true
if (functions.GEN_EMPTY(untrimmedline.tumorMarker1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
return true
if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509,180-189,199,209,220,221,569,619", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "95003")) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-3, 8,9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "0-6, 8, 9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-01428; TAG: N0029; NAME: Tumor Marker 1, Type of Report Srce (SEER IF67)
public boolean naaccr01428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 2004) {
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001561,0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
}
if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year > 2003) {
return true
}
if ((dx_year >= 1990 && functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) || (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "619-629", "(C\\d\\d\\d)", 2, 3))) {
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "0"))
return false
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker1, "9"))
return false
}
return true
}
// ID: NAACCR-01429; TAG: N0016; NAME: Tumor Marker 2 (SEER TUMMARK2)
public boolean naaccr01429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.tumorMarker2))
return true
return functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-6,8,9")
}
// ID: NAACCR-01430; TAG: N0030; NAME: Tumor Marker 2, Date of Diagnosis (SEER IF66)
public boolean naaccr01430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544"))
return true
if (dx_year < 2004) {
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001561,0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
return true
}
}
if (dx_year < 1990) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") || functions.GEN_EMPTY(untrimmedline.tumorMarker2))
return true
else
return false
}
if (dx_year < 1998) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9"))
return false
}
if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") && !functions.GEN_EMPTY(untrimmedline.tumorMarker2))
return false
}
}
if (dx_year < 2004) {
if ((functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9")) || (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8-9")) || (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "0,2,4-6,8-9")))
return false
if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 619, 620-629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9") && !functions.GEN_EMPTY(untrimmedline.tumorMarker2))
return false
}
}
if (dx_year > 2003) {
if (!functions.GEN_EMPTY(untrimmedline.tumorMarker2))
return false
}
return true
}
// ID: NAACCR-01431; TAG: N0192; NAME: Tumor Marker 2, Primary Site (COC)
public boolean naaccr01431(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 1998)
return true
if (functions.GEN_EMPTY(untrimmedline.tumorMarker2) || functions.GEN_EMPTY(untrimmedline.primarySite))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,619", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-3,8,9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "0-6,8,9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.tumorMarker2, "9"))
return true
else
return false
}
}
return true
}
// ID: NAACCR-01432; TAG: N0031; NAME: Tumor Marker 2, Type of Report Srce (SEER IF68)
public boolean naaccr01432(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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, "0000001561,0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year > 2003) {
return true
}
if ((dx_year >= 1990 && functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) || (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "619-629", "(C\\d\\d\\d)", 2, 3))) {
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "0"))
return false
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker2, "9"))
return false
}
return true
}
// ID: NAACCR-01433; TAG: N0288; NAME: Tumor Marker 3 (SEER TUMMARK3)
public boolean naaccr01433(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.tumorMarker3))
return true
return functions.GEN_INLIST(untrimmedline.tumorMarker3, "0-6,8,9")
}
// ID: NAACCR-01434; TAG: N0289; NAME: Tumor Marker 3, Date of Diagnosis (SEER IF73)
public boolean naaccr01434(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544"))
return true
if (dx_year < 2004 && functions.GEN_INLIST(untrimmedline.registryId, "0000001561, 0000001562, 0000001563")) {
return true
}
if (dx_year < 1998) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "9") || functions.GEN_EMPTY(untrimmedline.tumorMarker3))
return true
else
return false
}
if (dx_year < 2004) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3) == true) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker3, "0,2,4-6,8-9"))
return false
}
if (!functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.tumorMarker3, "9") && !functions.GEN_EMPTY(untrimmedline.tumorMarker3))
return false
}
}
if (dx_year > 2003) {
if (!functions.GEN_EMPTY(untrimmedline.tumorMarker3))
return false
}
return true
}
// ID: NAACCR-01435; TAG: N0264; NAME: Tumor Marker 3, Primary Site (COC)
public boolean naaccr01435(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 1998)
return true
if (functions.GEN_EMPTY(untrimmedline.tumorMarker3) || functions.GEN_EMPTY(untrimmedline.primarySite))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "620,621,629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "0-6,8,9"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.tumorMarker3, "9"))
return true
else
return false
}
return true
}
// ID: NAACCR-01436; TAG: N0290; NAME: Tumor Marker 3, Type of Report Srce (SEER IF74)
public boolean naaccr01436(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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, "0000001561,0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year < 2000 && functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year > 2003) {
return true
}
if (dx_year >= 1998 && functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_INLIST(untrimmedline.tumorMarker3, "0"))
return false
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && !functions.GEN_INLIST(untrimmedline.tumorMarker3, "9"))
return false
}
return true
}
// ID: NAACCR-01437; TAG: N0087; NAME: Tumor Record Number (NAACCR)
public boolean naaccr01437(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.tumorRecordNumber, "01-99", "(\\d\\d)")
}
// ID: NAACCR-01438; TAG: N0457; NAME: Type of Rep Srce(DC),Seq Num--Cent,ICDO3 (SEER IF04)
public boolean naaccr01438(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.overRideReportSource, "1")) {
return true
}
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9589", "(\\d\\d\\d\\d)"))) {
if (!functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00,60"))
return false
}
return true
}
// ID: NAACCR-01439; TAG: N0017; NAME: Type of Report Srce (AO), Date of Dx (SEER IF02)
public boolean naaccr01439(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year, dx_month, dolc_year, dolc_month
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.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')
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
if (dolc_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dolc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
dolc_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfLastContact)
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
if (dx_year == dolc_year) {
if (dx_month == dolc_month)
return true
else
return false
}
else
return false
}
return true
}
// ID: NAACCR-01440; TAG: N0089; NAME: Type of Report Srce (DC/AO), SEER Fup (SEER IF10)
public boolean naaccr01440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (!functions.GEN_INLIST(untrimmedline.seerTypeOfFollowUp, "1"))
return false
}
if (functions.GEN_INLIST(untrimmedline.seerTypeOfFollowUp, "1")) {
if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
return false
}
return true
}
// ID: NAACCR-01441; TAG: N0306; NAME: Type of Report Srce(DC), EOD Coding Sys (SEER IF11)
public boolean naaccr01441(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
return true
}
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && (dx_year < 1983)) {
if (!functions.GEN_INLIST(untrimmedline.codingSystemForEod, "0"))
return false
}
return true
}
// ID: NAACCR-01442; TAG: N0094; NAME: Type of Report Srce(DC/AO), COD (SEER IF09)
public boolean naaccr01442(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000")) {
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
return false
}
if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "7777")) {
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return false
}
return true
}
// ID: NAACCR-01443; TAG: N0018; NAME: Type of Report Srce(DC/AO), Diag Conf (SEER IF05)
public boolean naaccr01443(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,6"))
return false
}
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "9"))
return false
}
return true
}
// ID: NAACCR-01444; TAG: N0405; NAME: Type of Report Srce(DC/AO), Vit Stat (COC)
public boolean naaccr01444(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
return functions.GEN_ERROR_TEXT(binding, 'If Type of Reporting Source = 6 or 7, Vital Status must = 0 ')
}
}
return true
}
// ID: NAACCR-01445; TAG: N0307; NAME: Type of Report Srce(DC/AO), Vital Stat (SEER IF08)
public boolean naaccr01445(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
return false
}
return true
}
// ID: NAACCR-01446; TAG: N0315; NAME: Type of Report Srce, Diagnostic Proc (SEER IF20)
public boolean naaccr01446(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
}
if (dx_year > 1987) {
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return true
else
return false
}
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return true
else
return false
}
if (dx_year < 1983) {
if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 2) {
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return false
else {
if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9714") && functions.GEN_MATCH(untrimmedline.primarySite, "(C77[0-9])|(C024)|(C09[8-9])|(C111)|(C142)|(C379)|(C422)")) {
if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,31,32,40-45"))
return true
else
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,40,50,60,70,80,90,91"))
return true
else
return false
}
}
}
else {
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return true
else
return false
}
}
else {
if (dx_year > 1982 && dx_year < 1988 && functions.GEN_INLIST(untrimmedline.registryId, "0000001529"))
return true
}
if (dx_year > 1982 && dx_year < 1988) {
if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9667,9670-9698,9702-9714,9740-9741")) {
if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30-32,40-45"))
return true
else
return false
}
else {
if ((functions.GEN_MATCH(untrimmedline.primarySite, "(C44[0-9])") && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790")) || functions.GEN_MATCH(untrimmedline.primarySite, "(C16[0-9])|(C18[0-9])|(C199)|(C209)|(C34[0-9])|(C50[0-9])|(C53[0-9])|(C54[0-9])|(C619)|(C67[0-9])")) {
if (functions.GEN_INLIST(untrimmedline.diagnosticProc7387, "00,10,20,30,40,50,60,70,80,90,91"))
return true
else
return false
}
}
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return true
else
return false
}
else {
if (functions.GEN_EMPTY(untrimmedline.diagnosticProc7387))
return true
else
return false
}
return true
}
// ID: NAACCR-01447; TAG: N0019; NAME: Type of Reporting Source (SEER RPRTSRC)
public boolean naaccr01447(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1-8")
}
// ID: NAACCR-01448; TAG: N0792; NAME: Type of Reporting Source, Date of DX (SEER IF152)
public boolean naaccr01448(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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_EMPTY(untrimmedline.typeOfReportingSource))
return true
if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
return true
if (dx_year > 2005)
return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1-8")
return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1,3-7")
}
// ID: NAACCR-01449; TAG: N0842; NAME: Unknown Site, Hist ICDO3, Summ Stg 1977 (NAACCR)
public boolean naaccr01449(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9590-9699,9702-9729,9731-9989"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
return true
else
return false
}
return true
}
// ID: NAACCR-01450; TAG: N0407; NAME: Unknown Site, Laterality (SEER IF138)
public boolean naaccr01450(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
if (functions.GEN_INLIST(untrimmedline.laterality, "0"))
return true
else
return false
}
return true
}
// ID: NAACCR-01451; TAG: N0408; NAME: Unknown Site, Summary Stage 1977, ICDO2 (NAACCR)
public boolean naaccr01451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year > 2000)
return true
if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140,9590-9698,9702-9717,9720-9989"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
return true
else
return false
}
return true
}
// ID: NAACCR-01452; TAG: N0495; NAME: Verify ICDO2 to ICDO3 Conversion (NAACCR)
public boolean naaccr01452(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] W_HIST2 = new char[5], W_BEH2 = new char[2], W_MORPH2 = new char[6], W_SITE = new char[5]
char[] W_MORPH2_SITE = new char[12]
char[] W_HIST2_SITE = new char[11]
char[] W_HIST3 = new char[5], W_BEH3 = new char[2], W_MORPH3 = new char[6]
char[] T_HIST3 = new char[5], T_MORPH3 = new char[6]
char[] ICDO3_HIST = new char[5], ICDO3_BEH = new char[2]
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.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) || functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO2) || functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3) || functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "3,4"))
return true
if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2)) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "85103")) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "85103, 85133"))
return true
}
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2)) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "85102")) {
if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "85102, 85132")) {
return true
}
}
}
functions.GEN_STRCPY(W_MORPH2, untrimmedline.morphTypebehavIcdO2, 5)
functions.GEN_STRCPY(W_HIST2, untrimmedline.morphTypebehavIcdO2, 4)
functions.GEN_STRCPY(W_BEH2, functions.GEN_SUBSTR(untrimmedline.morphTypebehavIcdO2, 5, 1))
functions.GEN_STRCPY(W_MORPH3, untrimmedline.morphTypebehavIcdO3, 5)
functions.GEN_STRCPY(W_HIST3, untrimmedline.morphTypebehavIcdO3, 4)
functions.GEN_STRCPY(W_BEH3, functions.GEN_SUBSTR(untrimmedline.morphTypebehavIcdO3, 5, 1))
functions.GEN_STRCPY(W_SITE, " ")
if (functions.GEN_INLIST(W_HIST2, "8510")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "73", "(C\\d\\d\\d)", 2, 2))
functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
}
else {
if (functions.GEN_INLIST(W_MORPH2, "89300")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "15-21,26,54,64", "(C\\d\\d\\d)", 2, 2))
functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
}
else {
if (functions.GEN_INLIST(W_HIST2, "8930,8930")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "15-21,26,54", "(C\\d\\d\\d)", 2, 2))
functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
}
else {
if (functions.GEN_INLIST(W_HIST2, "9731")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "40,41", "(C\\d\\d\\d)", 2, 2))
functions.GEN_STRCPY(W_SITE, untrimmedline.primarySite, 3)
}
}
}
}
functions.GEN_STRCPY(W_MORPH2_SITE, W_MORPH2)
functions.GEN_STRCAT(W_MORPH2_SITE, W_SITE)
if (functions.GEN_LOOKUP(W_MORPH2_SITE, context.NAACCR_CONV2TO3, context.NAACCR_CONV2TO3_MORPH2SITE, ['ICDO3_HIST':ICDO3_HIST, 'ICDO3_BEH':ICDO3_BEH])) {
functions.GEN_STRCPY(T_MORPH3, ICDO3_HIST)
functions.GEN_STRCAT(T_MORPH3, ICDO3_BEH) /* check that ICDO3 code matches converted value per table */
if (functions.GEN_VAL(W_MORPH3) != functions.GEN_VAL(T_MORPH3)) {
functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-3 not found in conversion table')
return true
}
else
return true
}
if (functions.GEN_VAL(W_BEH2) != functions.GEN_VAL(W_BEH3)) {
functions.GEN_SET_WARNING(binding, 'Conflict between ICD-O-2 Behavior and ICD-O-3 Behavior')
return true
}
functions.GEN_STRCPY(W_HIST2_SITE, W_HIST2)
functions.GEN_STRCAT(W_HIST2_SITE, W_SITE) /* if ICDO2 hist/site not found set warning */
if (!functions.GEN_LOOKUP(W_HIST2_SITE, context.NAACCR_CONV2TO3, context.NAACCR_CONV2TO3_HIST2SITE, ['ICDO3_HIST':ICDO3_HIST, 'ICDO3_BEH':ICDO3_BEH])) {
functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-2 not found in conversion table')
return true
}
else {
functions.GEN_STRCPY(T_HIST3, ICDO3_HIST)
if (functions.GEN_VAL(W_HIST3) != functions.GEN_VAL(T_HIST3)) {
functions.GEN_SET_WARNING(binding, 'Morph--Type&Behav ICD-O-3 not found in conversion table')
return true
}
}
return true
}
// ID: NAACCR-01453; TAG: N0090; NAME: Vital Status (COC)
public boolean naaccr01453(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
return functions.GEN_INLIST(untrimmedline.vitalStatus, "0,1")
}
// ID: NAACCR-01456; TAG: N0250; NAME: Vital Status, Cause of Death (SEER IF36)
public boolean naaccr01456(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int cod_num
if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
if (!functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
return false
}
if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
return false
}
return true
}
// ID: NAACCR-01457; TAG: N1950; NAME: CS Lymph Nodes Eval, Nodes Ex (CS)
public boolean naaccr01457(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
char[] CS_code = new char[4]
int t_schema_number, t_max_schemas, t_result
if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
return true
functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
if (t_schema_number < 0)
return true
if (t_schema_number > t_max_schemas) {
return true
}
functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
return true
}
if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,GISTAppendix,GISTColon") || functions.GEN_INLIST(t_schema_name, "GISTRectum,LymphomaOcularAdnexa,MelanomaSkin,MerkelCellSkin") || functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellVulva,MerkelCellScrotum,NetColon") || functions.GEN_INLIST(t_schema_name, "NETRectum,Rectum,Retinoblastoma"))
return true
if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "3,5,6"))
return true
if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00"))
return false
return true
}
// ID: NAACCR-01458; TAG: N1938; NAME: Census Tract 2000, State, County, 2000-2009 (NPCR)
public boolean naaccr01458(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] state_cnty_tract = new char[12]
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)))
return true
if ((dx_year < 2000) || (dx_year > 2009))
return true
if (functions.GEN_EMPTY(untrimmedline.censusTract2000) || functions.GEN_INLIST(untrimmedline.censusTract2000, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addrAtDxState) || functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_INLIST(untrimmedline.countyAtDx, "998,999"))
return true
functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addrAtDxState)
functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyAtDx)
functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2000)
if (!functions.GEN_LOOKUP(state_cnty_tract, context.NAACCR_TRAC2000, context.NAACCR_TRAC2000_STCNTYTRAC, [:]))
return false
return true
}
// ID: NAACCR-01459; TAG: N1937; NAME: Census Tract 2010, State, County, 2010-2019 (NPCR)
public boolean naaccr01459(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] state_cnty_tract = new char[12]
int dx_year
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)))
return true
if ((dx_year < 2010) || (dx_year > 2019))
return true
if (functions.GEN_EMPTY(untrimmedline.censusTract2010) || functions.GEN_INLIST(untrimmedline.censusTract2010, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addrAtDxState) || functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_INLIST(untrimmedline.countyAtDx, "998,999"))
return true
functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addrAtDxState)
functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyAtDx)
functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2010)
if (!functions.GEN_LOOKUP(state_cnty_tract, context.NAACCR_TRAC2010, context.NAACCR_TRAC2010_STCNTYTRAC, [:]))
return false
return true
}
// ID: NAACCR-01460; TAG: N1959; NAME: Grade (CCCR)
public boolean naaccr01460(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.grade))
return true
if (functions.GEN_INLIST(untrimmedline.grade, "1-9"))
return true
return false
}
// ID: NAACCR-01461; TAG: N1957; NAME: Lymphovascular Invasion, Histology, Behav (COC)
public boolean naaccr01461(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year > 2017)
return true
if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
return false
else
return true
}
else {
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,2")) {
if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "1"))
return functions.GEN_ERROR_MSG(binding, 'If Behavior Code ICD-O-3 = ${untrimmedline.behaviorCodeIcdO3}, Lymphovascular Invasion must not = 1')
else
return true
}
else {
if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
return functions.GEN_ERROR_MSG(binding, 'If Histologic Type ICD-O-3 not = 9590-9992, Lymphovascular Invasion must not = 8')
}
}
return true
}
// ID: NAACCR-01462; TAG: N1958; NAME: Lymphovascular Invasion, Histology, Behav (CS)
public boolean naaccr01462(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year > 2017)
return true
if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
return true
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
if (!functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8"))
return false
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,2")) {
if (functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "1"))
return functions.GEN_ERROR_MSG(binding, 'If Behavior Code ICD-O-3 = ${untrimmedline.behaviorCodeIcdO3}, Lymphovascular Invasion must not = 1')
}
return true
}
// ID: NAACCR-01463; TAG: N1976; NAME: EDP MDE Link (NPCR)
public boolean naaccr01463(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.edpMdeLink))
return true
return functions.GEN_INLIST(untrimmedline.edpMdeLink, "0,1")
}
// ID: NAACCR-01464; TAG: N1975; NAME: EDP MDE Link Date (NPCR)
public boolean naaccr01464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return true
if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.edpMdeLinkDate))
return true
else {
functions.GEN_ERROR_TEXT(binding, 'EDP MDE Link Date: %DC')
return false
}
return true
}
// ID: NAACCR-01465; TAG: N1977; NAME: EDP MDE Link, Date, Primary Site (NPCR)
public boolean naaccr01465(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509,530-539,180-209,260", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.edpMdeLink, "1")) {
if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return functions.GEN_ERROR_MSG(binding, 'If MDELink = 1, then MDEDate must not be blank')
}
if (functions.GEN_INLIST(untrimmedline.edpMdeLink, "0") || functions.GEN_EMPTY(untrimmedline.edpMdeLink)) {
if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return functions.GEN_ERROR_MSG(binding, 'If MDELink = 0 or blank, then MDEDate must be blank')
}
}
if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509,530-539,180-209,260", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_EMPTY(untrimmedline.edpMdeLink))
return false
if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return false
}
return true
}
// ID: NAACCR-01466; TAG: N1978; NAME: EDP MDE Link, EDP MDE Link Date (NPCR)
public boolean naaccr01466(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_INLIST(untrimmedline.edpMdeLink, "1")) {
if (functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return functions.GEN_ERROR_MSG(binding, 'If MDELink = 1, then MDEDate must not be blank')
}
if (functions.GEN_INLIST(untrimmedline.edpMdeLink, "0") || functions.GEN_EMPTY(untrimmedline.edpMdeLink)) {
if (!functions.GEN_EMPTY(untrimmedline.edpMdeLinkDate))
return functions.GEN_ERROR_MSG(binding, 'If MDELink = 0 or blank, then MDEDate must be blank')
}
return true
}
// ID: NAACCR-01467; TAG: N2298; NAME: Primary Site, AJCC M - Ed 7, ICDO3 (SEER)
public boolean naaccr01467(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
int req_flag
int dx_year
char[] t_GrpMCode = new char[12]
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] GrpHist = new char[7]
char[] t_SiteHist = new char[9]
char[] Site_HistLo = new char[20]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year < 2015 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
return true
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
return true
if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinM)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathM)))
return true
else
return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
}
if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
return true
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
functions.GEN_STRCPY(Site_HistLo, SITELOW)
functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
functions.GEN_STRCPY(SiteGrp, GPCODE)
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else {
functions.GEN_STRCPY(SiteGrp, "999")
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
functions.GEN_STRCPY(SiteGrp, "57A")
else {
if (functions.GEN_INLIST(SiteGrp, "04C")) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "04D")
else {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "008")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
functions.GEN_STRCPY(SiteGrp, "08A")
else {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
functions.GEN_STRCPY(SiteGrp, "08B")
else
functions.GEN_STRCPY(SiteGrp, "08C")
}
}
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "08D")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
functions.GEN_STRCPY(SiteGrp, "08D")
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "011")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "10B")
}
else {
if (functions.GEN_INLIST(SiteGrp, "16B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
functions.GEN_STRCPY(SiteGrp, "16A")
}
else {
if (functions.GEN_INLIST(SiteGrp, "021")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
functions.GEN_STRCPY(SiteGrp, "020")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
functions.GEN_STRCPY(SiteGrp, "022")
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "37B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "051")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "51B")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "053")) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
}
}
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "999")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
functions.GEN_STRCPY(SiteGrp, "028")
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
return true
}
if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinM, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpMCode, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
else
functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmClinM)
if (!functions.GEN_LOOKUP(t_GrpMCode, context.NAACCR_AJC7MC, context.NAACCR_AJC7MC_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
}
}
if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
return true
functions.GEN_STRCPY(t_GrpMCode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathM, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpMCode, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
else
functions.GEN_STRCAT(t_GrpMCode, untrimmedline.tnmPathM)
if (!functions.GEN_LOOKUP(t_GrpMCode, context.NAACCR_AJC7MP, context.NAACCR_AJC7MP_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
}
return true
}
// ID: NAACCR-01468; TAG: N2420; NAME: Primary Site, AJCC N - Ed 7, ICDO3 (SEER)
public boolean naaccr01468(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
int req_flag
int dx_year
char[] t_GrpNcode = new char[12]
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] GrpHist = new char[7]
char[] t_SiteHist = new char[9]
char[] Site_HistLo = new char[20]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year < 2015 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
return true
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
return true
if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinN)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathN)))
return true
else
return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
}
if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
return true
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
functions.GEN_STRCPY(Site_HistLo, SITELOW)
functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
functions.GEN_STRCPY(SiteGrp, GPCODE)
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else {
functions.GEN_STRCPY(SiteGrp, "999")
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
functions.GEN_STRCPY(SiteGrp, "57A")
else {
if (functions.GEN_INLIST(SiteGrp, "04C")) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "04D")
else {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "008")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
functions.GEN_STRCPY(SiteGrp, "08A")
else {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
functions.GEN_STRCPY(SiteGrp, "08B")
else
functions.GEN_STRCPY(SiteGrp, "08C")
}
}
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "08D")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
functions.GEN_STRCPY(SiteGrp, "08D")
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "011")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "10B")
}
else {
if (functions.GEN_INLIST(SiteGrp, "16B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
functions.GEN_STRCPY(SiteGrp, "16A")
}
else {
if (functions.GEN_INLIST(SiteGrp, "021")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
functions.GEN_STRCPY(SiteGrp, "020")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
functions.GEN_STRCPY(SiteGrp, "022")
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "37B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "051")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "51B")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "053")) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
}
}
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "999")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
}
}
}
if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
return true
}
if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinN, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
else
functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NCS, context.NAACCR_AJC7NCS_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
}
}
if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
return true
functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathN, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpNcode, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
else
functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NPS, context.NAACCR_AJC7NPS_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
}
return true
}
// ID: NAACCR-01469; TAG: N2300; NAME: Primary Site, AJCC Stage Group - Ed 7, ICDO3 (SEER)
public boolean naaccr01469(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPSTAGE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
int req_flag
int dx_year
char[] GrpStg = new char[12]
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] GrpHist = new char[7]
char[] t_SiteHist = new char[9]
char[] Site_HistLo = new char[20]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year < 2015 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
return true
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
return true
if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
return true
if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
if (functions.GEN_VAL(untrimmedline.ageAtDiagnosis) > 24)
return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
}
if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
return true
else
return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
}
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
functions.GEN_STRCPY(Site_HistLo, SITELOW)
functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
functions.GEN_STRCPY(SiteGrp, GPCODE)
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
functions.GEN_STRCPY(SiteGrp, "57A")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "420-421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9811-9818, 9837"))
functions.GEN_STRCPY(SiteGrp, "57C")
else {
if (functions.GEN_INLIST(SiteGrp, "04C")) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "04D")
else {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "008")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
functions.GEN_STRCPY(SiteGrp, "08A")
else {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
functions.GEN_STRCPY(SiteGrp, "08B")
else
functions.GEN_STRCPY(SiteGrp, "08C")
}
}
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "08D")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
functions.GEN_STRCPY(SiteGrp, "08D")
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "011")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "10B")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "16B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
functions.GEN_STRCPY(SiteGrp, "16A")
}
else {
if (functions.GEN_INLIST(SiteGrp, "021")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
functions.GEN_STRCPY(SiteGrp, "020")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
functions.GEN_STRCPY(SiteGrp, "022")
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "37B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "051")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "51B")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "053")) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
}
}
}
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "999")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981")) {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
}
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9837"))
functions.GEN_STRCPY(SiteGrp, "57A")
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "57A")) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9811-9818,9837"))
functions.GEN_STRCPY(SiteGrp, "57C")
}
if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
return true
}
if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
functions.GEN_STRCPY(GrpStg, SiteGrp)
functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC7STGC, context.NAACCR_AJC7STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
}
}
if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
return true
functions.GEN_STRCPY(GrpStg, SiteGrp)
functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC7STGP, context.NAACCR_AJC7STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
}
return true
}
// ID: NAACCR-01470; TAG: N2301; NAME: Primary Site, AJCC T - Ed 7, ICDO3 (SEER)
public boolean naaccr01470(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
int req_flag
int dx_year
char[] t_GrpTcode = new char[12]
char[] SiteGrp = new char[5]
char[] Site = new char[5]
char[] GrpHist = new char[7]
char[] t_SiteHist = new char[9]
char[] Site_HistLo = new char[20]
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year < 2015 || dx_year > 2015)
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
return true
if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
return true
}
if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
return true
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
return true
if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinT)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathT)))
return true
else
return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
}
if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
return true
functions.GEN_STRCPY(Site, untrimmedline.primarySite)
if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
functions.GEN_STRCPY(Site_HistLo, SITELOW)
functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
functions.GEN_STRCPY(SiteGrp, GPCODE)
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else
functions.GEN_STRCPY(SiteGrp, "999")
}
else {
functions.GEN_STRCPY(SiteGrp, "999")
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
functions.GEN_STRCPY(SiteGrp, "57A")
else {
if (functions.GEN_INLIST(SiteGrp, "04C")) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "04D")
else {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "008")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
functions.GEN_STRCPY(SiteGrp, "08A")
else {
if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
functions.GEN_STRCPY(SiteGrp, "08B")
else
functions.GEN_STRCPY(SiteGrp, "08C")
}
}
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "08D")) {
if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
functions.GEN_STRCPY(SiteGrp, "08D")
else {
if (functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "011")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "10B")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "16B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
functions.GEN_STRCPY(SiteGrp, "16A")
}
else {
if (functions.GEN_INLIST(SiteGrp, "021")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
functions.GEN_STRCPY(SiteGrp, "020")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
functions.GEN_STRCPY(SiteGrp, "022")
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "37B")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "046")) {
if (functions.GEN_INLIST(untrimmedline.sex, "2"))
functions.GEN_STRCPY(SiteGrp, "46A")
else
functions.GEN_STRCPY(SiteGrp, "46B")
}
else {
if (functions.GEN_INLIST(SiteGrp, "051")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
functions.GEN_STRCPY(SiteGrp, "51A")
else {
if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
functions.GEN_STRCPY(SiteGrp, "51B")
else
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
else {
if (functions.GEN_INLIST(SiteGrp, "053")) {
if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
functions.GEN_STRCPY(SiteGrp, "999")
}
}
}
}
}
}
}
}
}
}
}
if (functions.GEN_INLIST(SiteGrp, "999")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
functions.GEN_STRCPY(SiteGrp, "08F")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
else {
if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
functions.GEN_STRCPY(SiteGrp, "028")
}
}
}
if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
return true
}
if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmClinT, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
else
functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TC, context.NAACCR_AJC7TC_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
}
}
if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
return true
functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.tnmPathT, 1, 1), "c,p"))
functions.GEN_STRCAT(t_GrpTcode, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
else
functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TP, context.NAACCR_AJC7TP_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
if (functions.GEN_INLIST(SiteGrp, "999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
else
functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
}
return true
}
// ID: NAACCR-01471; TAG: N2021; NAME: Primary Site, Heme Morph, DateDX, NoOverride (SEER)
public boolean naaccr01471(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.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993"))
return true
if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
return true
}
if (dx_year < 2010) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed prior to 2010, 9823 is valid only for C420, C421, C424')
}
}
if (dx_year >= 2010) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732,9741,9742,9800,9801,9806-9809,9819-9820,9826,9831-9834,9840") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9860,9861,9863,9865-9867,9869-9879,9891,9895-9898,9910-9912,9920,9931,9940") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9945,9946,9948,9950,9961-9968,9975,9980,9982,9983,9985,9986,9989,9991-9993")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "421", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C421')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590,9591,9596,9597,9650-9653,9655,9659,9663,9671,9673,9678,9680,9687,9688,9690") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9691,9695,9698,9700-9702,9705,9708,9709,9712,9714,9717-9719,9724-9727") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9735,9737,9738,9740,9751,9755-9759,9762,9811-9818,9823,9827,9837,9971")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "420,423,424", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C423, C424')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9679")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "379,381-383", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C379, C381-C383')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9689")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C422')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9699")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "420,422,423,424", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C422, C423, C424')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9716")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C422')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C400-C419')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "400-419,420,423,424", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3}, Primary Site must not=C400-C419, C420, C423, C424')
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9930")) {
if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C421, C423, C424')
}
}
if (dx_year > 2009 && dx_year < 2018) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010-2017, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C420')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3)) {
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761"))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010-2017, if Primary Site=${untrimmedline.primarySite}, Histologic Type ICD-O-3 must = 9761')
}
}
if (dx_year > 2017) {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "421", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2018 and later, 9761 coded to C421, no histology coded to C420')
}
if (functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2018 and later, 9761 coded to C421, no histology coded to C420')
}
return true
}
// ID: NAACCR-01472; TAG: N2022; NAME: Primary Site, Heme Morph, DateDX, Override (SEER)
public boolean naaccr01472(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.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
return true
if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993"))
return true
if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (functions.GEN_INLIST(untrimmedline.overRideSiteType, "1"))
return true
if (dx_year < 2010)
return true
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650,9651,9652,9653,9655,9659,9663,9688")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not=C770-C779; review required')
}
else {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9597,9700,9701,9709,9718,9725")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not skin lymphoma; review required')
}
else {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9708,9726")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,490-499,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010+, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not skin or soft tissue lymphoma; review required')
}
}
}
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9719")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "050-059,110-119,300-301,310-319", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site = ${untrimmedline.primarySite}: review required')
}
else {
if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9751")) {
if (!functions.GEN_INLIST(untrimmedline.primarySite, "340-349,400-419,421,440-449,490-499,770-779", "(C\\d\\d\\d)", 2, 3))
return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site = ${untrimmedline.primarySite}: review required')
}
}
return true
}
// ID: NAACCR-01473; TAG: N1996; NAME: RX Date Mst Defn Srg, Date Flag, DX Date (NPCR)
public boolean naaccr01473(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 > 2014) {
if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
return false
}
return true
}
// ID: NAACCR-01474; TAG: N2025; NAME: RX Date Radiation, Date Flag (NAACCR)
public boolean naaccr01474(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
return true
if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
if (!functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10-12,15"))
return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation is blank, RX Date Radiation Flag must be 10, 11, 12, or 15')
}
else {
if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation is present, corresponding date flag must be blank')
}
return true
}
// ID: NAACCR-01475; TAG: N2026; NAME: RX Date Surgery, Date Flag (NAACCR)
public boolean naaccr01475(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
return true
if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery)) {
if (!functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,11,12"))
return functions.GEN_ERROR_MSG(binding, 'If RX Date Surgery is blank, corresponding RX Date Surgery Flag must = 10, 11, or 12')
}
else {
if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
}
return true
}
// ID: NAACCR-01476; TAG: N1994; NAME: Surv--Cases Dx After Study Cutoff (SEER)
public boolean naaccr01476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dtcmp
int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode) || functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
return true
dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.survDateDxRecode, untrimmedline.survDatePresumedAlive, ((Integer)context.NAACCR_GEN_DT_EXACT))
if (dtcmp == ((Integer)context.NAACCR_GEN_DT_UNKNOWN))
return true
if (dtcmp > 0) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "9999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Mos Active Followup must = 9999')
if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "9"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Flag Active Followup must = 9')
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "9999"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Mos Presumed Alive must = 9999')
if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "9"))
functions.GEN_SAVE_ERROR_TEXT(binding, 'If Surv-Date DX Recode > Surv-Date Presumed Alive, Surv-Flag Presumed Alive must = 9')
}
return true
}
// ID: NAACCR-01477; TAG: N1979; NAME: Surv-Date Active Followup (SEER)
public boolean naaccr01477(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int followup_year
followup_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateActiveFollowup)
if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowup))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateActiveFollowup))
return false
if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateActiveFollowup) == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY))
return false
if (followup_year < 1930)
return false
return true
}
// ID: NAACCR-01478; TAG: N1991; NAME: Surv-Date Active Followup, Date Last Cont (SEER)
public boolean naaccr01478(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dtcmp
int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
return true
if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowup))
return true
if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank, Surv-Date Active Followup must be blank')
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateActiveFollowup))
return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Active Followup must be date (month and year) and >= Date of Diagnosis')
dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.survDateActiveFollowup, ((Integer)context.NAACCR_GEN_DT_EXACT))
if (dtcmp <= 0)
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
surv_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateActiveFollowup)
surv_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateActiveFollowup)
surv_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateActiveFollowup)
if (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY) || surv_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) {
if (dx_year <= surv_year)
return true
else
return false
}
else {
if (dx_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY) || surv_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) {
if (dx_year < surv_year)
return true
else {
if (dx_year == surv_year && dx_month <= surv_month)
return true
else
return false
}
}
else
return false
}
return false
}
// ID: NAACCR-01479; TAG: N1993; NAME: Surv-Date Active Followup, Mos, Flag (SEER)
public boolean naaccr01479(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survDateActiveFollowup)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosActiveFollowup) || !functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Date Active Followup = blank, Surv-Mos Active Followup and Surv-Flag Active Followup must be blank')
}
else {
if (functions.GEN_EMPTY(untrimmedline.survMosActiveFollowup)) {
if (!functions.GEN_EMPTY(untrimmedline.survDateActiveFollowup) || !functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Mos Active Followup = blank, Surv-Date Active Followup and Surv-Flag Active Followup must be blank')
}
else {
if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosActiveFollowup) || !functions.GEN_EMPTY(untrimmedline.survDateActiveFollowup))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = blank, Surv-Date Active Followup and Surv-Mos Active Followup must be blank')
}
}
}
return true
}
// ID: NAACCR-01480; TAG: N1981; NAME: Surv-Date DX Recode (SEER)
public boolean naaccr01480(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int recode_year
recode_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateDxRecode)
if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode))
return false
if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateDxRecode) == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY))
return false
if (recode_year < 1930)
return false
return true
}
// ID: NAACCR-01481; TAG: N1995; NAME: Surv-Date DX Recode, Date of Diagnosis (SEER)
public boolean naaccr01481(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survDateDxRecode))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDateDxRecode))
return false
if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
return true
if (functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis))
return functions.GEN_ERROR_MSG(binding, 'Year of Surv-Date DX Recode must = year of Date of Diagnosis')
if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis) > 0 && functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis) < 13) {
if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis))
return functions.GEN_ERROR_MSG(binding, 'If month of Date of Diagnosis = 01-12, month of Surv-Date DX Recode must = month of Date of Diagnosis')
}
if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis) > 0 && functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis) < 32) {
if (functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDateDxRecode) != functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis))
return functions.GEN_ERROR_MSG(binding, 'If day of Date of Diagnosis = 01-31, day of Surv-Date DX Recode must = day of Date of Diagnosis')
}
return true
}
// ID: NAACCR-01482; TAG: N1980; NAME: Surv-Date Presumed Alive (SEER)
public boolean naaccr01482(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int alive_year
alive_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDatePresumedAlive)
if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
return true
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
return false
if (functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDatePresumedAlive) == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY))
return false
if (alive_year < 1930)
return false
return true
}
// ID: NAACCR-01483; TAG: N1990; NAME: Surv-Date Presumed Alive, Date Last Cont, DX (SEER)
public boolean naaccr01483(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dtcmp
int dx_year, dx_month, dx_day, surv_year, surv_month, surv_day
if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis) || !functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
return true
if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
return true
if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact)) {
if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
if (!functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank and Vital Status = 0 or 4, Surv-Date Presumed Alive must be blank')
else
return true
}
}
if (!functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Presumed Alive must be date (month and year) and >= Date of Diagnosis')
else {
if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) && functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact = blank and Vital Status = 1, Surv-Date Presumed Alive must >= Date of Diagnosis')
else
return true
}
if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.survDatePresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Date of Last Contact not = blank, Surv-Date Presumed Alive must be date (month and year) and >= Date of Diagnosis')
dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.survDatePresumedAlive, ((Integer)context.NAACCR_GEN_DT_EXACT))
if (dtcmp <= 0)
return true
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
surv_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.survDatePresumedAlive)
surv_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.survDatePresumedAlive)
surv_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.survDatePresumedAlive)
if (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY) || surv_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) {
if (dx_year <= surv_year)
return true
else
return false
}
else {
if (dx_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY) || surv_day == ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) {
if (dx_year < surv_year)
return true
else {
if (dx_year == surv_year && dx_month <= surv_month)
return true
else
return false
}
}
else
return false
}
return false
}
// ID: NAACCR-01484; TAG: N1992; NAME: Surv-Date Presumed Alive, Mos, Flag (SEER)
public boolean naaccr01484(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosPresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Date Presumed Alive = blank, Surv-Mos Presumed Alive and Surv-Flag Presumed Alive must be blank')
}
else {
if (functions.GEN_EMPTY(untrimmedline.survMosPresumedAlive)) {
if (!functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Mos Presumed Alive = blank, Surv-Date Presumed Alive and Surv-Flag Presumed Alive must be blank')
}
else {
if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosPresumedAlive) || !functions.GEN_EMPTY(untrimmedline.survDatePresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = blank, Surv-Date Presumed Alive and Surv-Mos Presumed Alive must be blank')
}
}
}
return true
}
// ID: NAACCR-01485; TAG: N1982; NAME: Surv-Flag Active Followup (SEER)
public boolean naaccr01485(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup))
return true
if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "0-3,8,9"))
return false
return true
}
// ID: NAACCR-01486; TAG: N1987; NAME: Surv-Flag Active Followup, Mos Act Followup (SEER)
public boolean naaccr01486(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosActiveFollowup))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = blank, Surv-Mos Active Followup must = blank')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "0")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "0000", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 0, Surv-Mos Active Followup must = 0000')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "1")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "0000-9998", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 1, Surv-Mos Active Followup must = 0000-9998')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "2")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "0000-0012", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 2, Surv-Mos Active Followup must = 0000-0012')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "3")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "0000-9998", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 3, Surv-Mos Active Followup must = 0000-9998')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "8")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "9999", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 8, Surv-Mos Active Followup must = 9999')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "9")) {
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "9999", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Active Followup = 9, Surv-Mos Active Followup must = 9999')
}
}
}
}
}
}
}
return true
}
// ID: NAACCR-01487; TAG: N1989; NAME: Surv-Flag Active Followup,Type Report Src (SEER)
public boolean naaccr01487(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagActiveFollowup) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (!functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "8,9"))
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagActiveFollowup, "8"))
return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source not = 6 or 7, Surv-Flag Active Followup must not = 8')
}
return true
}
// ID: NAACCR-01488; TAG: N1983; NAME: Surv-Flag Presumed Alive (SEER)
public boolean naaccr01488(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive))
return true
if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "0-3,8,9"))
return false
return true
}
// ID: NAACCR-01489; TAG: N1986; NAME: Surv-Flag Presumed Alive, Mos Presumed Alive (SEER)
public boolean naaccr01489(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive)) {
if (!functions.GEN_EMPTY(untrimmedline.survMosPresumedAlive))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = blank, Surv-Mos Presumed Alive must = blank')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "0")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "0000", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 0, Surv-Mos Presumed Alive must = 0000')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "1")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "0000-9998", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 1, Surv-Mos Presumed Alive must = 0000-9998')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "2")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "0000-0012", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 2, Surv-Mos Presumed Alive must = 0000-0012')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "3")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "0000-9998", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 3, Surv-Mos Presumed Alive must = 0000-9998')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "9999", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 8, Surv-Mos Presumed Alive must = 9999')
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "9")) {
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "9999", "(\\d\\d\\d\\d)"))
return functions.GEN_ERROR_MSG(binding, 'If Surv-Flag Presumed Alive = 9, Surv-Mos Presumed Alive must = 9999')
}
}
}
}
}
}
}
return true
}
// ID: NAACCR-01490; TAG: N1988; NAME: Surv-Flag Presumed Alive, Type Report Src (SEER)
public boolean naaccr01490(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survFlagPresumedAlive) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
return true
if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
if (!functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8,9"))
return false
}
else {
if (functions.GEN_INLIST(untrimmedline.survFlagPresumedAlive, "8"))
return functions.GEN_ERROR_MSG(binding, 'If Type of Reporting Source not = 6 or 7, Surv-Flag Presumed Alive must not = 8')
}
return true
}
// ID: NAACCR-01491; TAG: N1985; NAME: Surv-Mos Active Followup (SEER)
public boolean naaccr01491(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survMosActiveFollowup))
return true
if (!functions.GEN_INLIST(untrimmedline.survMosActiveFollowup, "0000-9999", "(\\d\\d\\d\\d)"))
return false
return true
}
// ID: NAACCR-01492; TAG: N1984; NAME: Surv-Mos Presumed Alive (SEER)
public boolean naaccr01492(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
if (functions.GEN_EMPTY(untrimmedline.survMosPresumedAlive))
return true
if (!functions.GEN_INLIST(untrimmedline.survMosPresumedAlive, "0000-9999", "(\\d\\d\\d\\d)"))
return false
return true
}
// ID: NAACCR-01493; TAG: N2015; NAME: TNM Clin Descriptor, Date of Diagnosis (SEER)
public boolean naaccr01493(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 > 2015 && dx_year < 2018) && (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)))
return false
return true
}
// ID: NAACCR-01494; TAG: N2018; NAME: TNM Clin Staged By, Date of Diagnosis (SEER)
public boolean naaccr01494(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 2015 || dx_year > 2017)
return true
if ((functions.GEN_EMPTY(untrimmedline.tnmClinStagedBy)) && dx_year == 2015)
return true
return functions.GEN_INLIST(untrimmedline.tnmClinStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")
}
// ID: NAACCR-01495; TAG: N2013; NAME: TNM Edition Number, Date of Diagnosis (SEER)
public boolean naaccr01495(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
functions.GEN_RESET_LOCAL_CONTEXT(binding)
int dx_year
int err_flag
err_flag = 0
dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
return true
if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year < 2015)
return true
if (dx_year == 2015) {
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88")) {
if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
functions.GEN_SAVE_TEXT(binding, 'If dx_year is 2015, then TNM Edition must be 07, 88 or blank')
err_flag = 1
}
}
}
if (dx_year == 2016 || dx_year == 2017) {
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,U7, 88")) {
functions.GEN_SAVE_TEXT(binding, 'If dx_year is 2016 or 2017, then TNM Edition must be 07,U7,or 88')
err_flag = 1
}
}
if (dx_year > 2017 && dx_year < 2021) {
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "08, 88")) {
if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
functions.GEN_SAVE_TEXT(binding, 'If dx_year is > 2017, then TNM Edition must be 08, 88, or blank')
err_flag = 1
}
}
}
if (dx_year > 2020) {
if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "08,09, 88")) {
if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
functions.GEN_SAVE_TEXT(binding, 'If dx_year is > 2020, then TNM Edition must be 08, 09, 88, or blank')
err_flag = 1
}
}
}
if (err_flag == 1)
return false
else
return true
return true
}
// ID: NAACCR-01496; TAG: N2347; NAME: TNM Edition Number, TNM Fields (NPCR)
public boolean naaccr01496(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
return true
if (dx_year == 2015) {
if (!functions.GEN_EMPTY(untrimmedline.tnmPathT) || !functions.GEN_EMPTY(untrimmedline.tnmPathM) || !functions.GEN_EMPTY(untrimmedline.tnmPathM) || !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor) || !functions.GEN_EMPTY(untrimmedline.tnmClinT) || !functions.GEN_EMPTY(untrimmedline.tnmClinM) || !functions.GEN_EMPTY(untrimmedline.tnmClinN) || !functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)) {
if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
return false
}
}
return true
}
// ID: NAACCR-01498; TAG: N2016; NAME: TNM Path Descriptor, Date of Diagnosis (SEER)
public boolean naaccr01498(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 2016) && (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor)))
return true
if (dx_year > 2015 && dx_year < 2018) {
if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
return false
}
return true
}
// ID: NAACCR-01499; TAG: N2017; NAME: TNM Path Staged By, Date of Diagnosis (SEER)
public boolean naaccr01499(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
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 < 2015 || dx_year > 2017)
return true
if ((functions.GEN_EMPTY(untrimmedline.tnmPathStagedBy)) && dx_year == 2015)
return true
return functions.GEN_INLIST(untrimmedline.tnmPathStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")
}
// ID: NAACCR-01500; TAG: N2028; NAME: CS SSF 8, SSF 10, Grade, Prostate (SEER)
public boolean naaccr01500(Binding binding, Map