Skip to content

Commit eb5f5b2

Browse files
authored
Merge pull request #14 from imsweb/mph
Fix MPH support
2 parents cc7fa32 + 5d6cf97 commit eb5f5b2

12 files changed

Lines changed: 249 additions & 47 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ Download [the latest JAR][1] or grab via Maven:
2929
<dependency>
3030
<groupId>com.imsweb</groupId>
3131
<artifactId>seerapi-client-java</artifactId>
32-
<version>3.4</version>
32+
<version>3.5</version>
3333
</dependency>
3434
```
3535

3636
or via Gradle:
3737

3838
```
39-
compile 'com.imsweb:seerapi-client-java:3.4'
39+
compile 'com.imsweb:seerapi-client-java:3.5'
4040
```
4141

4242
## Usage

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ plugins {
55
id 'checkstyle'
66
id 'findbugs'
77
id 'com.bmuschko.nexus' version '2.3.1'
8+
id "io.codearte.nexus-staging" version "0.8.0" // logs into Sonotype OSS and does a "Close" and "Release"
9+
id 'net.ossindex.audit' version '0.1.1'
810
}
911

1012
group = 'com.imsweb'
11-
version = '3.4'
13+
version = '3.5'
1214
description = 'Java client library for SEER*API'
1315

1416
println "Starting build using ${Jvm.current()}"
@@ -26,7 +28,7 @@ repositories {
2628
}
2729

2830
dependencies {
29-
compile 'com.squareup.retrofit2:retrofit:2.1.0'
31+
compile 'com.squareup.retrofit2:retrofit:2.2.0'
3032
compile 'com.squareup.retrofit2:converter-jackson:2.1.0'
3133

3234
testCompile 'junit:junit:4.11'
@@ -63,7 +65,7 @@ findbugs {
6365

6466
// Gradle wrapper, this allows to build the project without having to install Gradle!
6567
task wrapper(type: Wrapper) {
66-
gradleVersion = '3.2.1'
68+
gradleVersion = '4.0'
6769
}
6870

6971
modifyPom {

gradle/wrapper/gradle-wrapper.jar

479 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Dec 07 11:32:53 EST 2016
1+
#Fri Jun 16 16:42:51 EDT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip

gradlew

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/com/imsweb/seerapi/client/mph/MphInput.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
public class MphInput {
66

7+
/**
8+
* How to consider histology match, if it is strict 8000 is considered a different histology than 8010-9999
9+
* for rule : Do the tumors have ICD-O-3 histology codes that are different at the first (Xxxx), second (Xxxx), or third (xxXx) number?
10+
* If lenient mode is on 8000 is considered as NOS and be considered to match any 8nnn histologies.
11+
*/
12+
public enum HistologyMatchMode {
13+
STRICT,
14+
LENIENT
15+
}
16+
717
@JsonProperty("primary_site")
818
private String _primarySite;
919
@JsonProperty("histology_icd_o3")
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.imsweb.seerapi.client.mph;
2+
3+
import java.util.List;
4+
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
7+
public class MphOutput {
8+
9+
// The possible results of determining if two tumors are single or multiple primaries.
10+
public enum Result {
11+
// indicates the two tumors are the same primary
12+
SINGLE_PRIMARY,
13+
// indicates the two tumors are different primaries
14+
MULTIPLE_PRIMARIES,
15+
// indicates there is not enough information to make a proper determination
16+
QUESTIONABLE
17+
}
18+
19+
@JsonProperty("result")
20+
private Result _result;
21+
@JsonProperty("reason")
22+
private String _reason;
23+
@JsonProperty("applied_rules")
24+
private List<MphRule> _appliedRules;
25+
@JsonProperty("group_id")
26+
private String _groupId;
27+
@JsonProperty("step")
28+
private String _step;
29+
30+
public MphOutput() {
31+
}
32+
33+
public Result getResult() {
34+
return _result;
35+
}
36+
37+
public void setResult(Result result) {
38+
_result = result;
39+
}
40+
41+
public String getReason() {
42+
return _reason;
43+
}
44+
45+
public void setReason(String reason) {
46+
_reason = reason;
47+
}
48+
49+
public List<MphRule> getAppliedRules() {
50+
return _appliedRules;
51+
}
52+
53+
public void setAppliedRules(List<MphRule> appliedRules) {
54+
_appliedRules = appliedRules;
55+
}
56+
57+
public String getGroupId() {
58+
return _groupId;
59+
}
60+
61+
public void setGroupId(String groupId) {
62+
_groupId = groupId;
63+
}
64+
65+
public String getStep() {
66+
return _step;
67+
}
68+
69+
public void setStep(String step) {
70+
_step = step;
71+
}
72+
}

src/main/java/com/imsweb/seerapi/client/mph/MphResult.java

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (C) 2013 Information Management Services, Inc.
3+
*/
4+
package com.imsweb.seerapi.client.mph;
5+
6+
import java.util.List;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class MphRule {
11+
12+
@JsonProperty("group_id")
13+
private String _groupId;
14+
@JsonProperty("step")
15+
private String _step;
16+
@JsonProperty("question")
17+
private String _question;
18+
@JsonProperty("reason")
19+
private String _reason;
20+
@JsonProperty("notes")
21+
private List<String> _notes;
22+
@JsonProperty("examples")
23+
private List<String> _examples;
24+
25+
public MphRule() {
26+
}
27+
28+
public String getGroupId() {
29+
return _groupId;
30+
}
31+
32+
public void setGroupId(String groupId) {
33+
_groupId = groupId;
34+
}
35+
36+
public String getStep() {
37+
return _step;
38+
}
39+
40+
public void setStep(String step) {
41+
_step = step;
42+
}
43+
44+
public String getQuestion() {
45+
return _question;
46+
}
47+
48+
public void setQuestion(String question) {
49+
_question = question;
50+
}
51+
52+
public String getReason() {
53+
return _reason;
54+
}
55+
56+
public void setReason(String reason) {
57+
_reason = reason;
58+
}
59+
60+
public List<String> getNotes() {
61+
return _notes;
62+
}
63+
64+
public void setNotes(List<String> notes) {
65+
_notes = notes;
66+
}
67+
68+
public List<String> getExamples() {
69+
return _examples;
70+
}
71+
72+
public void setExamples(List<String> examples) {
73+
_examples = examples;
74+
}
75+
}

src/main/java/com/imsweb/seerapi/client/mph/MphService.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,27 @@
66
import retrofit2.Call;
77
import retrofit2.http.Body;
88
import retrofit2.http.POST;
9+
import retrofit2.http.Query;
10+
11+
import com.imsweb.seerapi.client.mph.MphInput.HistologyMatchMode;
912

1013
public interface MphService {
1114

15+
/**
16+
* Uses multiple primary rules to compare two diseases using strict histology matching mode
17+
* @param pair a pair of diseases
18+
* @return a result indicating whether the two diseases are the same primary
19+
*/
20+
@POST("mph")
21+
Call<MphOutput> mph(@Body MphInputPair pair);
22+
1223
/**
1324
* Uses multiple primary rules to compare two diseases
1425
* @param pair a pair of diseases
26+
* @param matchMode
1527
* @return a result indicating whether the two diseases are the same primary
1628
*/
1729
@POST("mph")
18-
Call<MphResult> mph(@Body MphInputPair pair);
30+
Call<MphOutput> mph(@Body MphInputPair pair, @Query("histology-matching-mode") HistologyMatchMode matchMode);
1931

2032
}

0 commit comments

Comments
 (0)