Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Unit test fixes
  • Loading branch information
ctmay4 committed Aug 7, 2024
commit 9e51906b118601e08ba9f1d8a9442338f5ab16d3
20 changes: 0 additions & 20 deletions src/main/java/com/imsweb/seerapi/client/mph/MphInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

public class MphInput {

/**
* How to consider histology match, if it is strict 8000 is considered a different histology than 8010-9999
* for rule : Do the tumors have ICD-O-3 histology codes that are different at the first (Xxxx), second (Xxxx), or third (xxXx) number?
* If lenient mode is on 8000 is considered as NOS and be considered to match any 8nnn histologies.
*/
public enum HistologyMatchMode {
STRICT,
LENIENT
}

@JsonProperty("primary_site")
private String _primarySite;
@JsonProperty("histology_icd_o3")
Expand All @@ -32,8 +22,6 @@ public enum HistologyMatchMode {
private String _dateOfDiagnosisMonth;
@JsonProperty("date_of_diagnosis_day")
private String _dateOfDiagnosisDay;
@JsonProperty("tx_status")
private String _txStatus;

public String getPrimarySite() {
return _primarySite;
Expand Down Expand Up @@ -107,12 +95,4 @@ public void setDateOfDiagnosisDay(String dateOfDiagnosisDay) {
_dateOfDiagnosisDay = dateOfDiagnosisDay;
}

public String getTxStatus() {
return _txStatus;
}

public void setTxStatus(String txStatus) {
_txStatus = txStatus;
}

}
13 changes: 8 additions & 5 deletions src/main/java/com/imsweb/seerapi/client/mph/MphOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ public class MphOutput {

@JsonProperty("result")
private Result _result;
@JsonProperty("reason")
private String _reason;
@JsonProperty("applied_rules")
private List<MphRule> _appliedRules;
@JsonProperty("group_id")
private String _groupId;
@JsonProperty("group_name")
private String _groupName;
@JsonProperty("step")
private String _step;
@JsonProperty("reason")
private String _reason;
@JsonProperty("applied_rules")
private List<MphRule> _appliedRules;

public Result getResult() {
return _result;
Expand Down Expand Up @@ -64,6 +66,7 @@ public enum Result {
// indicates the two tumors are different primaries
MULTIPLE_PRIMARIES,
// indicates there is not enough information to make a proper determination
QUESTIONABLE
QUESTIONABLE,
INVALID_INPUT
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ void testDiseaseSearch() throws IOException {

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
assertEquals(6, results.getTotal().longValue());
assertEquals(6, results.getResults().size());
assertEquals(5, results.getTotal().longValue());
assertEquals(5, results.getResults().size());
assertEquals(Collections.singletonList("basophilic"), results.getTerms());

search.setSiteCategory("BAD_VALUE");
Expand Down Expand Up @@ -210,8 +210,8 @@ void testDiseaseSearch() throws IOException {

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
assertEquals(7, results.getTotal().longValue());
assertEquals(7, results.getResults().size());
assertEquals(6, results.getTotal().longValue());
assertEquals(6, results.getResults().size());
assertEquals(Collections.singletonList("basophilic"), results.getTerms());
}

Expand Down
15 changes: 9 additions & 6 deletions src/test/java/com/imsweb/seerapi/client/hcpcs/mph/MphTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.imsweb.seerapi.client.mph.MphInput;
import com.imsweb.seerapi.client.mph.MphInputPair;
import com.imsweb.seerapi.client.mph.MphOutput;
import com.imsweb.seerapi.client.mph.MphOutput.Result;
import com.imsweb.seerapi.client.mph.MphRule;
import com.imsweb.seerapi.client.mph.MphService;

Expand Down Expand Up @@ -55,8 +56,9 @@ void testMissingSite() throws IOException {
input2.setDateOfDiagnosisYear("2016");
input2.setLaterality("1");

Call<MphOutput> call = _MPH.mph(new MphInputPair(input1, input2));
assertThrows(BadRequestException.class, call::execute);
MphOutput result = _MPH.mph(new MphInputPair(input1, input2)).execute().body();
assertNotNull(result);
assertEquals(Result.INVALID_INPUT, result.getResult());
}

@Test
Expand Down Expand Up @@ -112,9 +114,9 @@ void testResults() throws IOException {
assertEquals(MphOutput.Result.MULTIPLE_PRIMARIES, result.getResult());
assertEquals("mph_2007_to_2017_breast", result.getGroupId());
assertEquals("M5", result.getStep());
assertEquals("Tumors diagnosed more than five (5) years apart are multiple primaries.", result.getReason());
assertEquals("Tumors diagnosed more than 5 years apart are multiple primaries.", result.getReason());
assertEquals(2, result.getAppliedRules().size());
assertEquals("Are there tumors diagnosed more than five (5) years apart?", result.getAppliedRules().get(1).getQuestion());
assertEquals("Are there tumors diagnosed more than 5 years apart?", result.getAppliedRules().get(1).getQuestion());
}

@Test
Expand Down Expand Up @@ -160,8 +162,9 @@ void testInvalidInput() throws IOException {
i1.setDateOfDiagnosisYear("2015");
i2.setDateOfDiagnosisYear("2015");

Call<MphOutput> call = _MPH.mph(new MphInputPair(i1, i2));
assertThrows(BadRequestException.class, call::execute);
MphOutput result = _MPH.mph(new MphInputPair(i1, i2)).execute().body();
assertNotNull(result);
assertEquals(MphOutput.Result.INVALID_INPUT, result.getResult());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void testNaaccrXmlField() throws IOException {
assertThat(name.getRecordTypes()).containsExactly("A", "M", "C", "I");
assertThat(name.getDataType()).isEqualTo("digits");
assertThat(name.getLength()).isEqualTo(2);
assertThat(name.getPadType()).isEqualTo("rightBlank");
assertThat(name.getPadType()).isEqualTo("none");
assertThat(name.getTrimType()).isEqualTo("all");
assertThat(name.getAllowUnlimitedText()).isFalse();
assertThat(name.getDocumentation()).isNotEmpty();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/imsweb/seerapi/client/rx/RxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ void testRxSearch() throws IOException {

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
assertEquals(8, results.getTotal().longValue());
assertEquals(8, results.getResults().size());
assertEquals(7, results.getTotal().longValue());
assertEquals(7, results.getResults().size());
assertEquals(Collections.singletonList("abt"), results.getTerms());

search.setMode(PublishableSearch.SearchMode.OR);
Expand Down