aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala
index 82759ab..bd448b3 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala
@@ -19,7 +19,7 @@ object patienthypothesis {
case _ => deserializationError(s"Expected Json Object as partial PatientHypothesis, but got $json")
}
- implicit val patientHypothesisWriter: RootJsonWriter[RichPatientHypothesis] =
+ implicit val richPatientHypothesisWriter: RootJsonWriter[RichPatientHypothesis] =
new RootJsonWriter[RichPatientHypothesis] {
override def write(obj: RichPatientHypothesis): JsValue = {
JsObject(
@@ -33,4 +33,17 @@ object patienthypothesis {
}
}
+ implicit val patientHypothesisWriter: RootJsonWriter[PatientHypothesis] =
+ new RootJsonWriter[PatientHypothesis] {
+ override def write(obj: PatientHypothesis): JsValue = {
+ JsObject(
+ "id" -> obj.id.toJson,
+ "patientId" -> obj.patientId.toJson,
+ "hypothesisId" -> obj.hypothesisId.toJson,
+ "matchedTrials" -> obj.matchedTrials.toJson,
+ "rationale" -> obj.rationale.toJson
+ )
+ }
+ }
+
}