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

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

There is a newer version: 024-13
Show newest version
<rule id="IFN2524" name="Date of Last Cancer (tumor) Status (COC)" tag="N2524" java-path="lines.line" category="inter-field">
            <expression><![CDATA[Integer year = Functions.asInt(line.dateOfLastCancerStatusYear)
Integer month = Functions.asInt(line.dateOfLastCancerStatusMonth)
Integer day = Functions.asInt(line.dateOfLastCancerStatusDay)

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

if (line.dateOfLastCancerStatusYear == null)
    return (line.dateOfLastCancerStatusMonth == null && line.dateOfLastCancerStatusDay == null)

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

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

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

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

if (line.dateOfLastCancerStatusDay == 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>Date of Last Cancer (tumor) Status is an invalid date</message>
            <description><![CDATA[This data item documents the date of last cancer (tumor) status of the patient's
malignant or non-malignant tumor.

This data item may be blank. Another edit checks that the item is recorded
according to standard setter requirements by date and class of case.

General Date Editing Rules:

Date fields are recorded in the D1 date format of year, month, day (CCYYMMDD).
Month and day must have leading zeros for values 01...09.

The following date formats are allowed:

CCYYMMDD    Century+Year, Month and Day are provided.
CCYYMM    Century+Year and Month. Day consists of two blank spaces.
CCYY        Century+Year. Month and Day consist of four blank spaces.

Dates are checked first to ensure they conform to one of these formats, then for
errors in the components. Checking stops on the first non-valid situation.

Range checking:
    Lowest allowed value:  January 1, 1850 (or in D1 format: 18500101)
    Highest allowed value: current system date
    When month is known, it is checked to ensure it falls within range 01...12.
    When month and day are known, day is checked to ensure it falls within range
    for that specific month. Accommodation is made for leap years.]]></description>
            <history>
                <event version="SE23-023-04" user="cooki" date="2023-06-13" ref="69275">Edit created.</event>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy