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

edits.seer.internal.rules.NCDB--SARSCoV2--Pos_Date.xml Maven / Gradle / Ivy

There is a newer version: 024-13
Show newest version
        <rule id="NCDB--SARSCoV2--Pos_Date" name="NCDB--SARSCoV2--Pos Date (COC)" tag="N6405" java-path="lines.line" category="inter-field">
            <expression><![CDATA[if (line.ncdbSarsCov2PosDateYear== null)
   return (line.ncdbSarsCov2PosDateMonth == null && line.ncdbSarsCov2PosDateDay == null)

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

Integer year = Functions.asInt(line.ncdbSarsCov2PosDateYear)
Integer month = Functions.asInt(line.ncdbSarsCov2PosDateMonth)
Integer day = Functions.asInt(line.ncdbSarsCov2PosDateDay)

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

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

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

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

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

if (line.ncdbSarsCov2PosDateDay == 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 NCDB--SARSCoV2--Pos_Date</message>
            <description><![CDATA[This edit checks valid values for NCDB--SARSCoV2--Pos_Date.  The
data item may be blank.
The date must not be invalid or before 2019.

Valid values:
  CCYYMMDD  Date the patient had a positive test for SARS-CoV-2, the virus that causes
                the novel coronavirus disease (COVID-19), as documented by a medical provider.
  Blank -   Date of test is unknown or the date of a positive (diagnostic or serologic) test
             is unknown for SARS-CoV-2.]]></description>
            <history>
                <event version="SE21-021-04" user="smithm" date="2021-04-21" ref="68617">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