edits.seer.internal.rules.DateRegionalLymphNodeDissectionEdit.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="DateRegionalLymphNodeDissectionEdit" name="Date Regional Lymph Node Dissection (COC)" tag="N2518" java-path="lines.line" category="inter-field" depends="Day_Regional_Lymph_Node_Dissection,Month_Regional_Lymph_Node_Dissection,Year_Regional_Lymph_Node_Dissection"> <expression><![CDATA[Integer year = Functions.asInt(line.dateRegionalLNDissectionYear) Integer month = Functions.asInt(line.dateRegionalLNDissectionMonth) Integer day = Functions.asInt(line.dateRegionalLNDissectionDay) Integer yearCur = Functions.getCurrentYear() Integer monthCur = Functions.getCurrentMonth() Integer dayCur = Functions.getCurrentDay() if (line.dateRegionalLNDissectionYear == null) return (line.dateRegionalLNDissectionMonth == null && line.dateRegionalLNDissectionDay == null) if ((line.dateRegionalLNDissectionMonth == null && line.dateRegionalLNDissectionDay != null) || (month > 12 || (line.dateRegionalLNDissectionMonth != null && month < 1))) return false if (!Functions.between(year, 1930, yearCur)) return false if (line.dateRegionalLNDissectionMonth == null) //by now year fits and day is null if month is null return true if (year == yearCur && month > monthCur) return false if (line.dateRegionalLNDissectionDay == 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 Regional Lymph Node Dissection is not valid.</message> <description><![CDATA[This data item records the date non-sentinel regional node dissection was performed. This data item is collected for all cases. This edit checks for valid date only. Other edits check that the item is recorded according to standard setter requirements by date of diagnosis. 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>