Skip to content

Commit 7b92e23

Browse files
committed
Added another option to death class method.
1 parent 1f629c9 commit 7b92e23

6 files changed

Lines changed: 432 additions & 17 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
**Changes in version 5.9 (not released yet)**
44

55
- Added optional behavior and DX year input to the Cause of Death Classification utility methods. This won't affect the corresponding algorithm, which uses the 2008 SEER Site Recode logic.
6-
- Fixed small data issue with Cause of Death Classification algorithm.
76

87
**Changes in version 5.8**
98

‎src/main/java/com/imsweb/algorithms/causespecific/CauseSpecificUtils.java‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public final class CauseSpecificUtils {
3636
public static final String SEQUENCE_NOT_APPLICABLE = "9";
3737

3838
//lookup for tables (lazily loaded)
39-
private static final List<CauseSpecificDataDto> _DATA_SITE_SPECIFIC_2008 = new ArrayList<>();
39+
private static final List<CauseSpecificDataDto> _DATA_SITE_SPECIFIC_2008_PRE_BUG_FIX = new ArrayList<>();
40+
private static final List<CauseSpecificDataDto> _DATA_SITE_SPECIFIC_2008_POST_BUG_FIX = new ArrayList<>();
4041
private static final List<CauseSpecificDataDto> _DATA_SITE_SPECIFIC_2023 = new ArrayList<>();
4142

4243
private CauseSpecificUtils() {
@@ -66,7 +67,7 @@ private CauseSpecificUtils() {
6667
* </ul>
6768
*/
6869
public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto input) {
69-
return computeCauseSpecific(input, Calendar.getInstance().get(Calendar.YEAR), SeerSiteRecodeUtils.VERSION_DEFAULT);
70+
return computeCauseSpecific(input, Calendar.getInstance().get(Calendar.YEAR), SeerSiteRecodeUtils.VERSION_DEFAULT, false);
7071
}
7172

7273
/**
@@ -93,7 +94,7 @@ public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto
9394
* </ul>
9495
*/
9596
public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto input, int cutOffYear) {
96-
return computeCauseSpecific(input, cutOffYear, SeerSiteRecodeUtils.VERSION_DEFAULT);
97+
return computeCauseSpecific(input, cutOffYear, SeerSiteRecodeUtils.VERSION_DEFAULT, false);
9798
}
9899

99100
/**
@@ -123,7 +124,7 @@ public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto
123124
* </ul>
124125
*/
125126
@SuppressWarnings({"DuplicateExpressions", "java:S1871"}) // branches with the same outcome
126-
public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto input, int cutOffYear, String seerSiteRecodeVersion) {
127+
public static CauseSpecificResultDto computeCauseSpecific(CauseSpecificInputDto input, int cutOffYear, String seerSiteRecodeVersion, boolean useFixed2008data) {
127128
CauseSpecificResultDto result = new CauseSpecificResultDto();
128129

129130
int seq = NumberUtils.isDigits(input.getSequenceNumberCentral()) ? Integer.parseInt(input.getSequenceNumberCentral()) : -1;
@@ -218,7 +219,7 @@ else if ("37000".equals(recode) && (("C00".compareTo(cod3dig) <= 0 && "D489".com
218219
return result;
219220
}
220221

221-
for (CauseSpecificDataDto obj : getData(seerSiteRecodeVersion)) {
222+
for (CauseSpecificDataDto obj : getData(seerSiteRecodeVersion, useFixed2008data)) {
222223
if (obj.doesMatchThisRow(input.getIcdRevisionNumber(), seq == 0 ? "0" : "1-59", recode, cod)) {
223224
result.setCauseSpecificDeathClassification(DEAD);
224225
result.setCauseOtherDeathClassification(ALIVE_OR_DEAD_OF_OTHER_CAUSES);
@@ -232,11 +233,18 @@ else if ("37000".equals(recode) && (("C00".compareTo(cod3dig) <= 0 && "D489".com
232233
return result;
233234
}
234235

235-
private static synchronized List<CauseSpecificDataDto> getData(String version) {
236+
private static synchronized List<CauseSpecificDataDto> getData(String version, boolean useFixed2008data) {
236237
if (SeerSiteRecodeUtils.VERSION_2008.equals(version)) {
237-
if (_DATA_SITE_SPECIFIC_2008.isEmpty())
238-
loadData("data_2008.txt", _DATA_SITE_SPECIFIC_2008);
239-
return _DATA_SITE_SPECIFIC_2008;
238+
if (useFixed2008data) {
239+
if (_DATA_SITE_SPECIFIC_2008_POST_BUG_FIX.isEmpty())
240+
loadData("data_2008_post_bug_fix.txt", _DATA_SITE_SPECIFIC_2008_POST_BUG_FIX);
241+
return _DATA_SITE_SPECIFIC_2008_POST_BUG_FIX;
242+
}
243+
else {
244+
if (_DATA_SITE_SPECIFIC_2008_PRE_BUG_FIX.isEmpty())
245+
loadData("data_2008_pre_bug_fix.txt", _DATA_SITE_SPECIFIC_2008_PRE_BUG_FIX);
246+
return _DATA_SITE_SPECIFIC_2008_PRE_BUG_FIX;
247+
}
240248
}
241249
else if (SeerSiteRecodeUtils.VERSION_2023.equals(version)) {
242250
if (_DATA_SITE_SPECIFIC_2023.isEmpty())
File renamed without changes.

0 commit comments

Comments
 (0)