edits.seer.internal.rules.RXDateSurgeryEdit.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="RXDateSurgeryEdit" name="RX Date Surgery (COC)" tag="N0356" java-path="lines.line" category="inter-field" depends="Day_Surgery,Month_Surgery,Year_Surgery"> <expression><![CDATA[Integer year = Functions.asInt(line.rxDateSurgeryYear) Integer month = Functions.asInt(line.rxDateSurgeryMonth) Integer day = Functions.asInt(line.rxDateSurgeryDay) Integer yearCur = Functions.getCurrentYear() Integer monthCur = Functions.getCurrentMonth() Integer dayCur = Functions.getCurrentDay() if (line.rxDateSurgeryYear == null) return (line.rxDateSurgeryMonth == null && line.rxDateSurgeryDay == null) if ((line.rxDateSurgeryMonth == null && line.rxDateSurgeryDay != null) || (month > 12 || (line.rxDateSurgeryMonth != null && month < 1))) return false if (!Functions.between(year, 1930, yearCur)) return false if (line.rxDateSurgeryMonth == null) //by now year fits and day is null if month is null return true if (year == yearCur && month > monthCur) return false if (line.rxDateSurgeryDay == 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 Surgery is not valid.</message> <description><![CDATA[This edit is skipped if RX Date Surgery is empty. The RX Date Surgery[1200] checks are performed in this order: A) If the year is blank, month and day must also be blank. B) Year of Surgery must be between 1930 and the current system year. C) If the month is blank, the day must be blank. D) If day of Surgery is blank, the year of Surgery and month of Surgery can not be greater than the current system year/month. E) If day is known, then entire RX Date Surgery 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="SE15-013-01" user="kirbyk" date="2015-01-12" ref="67146">Edit created.</event> <event version="SE16-015-01" user="kirbyk" date="2016-06-20" ref="67425">Fixed documentation.</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-05" user="beverung" date="2020-07-31" ref="68451">Changed edit name.</event> <event version="SE21-021-03" user="kirbyk" date="2021-03-09" ref="68568">Edit name changed.</event> <event version="SE22-022-13" user="kirbyk" date="2022-10-18" ref="69045">Fixing edit behavior for future dates.</event> </history> </rule>