edits.seer.internal.rules.SEER_IR16.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validation-edits-seer Show documentation
Show all versions of validation-edits-seer Show documentation
Java implemenation of the SEER edits.
<rule id="SEER_IR16" name="Duplicate Heme Cases for Patient (SEER IR16)" tag="S041" java-path="lines" category="inter-record"> <expression><![CDATA[if (lines.size() < 2) return true for (line in lines) { if (line.dateOfDiagnosisYear != null && !(Functions.matches(line.dateOfDiagnosisYear, /^[12]\d\d\d$/) && Functions.between(line.dateOfDiagnosisYear, 1930, Functions.getCurrentYear()))) return true } int outerIndex = 0 while (outerIndex < lines.size()) { int innerIndex = outerIndex + 1 Map outerLine = lines.get(outerIndex) Integer outerHistInt = Functions.asInt(outerLine.histologicTypeIcdO3) boolean outerHeme95909993 = Functions.between(outerHistInt, 9590, 9993) && outerHistInt != 9699; boolean outerHeme9699group1 = outerHistInt == 9699 && Functions.matches(outerLine.primarySite, /^C(024|09\d|111|142|379|422|77\d)$/) boolean outerHeme9699group2 = outerHistInt == 9699 && !outerHeme9699group1 if (outerHeme95909993 || outerHeme9699group1 || outerHeme9699group2) { while (innerIndex < lines.size()) { Map innerLine = lines.get(innerIndex) if (outerLine.dateOfDiagnosisYear > '2009' || innerLine.dateOfDiagnosisYear > '2009') { Integer innerHistInt = Functions.asInt(innerLine.histologicTypeIcdO3) boolean innerHeme95909993 = Functions.between(innerHistInt, 9590, 9993) && innerHistInt != 9699; boolean innerHeme9699group1 = innerHistInt == 9699 && Functions.matches(innerLine.primarySite, /^C(024|09\d|111|142|379|422|77\d)$/) boolean innerHeme9699group2 = innerHistInt == 9699 && !innerHeme9699group1 if ((outerHeme9699group1 && innerHeme9699group1) || (innerHeme9699group2 && outerHeme9699group2) || (outerHistInt == innerHistInt && outerHistInt != 9699)) { Functions.forceFailureOnEntity(binding, innerLine) Functions.forceFailureOnEntity(binding, outerLine) return false } } innerIndex += 1 } } outerIndex += 1 } return true]]></expression> <message>Duplicate Heme Inter-Record Error</message> <description><![CDATA[This edit is skipped if any record for the person has the "Date of Diagnosis is invalid" inter-field edit flag triggered. IR16 compares each of the histology entries for a given patient to determine whether or not there are multiple Heme cases. This edit fails if two cases have 9590-9993 (except 9699) there cannot be two cases with the same histology with at least one case diagnosed in 2010+. For example - there cannot be two cases with 9590 but there could be one case with 9590 and one case with 9993. For histology 9699 there cannot be two cases with 9699 within the same site group defined below with at least one case diagnosed in 2010+ group1: C024, C111, C142, C379, C422, C090-C099, C770-C779 group2: all other sites]]></description> <history> <event version="SE18-020-05" user="beverung" date="2020-09-02" ref="68360">Edit created.</event> </history> </rule>