1
0
mirror of https://github.com/dnpm-dip/mv64e-mtb-dto-java.git synced 2025-07-01 18:22:54 +00:00

Merge pull request #5 from pcvolkmer/add_ihc_therapy

Add IHC report and Therapies
This commit is contained in:
2024-12-24 13:53:29 +01:00
committed by GitHub
17 changed files with 405 additions and 18 deletions

View File

@ -3,15 +3,15 @@ package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.annotation.*;
public class CodingEcog { public class CodingEcog {
private PurpleCode code; private EcogCode code;
private String display; private String display;
private String system; private String system;
private String version; private String version;
@JsonProperty("code") @JsonProperty("code")
public PurpleCode getCode() { return code; } public EcogCode getCode() { return code; }
@JsonProperty("code") @JsonProperty("code")
public void setCode(PurpleCode value) { this.code = value; } public void setCode(EcogCode value) { this.code = value; }
@JsonProperty("display") @JsonProperty("display")
public String getDisplay() { return display; } public String getDisplay() { return display; }

View File

@ -0,0 +1,30 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
public class CodingProteinExpressionIcScore {
private ICScoreCode code;
private String display;
private String system;
private String version;
@JsonProperty("code")
public ICScoreCode getCode() { return code; }
@JsonProperty("code")
public void setCode(ICScoreCode value) { this.code = value; }
@JsonProperty("display")
public String getDisplay() { return display; }
@JsonProperty("display")
public void setDisplay(String value) { this.display = value; }
@JsonProperty("system")
public String getSystem() { return system; }
@JsonProperty("system")
public void setSystem(String value) { this.system = value; }
@JsonProperty("version")
public String getVersion() { return version; }
@JsonProperty("version")
public void setVersion(String value) { this.version = value; }
}

View File

@ -0,0 +1,30 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
public class CodingProteinExpressionResult {
private ProteinExpressionResultCode code;
private String display;
private String system;
private String version;
@JsonProperty("code")
public ProteinExpressionResultCode getCode() { return code; }
@JsonProperty("code")
public void setCode(ProteinExpressionResultCode value) { this.code = value; }
@JsonProperty("display")
public String getDisplay() { return display; }
@JsonProperty("display")
public void setDisplay(String value) { this.display = value; }
@JsonProperty("system")
public String getSystem() { return system; }
@JsonProperty("system")
public void setSystem(String value) { this.system = value; }
@JsonProperty("version")
public String getVersion() { return version; }
@JsonProperty("version")
public void setVersion(String value) { this.version = value; }
}

View File

@ -0,0 +1,30 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
public class CodingProteinExpressionTcScore {
private TcScoreCode code;
private String display;
private String system;
private String version;
@JsonProperty("code")
public TcScoreCode getCode() { return code; }
@JsonProperty("code")
public void setCode(TcScoreCode value) { this.code = value; }
@JsonProperty("display")
public String getDisplay() { return display; }
@JsonProperty("display")
public void setDisplay(String value) { this.display = value; }
@JsonProperty("system")
public String getSystem() { return system; }
@JsonProperty("system")
public void setSystem(String value) { this.system = value; }
@JsonProperty("version")
public String getVersion() { return version; }
@JsonProperty("version")
public void setVersion(String value) { this.version = value; }
}

View File

@ -3,15 +3,15 @@ package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.annotation.*;
public class CodingRecist { public class CodingRecist {
private FluffyCode code; private RecistCode code;
private String display; private String display;
private String system; private String system;
private String version; private String version;
@JsonProperty("code") @JsonProperty("code")
public FluffyCode getCode() { return code; } public RecistCode getCode() { return code; }
@JsonProperty("code") @JsonProperty("code")
public void setCode(FluffyCode value) { this.code = value; } public void setCode(RecistCode value) { this.code = value; }
@JsonProperty("display") @JsonProperty("display")
public String getDisplay() { return display; } public String getDisplay() { return display; }

View File

@ -3,7 +3,7 @@ package dev.pcvolkmer.mv64e.mtb;
import java.io.IOException; import java.io.IOException;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.annotation.*;
public enum PurpleCode { public enum EcogCode {
CODE_0, CODE_1, CODE_2, CODE_3, CODE_4; CODE_0, CODE_1, CODE_2, CODE_3, CODE_4;
@JsonValue @JsonValue
@ -19,7 +19,7 @@ public enum PurpleCode {
} }
@JsonCreator @JsonCreator
public static PurpleCode forValue(String value) throws IOException { public static EcogCode forValue(String value) throws IOException {
switch (value) { switch (value) {
case "0": case "0":
return CODE_0; return CODE_0;
@ -32,6 +32,6 @@ public enum PurpleCode {
case "4": case "4":
return CODE_4; return CODE_4;
} }
throw new IOException("Cannot deserialize PurpleCode"); throw new IOException("Cannot deserialize EcogCode");
} }
} }

View File

@ -0,0 +1,34 @@
package dev.pcvolkmer.mv64e.mtb;
import java.io.IOException;
import com.fasterxml.jackson.annotation.*;
public enum ICScoreCode {
CODE_0, CODE_1, CODE_2, CODE_3;
@JsonValue
public String toValue() {
switch (this) {
case CODE_0: return "0";
case CODE_1: return "1";
case CODE_2: return "2";
case CODE_3: return "3";
}
return null;
}
@JsonCreator
public static ICScoreCode forValue(String value) throws IOException {
switch (value) {
case "0":
return CODE_0;
case "1":
return CODE_1;
case "2":
return CODE_2;
case "3":
return CODE_3;
}
throw new IOException("Cannot deserialize ICScoreCode");
}
}

View File

@ -0,0 +1,58 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
import java.util.Date;
import java.util.List;
public class IHCReport {
private ExternalId blockId;
private Date date;
private String id;
private ExternalId journalId;
private List<MSIMmrResult> msiMmrResults;
private Reference patient;
private List<ProteinExpressionResult> proteinExpressionResults;
private Reference specimen;
@JsonProperty("blockId")
public ExternalId getBlockId() { return blockId; }
@JsonProperty("blockId")
public void setBlockId(ExternalId value) { this.blockId = value; }
@JsonProperty("date")
@JsonFormat(pattern = "yyyy-MM-dd")
public Date getDate() { return date; }
@JsonProperty("date")
@JsonFormat(pattern = "yyyy-MM-dd")
public void setDate(Date value) { this.date = value; }
@JsonProperty("id")
public String getId() { return id; }
@JsonProperty("id")
public void setId(String value) { this.id = value; }
@JsonProperty("journalId")
public ExternalId getJournalId() { return journalId; }
@JsonProperty("journalId")
public void setJournalId(ExternalId value) { this.journalId = value; }
@JsonProperty("msiMmrResults")
public List<MSIMmrResult> getMsiMmrResults() { return msiMmrResults; }
@JsonProperty("msiMmrResults")
public void setMsiMmrResults(List<MSIMmrResult> value) { this.msiMmrResults = value; }
@JsonProperty("patient")
public Reference getPatient() { return patient; }
@JsonProperty("patient")
public void setPatient(Reference value) { this.patient = value; }
@JsonProperty("proteinExpressionResults")
public List<ProteinExpressionResult> getProteinExpressionResults() { return proteinExpressionResults; }
@JsonProperty("proteinExpressionResults")
public void setProteinExpressionResults(List<ProteinExpressionResult> value) { this.proteinExpressionResults = value; }
@JsonProperty("specimen")
public Reference getSpecimen() { return specimen; }
@JsonProperty("specimen")
public void setSpecimen(Reference value) { this.specimen = value; }
}

View File

@ -0,0 +1,48 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
public class MSIMmrResult {
private CodingProteinExpressionIcScore icScore;
private String id;
private Reference patient;
private Coding protein;
private CodingProteinExpressionTcScore tcScore;
private Long tpsScore;
private CodingProteinExpressionResult value;
@JsonProperty("icScore")
public CodingProteinExpressionIcScore getIcScore() { return icScore; }
@JsonProperty("icScore")
public void setIcScore(CodingProteinExpressionIcScore value) { this.icScore = value; }
@JsonProperty("id")
public String getId() { return id; }
@JsonProperty("id")
public void setId(String value) { this.id = value; }
@JsonProperty("patient")
public Reference getPatient() { return patient; }
@JsonProperty("patient")
public void setPatient(Reference value) { this.patient = value; }
@JsonProperty("protein")
public Coding getProtein() { return protein; }
@JsonProperty("protein")
public void setProtein(Coding value) { this.protein = value; }
@JsonProperty("tcScore")
public CodingProteinExpressionTcScore getTcScore() { return tcScore; }
@JsonProperty("tcScore")
public void setTcScore(CodingProteinExpressionTcScore value) { this.tcScore = value; }
@JsonProperty("tpsScore")
public Long getTpsScore() { return tpsScore; }
@JsonProperty("tpsScore")
public void setTpsScore(Long value) { this.tpsScore = value; }
@JsonProperty("value")
public CodingProteinExpressionResult getValue() { return value; }
@JsonProperty("value")
public void setValue(CodingProteinExpressionResult value) { this.value = value; }
}

View File

@ -5,7 +5,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
public class MTBMedicationTherapy { public class MTBMedicationTherapy {
private String basedOn; private Reference basedOn;
private String diagnosis; private String diagnosis;
private String id; private String id;
private Reference indication; private Reference indication;
@ -19,9 +19,9 @@ public class MTBMedicationTherapy {
private Long therapyLine; private Long therapyLine;
@JsonProperty("basedOn") @JsonProperty("basedOn")
public String getBasedOn() { return basedOn; } public Reference getBasedOn() { return basedOn; }
@JsonProperty("basedOn") @JsonProperty("basedOn")
public void setBasedOn(String value) { this.basedOn = value; } public void setBasedOn(Reference value) { this.basedOn = value; }
@JsonProperty("diagnosis") @JsonProperty("diagnosis")
public String getDiagnosis() { return diagnosis; } public String getDiagnosis() { return diagnosis; }

View File

@ -14,6 +14,7 @@ public class Mtb {
private List<OncoProdecure> guidelineProcedures; private List<OncoProdecure> guidelineProcedures;
private List<MTBMedicationTherapy> guidelineTherapies; private List<MTBMedicationTherapy> guidelineTherapies;
private List<HistologyReport> histologyReports; private List<HistologyReport> histologyReports;
private List<IHCReport> ihcReports;
private List<MolecularTherapy> molecularTherapies; private List<MolecularTherapy> molecularTherapies;
private List<SomaticNgsReport> ngsReports; private List<SomaticNgsReport> ngsReports;
private MtbPatient patient; private MtbPatient patient;
@ -22,6 +23,7 @@ public class Mtb {
private List<Response> responses; private List<Response> responses;
private List<TumorSpecimen> specimens; private List<TumorSpecimen> specimens;
private List<StudyEnrollmentRecommendation> studyInclusionRequests; private List<StudyEnrollmentRecommendation> studyInclusionRequests;
private List<Therapy> therapies;
@JsonProperty("carePlans") @JsonProperty("carePlans")
public List<MTBCarePlan> getCarePlans() { return carePlans; } public List<MTBCarePlan> getCarePlans() { return carePlans; }
@ -73,6 +75,11 @@ public class Mtb {
@JsonProperty("histologyReports") @JsonProperty("histologyReports")
public void setHistologyReports(List<HistologyReport> value) { this.histologyReports = value; } public void setHistologyReports(List<HistologyReport> value) { this.histologyReports = value; }
@JsonProperty("ihcReports")
public List<IHCReport> getIhcReports() { return ihcReports; }
@JsonProperty("ihcReports")
public void setIhcReports(List<IHCReport> value) { this.ihcReports = value; }
@JsonProperty("molecularTherapies") @JsonProperty("molecularTherapies")
public List<MolecularTherapy> getMolecularTherapies() { return molecularTherapies; } public List<MolecularTherapy> getMolecularTherapies() { return molecularTherapies; }
@JsonProperty("molecularTherapies") @JsonProperty("molecularTherapies")
@ -112,4 +119,9 @@ public class Mtb {
public List<StudyEnrollmentRecommendation> getStudyInclusionRequests() { return studyInclusionRequests; } public List<StudyEnrollmentRecommendation> getStudyInclusionRequests() { return studyInclusionRequests; }
@JsonProperty("studyInclusionRequests") @JsonProperty("studyInclusionRequests")
public void setStudyInclusionRequests(List<StudyEnrollmentRecommendation> value) { this.studyInclusionRequests = value; } public void setStudyInclusionRequests(List<StudyEnrollmentRecommendation> value) { this.studyInclusionRequests = value; }
@JsonProperty("therapies")
public List<Therapy> getTherapies() { return therapies; }
@JsonProperty("therapies")
public void setTherapies(List<Therapy> value) { this.therapies = value; }
} }

View File

@ -0,0 +1,48 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
public class ProteinExpressionResult {
private CodingProteinExpressionIcScore icScore;
private String id;
private Reference patient;
private Coding protein;
private CodingProteinExpressionTcScore tcScore;
private Long tpsScore;
private CodingProteinExpressionResult value;
@JsonProperty("icScore")
public CodingProteinExpressionIcScore getIcScore() { return icScore; }
@JsonProperty("icScore")
public void setIcScore(CodingProteinExpressionIcScore value) { this.icScore = value; }
@JsonProperty("id")
public String getId() { return id; }
@JsonProperty("id")
public void setId(String value) { this.id = value; }
@JsonProperty("patient")
public Reference getPatient() { return patient; }
@JsonProperty("patient")
public void setPatient(Reference value) { this.patient = value; }
@JsonProperty("protein")
public Coding getProtein() { return protein; }
@JsonProperty("protein")
public void setProtein(Coding value) { this.protein = value; }
@JsonProperty("tcScore")
public CodingProteinExpressionTcScore getTcScore() { return tcScore; }
@JsonProperty("tcScore")
public void setTcScore(CodingProteinExpressionTcScore value) { this.tcScore = value; }
@JsonProperty("tpsScore")
public Long getTpsScore() { return tpsScore; }
@JsonProperty("tpsScore")
public void setTpsScore(Long value) { this.tpsScore = value; }
@JsonProperty("value")
public CodingProteinExpressionResult getValue() { return value; }
@JsonProperty("value")
public void setValue(CodingProteinExpressionResult value) { this.value = value; }
}

View File

@ -0,0 +1,40 @@
package dev.pcvolkmer.mv64e.mtb;
import java.io.IOException;
import com.fasterxml.jackson.annotation.*;
public enum ProteinExpressionResultCode {
EXP, NOT_EXP, CODE_1_PLUS, CODE_2_PLUS, CODE_3_PLUS, UNKNOWN;
@JsonValue
public String toValue() {
switch (this) {
case EXP: return "exp";
case NOT_EXP: return "not-exp";
case CODE_1_PLUS: return "1+";
case CODE_2_PLUS: return "2+";
case CODE_3_PLUS: return "3+";
case UNKNOWN: return "unknown";
}
return null;
}
@JsonCreator
public static ProteinExpressionResultCode forValue(String value) throws IOException {
switch (value) {
case "exp":
return EXP;
case "not-exp":
return NOT_EXP;
case "1+":
return CODE_1_PLUS;
case "2+":
return CODE_2_PLUS;
case "3+":
return CODE_3_PLUS;
case "unknown":
return UNKNOWN;
}
throw new IOException("Cannot deserialize PurpleCode");
}
}

View File

@ -3,7 +3,7 @@ package dev.pcvolkmer.mv64e.mtb;
import java.io.IOException; import java.io.IOException;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.annotation.*;
public enum FluffyCode { public enum RecistCode {
CR, MR, NA, NYA, PD, PR, SD; CR, MR, NA, NYA, PD, PR, SD;
@JsonValue @JsonValue
@ -21,7 +21,7 @@ public enum FluffyCode {
} }
@JsonCreator @JsonCreator
public static FluffyCode forValue(String value) throws IOException { public static RecistCode forValue(String value) throws IOException {
switch (value) { switch (value) {
case "CR": case "CR":
return CR; return CR;
@ -38,6 +38,6 @@ public enum FluffyCode {
case "SD": case "SD":
return SD; return SD;
} }
throw new IOException("Cannot deserialize FluffyCode"); throw new IOException("Cannot deserialize RecistCode");
} }
} }

View File

@ -0,0 +1,43 @@
package dev.pcvolkmer.mv64e.mtb;
import java.io.IOException;
import com.fasterxml.jackson.annotation.*;
public enum TcScoreCode {
CODE_0, CODE_1, CODE_2, CODE_3, CODE_4, CODE_5, CODE_6;
@JsonValue
public String toValue() {
switch (this) {
case CODE_0: return "0";
case CODE_1: return "1";
case CODE_2: return "2";
case CODE_3: return "3";
case CODE_4: return "4";
case CODE_5: return "5";
case CODE_6: return "6";
}
return null;
}
@JsonCreator
public static TcScoreCode forValue(String value) throws IOException {
switch (value) {
case "0":
return CODE_0;
case "1":
return CODE_1;
case "2":
return CODE_2;
case "3":
return CODE_3;
case "4":
return CODE_4;
case "5":
return CODE_5;
case "6":
return CODE_6;
}
throw new IOException("Cannot deserialize TcScoreCode");
}
}

View File

@ -0,0 +1,13 @@
package dev.pcvolkmer.mv64e.mtb;
import com.fasterxml.jackson.annotation.*;
import java.util.List;
public class Therapy {
private List<MTBMedicationTherapy> history;
@JsonProperty("history")
public List<MTBMedicationTherapy> getHistory() { return history; }
@JsonProperty("history")
public void setHistory(List<MTBMedicationTherapy> value) { this.history = value; }
}

View File

@ -4,13 +4,14 @@ import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
public class ConverterTest { import static org.junit.jupiter.api.Assertions.assertNotNull;
class ConverterTest {
@Test @Test
void shouldDeserializeJsonString() throws IOException { void shouldDeserializeJsonString() throws IOException {
var ressource = getClass().getClassLoader().getResource("mv64e-mtb-fake-patient.json"); var ressource = getClass().getClassLoader().getResource("mv64e-mtb-fake-patient.json");
assertNotNull(Converter.fromJsonString(new String(ressource.openStream().readAllBytes())));
Converter.fromJsonString(new String(ressource.openStream().readAllBytes()));
} }
} }