edits.seer.internal.rules.RXDateMostDefinSurgEdit.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.
The newest version!
<rule id="RXDateMostDefinSurgEdit" name="RX Date Mst Defn Srg (COC)" tag="N0510" java-path="lines.line" category="inter-field" depends="Day_Most_Defin_Surg,Month_Most_Defin_Surg,Year_Most_Defin_Surg"> <expression><![CDATA[Integer year = Functions.asInt(line.rxDateMostDefinSurgYear) Integer month = Functions.asInt(line.rxDateMostDefinSurgMonth) Integer day = Functions.asInt(line.rxDateMostDefinSurgDay) Integer yearCur = Functions.getCurrentYear() Integer monthCur = Functions.getCurrentMonth() Integer dayCur = Functions.getCurrentDay() if (line.rxDateMostDefinSurgYear == null) return (line.rxDateMostDefinSurgMonth == null && line.rxDateMostDefinSurgDay == null) if ((line.rxDateMostDefinSurgMonth == null && line.rxDateMostDefinSurgDay != null) || (month > 12 || (line.rxDateMostDefinSurgMonth != null && month < 1))) return false if (!Functions.between(year, 1930, yearCur)) return false if (line.rxDateMostDefinSurgMonth == null) //by now year fits and day is null if month is null return true if (year == yearCur && month > monthCur) return false if (line.rxDateMostDefinSurgDay == null) //by now year and month fit return true if (year == yearCur && month == monthCur && day > dayCur) return false Calendar cal = new GregorianCalendar(year, month - 1, 1) return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)]]></expression> <message>RX Date Mst Defn Srg is not valid.</message> <description><![CDATA[This edit is skipped if RX Date Mst Defn Srg is empty. The RX Date Mst Defn Srg[3170] checks are performed in this order: A) If the year is blank, month and day must also be blank. B) Year of Most Defin Surg must be between 1930 and the current system year. C) If the month is blank, the day must be blank. D) If day of Most Defin Surg is blank, the year of Most Defin Surg and month of Most Defin Surg can not be greater than the current system year/month. E) If day is known, then entire RX Date Mst Defn Srg is verified. The date must be a valid date (leap years checked) and must be less than or equal to the current system date.]]></description> <history> <event version="SE16-016-01" user="kirbyk" date="2017-01-12" ref="67577">Edit created.</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="SE22-022-13" user="kirbyk" date="2022-10-18" ref="69045">Fixing edit behavior for future dates.</event> </history> </rule>