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

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

The newest version!
        <rule id="Covid_19_Diagnosis_Date" name="Covid-19 Diagnosis Date" tag="S051" java-path="lines.line" category="inter-field">
            <expression><![CDATA[if (line.covid19DxDateYear == null)
   return (line.covid19DxDateMonth == null && line.covid19DxDateDay == null)

if (line.covid19DxDateYear < '2019')
    return false

Integer year = Functions.asInt(line.covid19DxDateYear)
Integer month = Functions.asInt(line.covid19DxDateMonth)
Integer day = Functions.asInt(line.covid19DxDateDay)

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

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

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

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

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

if (line.covid19DxDateDay == 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>Not a valid value for Covid-19 Diagnosis Date</message>
            <description><![CDATA[This edit checks valid values for Covid-19 Diagnosis Date.  The
data item may be blank.
The date must not be invalid or before 2019.

Valid values:
  CCYYMMDD  Date the patient received a positive diagnosis for the novel coronavirus disease (COVID-19), as documented by a medical provider.
  Blank -   Date of diagnosis is unknown or unknown if patient was positively diagnosed.]]></description>
            <history>
                <event version="SE22-022-01" user="beverung" date="2022-03-01" ref="68898">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