edits.seer.internal.rules.Covid_19_Antibody_Test_Date.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validation-edits-seer Show documentation
Show all versions of validation-edits-seer Show documentation
Java implemenation of the SEER edits.
<rule id="Covid_19_Antibody_Test_Date" name="Covid-19 Antibody Test Date" tag="S050" java-path="lines.line" category="inter-field"> <expression><![CDATA[if (line.covid19AntibodyTestDateYear == null) return (line.covid19AntibodyTestDateMonth == null && line.covid19AntibodyTestDateDay == null) if (line.covid19AntibodyTestDateYear < '2019') return false Integer year = Functions.asInt(line.covid19AntibodyTestDateYear) Integer month = Functions.asInt(line.covid19AntibodyTestDateMonth) Integer day = Functions.asInt(line.covid19AntibodyTestDateDay) Integer yearCur = Functions.getCurrentYear() Integer monthCur = Functions.getCurrentMonth() Integer dayCur = Functions.getCurrentDay() if ((line.covid19AntibodyTestDateMonth == null && line.covid19AntibodyTestDateDay != null) || (month > 12 || (line.covid19AntibodyTestDateMonth != null && month < 1))) return false if (!Functions.between(year, 1930, yearCur)) return false if (line.covid19AntibodyTestDateMonth == null) //by now year fits and day is null if month is null return true if (year == yearCur && month > monthCur) return false if (line.covid19AntibodyTestDateDay == 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 Antibody Test Date</message> <description><![CDATA[This edit checks valid values for Covid-19 Antibody Test Date. The data item may be blank. The date must not be invalid or before 2019. Valid values: CCYYMMDD Date the patient had an antibody 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 antibody 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