File tree Expand file tree Collapse file tree
src/main/java/com/imsweb/validation/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## Validation Framework Version History
22
3+ ** Version 4.6**
4+
5+ - Added a way to provide a line number as a tumor identifier in the simple NAACCR validatable.
6+
37** Version 4.5**
48
59- Fixed behavior of translated edits that add extra error messages.
Original file line number Diff line number Diff line change @@ -270,10 +270,22 @@ public Long getCurrentTumorId() {
270270 if (_currentLine == null )
271271 return null ;
272272
273- String tumorId = _currentLine .get ("tumorRecordNumber" );
274- if (!NumberUtils .isDigits (tumorId ))
275- tumorId = _currentLine .get ("sequenceNumberCentral" );
276- return NumberUtils .isDigits (tumorId ) ? Long .valueOf (tumorId ) : null ;
273+ // if the line number is available, it's the best way to uniquely identify a tumor...
274+ String lineNumber = _currentLine .get (Validatable .KEY_LINE_NUMBER );
275+ if (lineNumber != null )
276+ return Long .valueOf (lineNumber );
277+
278+ // otherwise, try to use the tumor record number
279+ String tumorRecordNumber = _currentLine .get ("tumorRecordNumber" );
280+ if (NumberUtils .isDigits (tumorRecordNumber ))
281+ return Long .valueOf (tumorRecordNumber );
282+
283+ // otherwise, try to use the sequence number central
284+ String sequenceNumberCentral = _currentLine .get ("sequenceNumberCentral" );
285+ if (NumberUtils .isDigits (sequenceNumberCentral ))
286+ return Long .valueOf (sequenceNumberCentral );
287+
288+ return null ;
277289
278290 }
279291
Original file line number Diff line number Diff line change 1717 */
1818public interface Validatable {
1919
20+ /**
21+ * Key for the line number corresponding to the entity being validated; some validatable implementations might put this on their "line" data.
22+ */
23+ String KEY_LINE_NUMBER = "_lineNumber" ;
24+
2025 /**
2126 * Key for the calculated CS staging schema ID that some validatable implementations put in the context of the executed edits.
2227 */
You can’t perform that action at this time.
0 commit comments