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

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

There is a newer version: 024-13
Show newest version
        <rule id="SurvDateActiveFollowupEdit" name="Surv-Date Active Followup (SEER)" tag="N1979" java-path="lines.line" category="inter-field" depends="Day_SurvDateActiveFollowup,Month_SurvDateActiveFollowup,Year_SurvDateActiveFollowup">
            <expression><![CDATA[Integer year = Functions.asInt(line.survDateActiveFollowupYear)
Integer month = Functions.asInt(line.survDateActiveFollowupMonth)
Integer day = Functions.asInt(line.survDateActiveFollowupDay)
Integer yearCur = Functions.getCurrentYear()
Integer monthCur = Functions.getCurrentMonth()
Integer dayCur = Functions.getCurrentDay()

if (line.survDateActiveFollowupYear == null && line.survDateActiveFollowupMonth == null && line.survDateActiveFollowupDay == null)
    return true

if (line.survDateActiveFollowupYear == null || line.survDateActiveFollowupMonth == null)
    return false

if (!Functions.between(year, 1930, yearCur) || month < 1 || month > 12 || (year == yearCur && month > monthCur))
    return false

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>Surv-Date Active Followup is not valid.</message>
            <description><![CDATA[This edit is skipped if SurvDateActiveFollowupEdit is blank.

The date checks are performed in this order:

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

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

C) If day is blank, the year and month cannot be greater than the current system year/month.

D) Year must be between 1930 and the current system year.

E) If day is known, then entire date 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-20" ref="67147">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-017-01" user="schadega" date="2018-03-15" ref="67708">Allow blank day field.</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="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