edits.seer.internal.rules.DateSentinelLymphNodeBiopsyEdit.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="DateSentinelLymphNodeBiopsyEdit" name="Date of Sentinel Lymph Node Biopsy (COC)" tag="N2512" java-path="lines.line" category="inter-field" depends="Day_Sentinel_Lymph_Node_Biopsy,Month_Sentinel_Lymph_Node_Biopsy,Year_Sentinel_Lymph_Node_Biopsy"> <expression><![CDATA[Integer year = Functions.asInt(line.dateSentinelLymphNodeBiopsyYear) Integer month = Functions.asInt(line.dateSentinelLymphNodeBiopsyMonth) Integer day = Functions.asInt(line.dateSentinelLymphNodeBiopsyDay) Integer yearCur = Functions.getCurrentYear() Integer monthCur = Functions.getCurrentMonth() Integer dayCur = Functions.getCurrentDay() if (line.dateSentinelLymphNodeBiopsyYear == null) return (line.dateSentinelLymphNodeBiopsyMonth == null && line.dateSentinelLymphNodeBiopsyDay == null) if ((line.dateSentinelLymphNodeBiopsyMonth == null && line.dateSentinelLymphNodeBiopsyDay != null) || (month > 12 || (line.dateSentinelLymphNodeBiopsyMonth != null && month < 1))) return false if (!Functions.between(year, 1930, yearCur)) return false if (line.dateSentinelLymphNodeBiopsyMonth == null) //by now year fits and day is null if month is null return true if (year == yearCur && month > monthCur) return false if (line.dateSentinelLymphNodeBiopsyDay == 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 Sentinel Lymph Node Biopsy is not valid.</message> <description><![CDATA[This data item records the date of the sentinel lymph node(s) biopsy procedure. The item is collected for Melanoma of Skin and Breast cases only (Schema IDs 00470 and 00480). This edit checks for valid date only. Other edits check that the item is recorded according to standard setter requirements by date of diagnosis and primary site. The data item may be blank. 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, 1930 (or in D1 format: 19300101) 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="SE18-018-02" user="kirbyk" date="2018-05-10" ref="67779">Edit created.</event> <event version="SE18-020-01" user="depryf" date="2020-02-04" ref="68281">Changed property names to align with NAACCR XML IDs.</event> <event version="SE22-022-13" user="kirbyk" date="2022-10-18" ref="69045">Fixing edit behavior for future dates.</event> <event version="SE23-023-01" user="shearerw" date="2023-01-20" ref="69080">Remove reference to date flags from description. No logic updated.</event> </history> </rule>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy