Skip to content

Commit fa86707

Browse files
committed
Added support for line number tumor identifiers.
1 parent 88add02 commit fa86707

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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.

src/main/java/com/imsweb/validation/entities/SimpleNaaccrLinesValidatable.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff 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

src/main/java/com/imsweb/validation/entities/Validatable.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
*/
1818
public 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
*/

0 commit comments

Comments
 (0)