Skip to content

Commit

Permalink
Updated M14 of hematopoietic 2010 rules (#129)
Browse files Browse the repository at this point in the history
- Fixed issues found during testing
  • Loading branch information
bekeles committed Oct 31, 2023
1 parent 5f8b0cf commit 8946a0f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import com.imsweb.mph.MphConstants;
import com.imsweb.mph.MphGroup;
Expand Down Expand Up @@ -447,7 +446,7 @@ public TempRuleResult apply(MphInput i1, MphInput i2, RuleExecutionContext conte
if (GroupUtility.differentCategory(i1.getHistology(), i2.getHistology(), MphConstants.PTLD, combined)) {
//Even if the dx date is known to be the same, we don't know if it is in one biopsy.
//If dx date is same, return a potential single primary! If M15 confirms the cases as single, we will return single.
if (i1.getDateOfDiagnosisYear().equals(i2.getDateOfDiagnosisYear()) && Objects.equals(i1.getDateOfDiagnosisMonth(), i2.getDateOfDiagnosisMonth()) && Objects.equals(i1.getDateOfDiagnosisDay(), i2.getDateOfDiagnosisDay())) {
if (GroupUtility.sameKnownDateParts(i1, i2)) {
result.setPotentialResult(MphUtils.MpResult.SINGLE_PRIMARY);
result.setMessage("Unable to apply Rule " + this.getStep() + " of " + this.getGroupName() + ". Manual review required to determine whether the histologies were diagnosed from the same biopsy.");
}
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/com/imsweb/mph/MphUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,25 @@ public void test2010Hematopoietic() {
i2.setDateOfDiagnosisDay("02"); //skip if they are not same date
output = _utils.computePrimaries(i1, i2);
Assert.assertEquals(15, output.getAppliedRules().size());
//Same know dates (day part is missing and invalid)
i1.setDateOfDiagnosisYear("2010");
i2.setDateOfDiagnosisYear("2010");
i1.setDateOfDiagnosisMonth("01");
i2.setDateOfDiagnosisMonth("01");
i1.setDateOfDiagnosisDay("99");
i2.setDateOfDiagnosisDay("AA");
output = _utils.computePrimaries(i1, i2);
Assert.assertEquals(14, output.getAppliedRules().size());
Assert.assertEquals(MphUtils.MpResult.QUESTIONABLE, output.getResult());
//Same know dates (month part is missing also)
i2.setDateOfDiagnosisMonth(null);
output = _utils.computePrimaries(i1, i2);
Assert.assertEquals(14, output.getAppliedRules().size());
Assert.assertEquals(MphUtils.MpResult.QUESTIONABLE, output.getResult());
//Month is different
i2.setDateOfDiagnosisMonth("02");
output = _utils.computePrimaries(i1, i2);
Assert.assertEquals(15, output.getAppliedRules().size());

//M15 Use the Heme DB Multiple Primaries Calculator to determine the number of primaries
Assert.assertEquals(MphUtils.MpResult.MULTIPLE_PRIMARIES, output.getResult());//9732 and 9971 are not same primaries
Expand Down

0 comments on commit 8946a0f

Please sign in to comment.