diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-10-04 16:23:04 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-10-04 16:23:04 +0700 |
commit | 7446fbcb6f51ae67ae8bf0f54729e774da8e7f73 (patch) | |
tree | 667c0f62d13561732096c2c9b251e3a227abfbe0 /src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienthypothesis.scala | |
parent | 996af2657cdd779e08e46fc1ba5f47d9e7c5aac5 (diff) | |
download | rest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.tar.gz rest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.tar.bz2 rest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.zip |
Implemented new spray json formats for PatientHypothesis and PatientLabel
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.scala | 15 |
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 + ) + } + } + } |