edits.seer.internal.rules.IF47.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="IF47" name="Date of Birth, Date of Diagnosis (NAACCR IF47)" tag="N1048" java-path="lines.line" category="inter-field" depends="DateBirthEdit,DateDiagnosisEdit"> <expression><![CDATA[Integer dxYear = Functions.asInt(line.dateOfDiagnosisYear) Integer dxMonth = Functions.asInt(line.dateOfDiagnosisMonth) Integer dxDay = Functions.asInt(line.dateOfDiagnosisDay) Integer birthYear = Functions.asInt(line.dateOfBirthYear) Integer birthMonth = Functions.asInt(line.dateOfBirthMonth) Integer birthDay = Functions.asInt(line.dateOfBirthDay) if (line.dateOfDiagnosisYear == null || line.dateOfBirthYear == null) return true if (birthYear < dxYear) return true if (line.dateOfDiagnosisMonth == null || line.dateOfBirthMonth == null) { if (birthYear == dxYear) return true if (birthYear - dxYear == 1) { if (line.dateOfDiagnosisMonth == null && line.dateOfBirthMonth != null) { if (birthMonth >= 8) return false return line.overRideAgeSiteMorph == '2' || line.overRideAgeSiteMorph == '3' } if (line.dateOfBirthMonth == null && line.dateOfDiagnosisMonth != null) { if (dxMonth <= 5) return false return line.overRideAgeSiteMorph == '2' || line.overRideAgeSiteMorph == '3' } return true } return false } Integer iDateDiff = (birthYear * 12 + birthMonth) - (dxYear * 12 + dxMonth) if (iDateDiff < 0) return true if (iDateDiff == 0) { if (line.dateOfDiagnosisDay == null || line.dateOfBirthDay == null || dxDay >= birthDay) return true return line.overRideAgeSiteMorph == '2' || line.overRideAgeSiteMorph == '3' } if (iDateDiff < 7) return line.overRideAgeSiteMorph == '2' || line.overRideAgeSiteMorph == '3' if (iDateDiff == 7) { if (line.dateOfDiagnosisDay == null || line.dateOfBirthDay == null || dxDay >= birthDay) return line.overRideAgeSiteMorph == '2' || line.overRideAgeSiteMorph == '3' return false } return false]]></expression> <message>Date of Birth must not be later than Date of Diagnosis</message> <description><![CDATA[This edit verifies that Birth Date is not later than Date of Diagnosis unless the case was diagnosed in utero. Otherwise, Birth Date must not be later than Date of Diagnosis. If either year is blank the edit is skipped. If either month is blank, then the edit will use the year values and either month value if it is known (1-12). If either day is blank, then only the years and months are compared. If Birth Date is later than Date of Diagnosis, the difference in months is calculated. If the difference is no more than 7 full months AND the Over-ride Age/Site/Morph code is 2 or 3, no further checking is done. (Over-ride Age/Site/Morph may be set to 2 or 3 to indicate a case has been diagnosed in utero.) This edit is also skipped if any of the following conditions are true: 1) Inter-Field edit flag "Date of Birth not valid" has been triggered 2) Inter-Field edit flag "Date of Diagnosis not valid" has been triggered]]></description> <history> <event version="SE11-001-22" user="greend" date="2008-01-10">Edit is skipped if Date of Birth is blank. If Month of Diagnosis or Month of Birth is blank, then only the years are compared.</event> <event version="SE11-001-22" user="greend" date="2008-01-21">Edit now uses Day of Birth and Day of Diagnosis.</event> <event version="SE11-001-22" user="greend" date="2008-07-10">Edit is now bypassed if Over-ride age/site/morph contains a '2' (Reviewed: Case was diagnosed utero) or '3' (Reviewed: Conditions 1 and 2 above both apply).</event> <event version="SE11-001-23" user="greend" date="2009-04-20">if Birth Date is later than Date of Diagnosis, the difference is months is calculated. If the difference is no more than 7 full months AND the Over-ride Age/Site/Morph code is 2 or 3, no further checking is done. (Over-ride Age/Site/Morph may be set to 2 or 3 to indicate a case has been diagnosed in utero.)</event> <event version="SE12-002-01" user="murphyr" date="2009-12-18">9 filled dates removed and replace with blanks. Stopped using ints for blank comparisons and used strings.</event> <event version="SE12-002-01" user="murphyr" date="2010-01-27">Updated documentations</event> <event version="SE16-016-08" user="depryf" date="2017-11-22" ref="67674">Edit syntax updated to allow pre-compilation optimization; no change in behavior.</event> <event version="SE18-020-01" user="depryf" date="2020-02-04" ref="68281">Changed property names to align with NAACCR XML IDs.</event> <event version="SE24-024-04" user="kirbyk" date="2024-04-16" ref="69326">Removed several dependencies.</event> </history> </rule>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy