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

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

The newest version!
        <rule id="Covid_19_Viral_Test_Date" name="Covid-19 Viral Test Date" tag="S049" java-path="lines.line" category="inter-field">
            <expression><![CDATA[if (line.covid19ViralTestDateYear == null)
   return (line.covid19ViralTestDateMonth == null && line.covid19ViralTestDateDay == null)

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

Integer year = Functions.asInt(line.covid19ViralTestDateYear)
Integer month = Functions.asInt(line.covid19ViralTestDateMonth)
Integer day = Functions.asInt(line.covid19ViralTestDateDay)

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

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

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

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

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

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

Valid values:
  CCYYMMDD  Date patient had a viral test for the novel coronavirus disease (COVID-19), as documented by a medical provider.
  Blank -   Date of test is unknown or unknown if patient received viral test.]]></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