All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edits.seer.internal.rules.RXDateSystemicEdit.xml Maven / Gradle / Ivy

There is a newer version: 024-13
Show newest version
        <rule id="RXDateSystemicEdit" name="RX Date Systemic (COC)" tag="N0567" java-path="lines.line" category="inter-field" depends="Day_Systemic,Month_Systemic,Year_Systemic">
            <expression><![CDATA[Integer year = Functions.asInt(line.rxDateSystemicYear)
Integer month = Functions.asInt(line.rxDateSystemicMonth)
Integer day = Functions.asInt(line.rxDateSystemicDay)

Integer yearCur = Functions.getCurrentYear()
Integer monthCur = Functions.getCurrentMonth()
Integer dayCur = Functions.getCurrentDay()

if (line.rxDateSystemicYear == null)
    return (line.rxDateSystemicMonth == null && line.rxDateSystemicDay == null)

if ((line.rxDateSystemicMonth == null && line.rxDateSystemicDay != null) || (month > 12 || (line.rxDateSystemicMonth != null && month < 1)))
    return false

if (!Functions.between(year, 1930, yearCur))
    return false

if (line.rxDateSystemicMonth == null) //by now year fits and day is null if month is null
    return true

if (year == yearCur && month > monthCur)
    return false

if (line.rxDateSystemicDay == 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 Systemic is not valid.</message>
            <description><![CDATA[This edit is skipped if RX Date Systemic is empty.

The RX Date Systemic[3230] checks are performed in this order:

A) If the year is blank, month and day must also be blank.

B) Year of Systemic must be between 1930 and the current system year.

C) If the month is blank, the day must be blank.

D) If day of Systemic is blank, the year of Systemic and month of Systemic can not be greater than the current system year/month.

E) If day is known, then entire RX Date Systemic 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-10" user="kirbyk" date="2018-01-16" ref="67682">Edit created.</event>
                <event version="SE22-022-13" user="kirbyk" date="2022-10-18" ref="69045">Fixing edit behavior for future dates.</event>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy