aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2017-10-10 11:22:11 -0700
committerMarvin Bertin <marvin.bertin@gmail.com>2017-10-10 11:22:11 -0700
commit05aa114cfd22228f0457b6457ce441af5eabfc60 (patch)
tree62acecf547f01ca4d69fcd4c7c911e0899e9d96c /src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala
parent0be360064e7b46eb0ebeac3bfde09d5e80c21d81 (diff)
parent6751966577c0f005858f372458ccdb72be7d879f (diff)
downloadrest-query-05aa114cfd22228f0457b6457ce441af5eabfc60.tar.gz
rest-query-05aa114cfd22228f0457b6457ce441af5eabfc60.tar.bz2
rest-query-05aa114cfd22228f0457b6457ce441af5eabfc60.zip
Merge branch 'master' into trial-46-disease-entity
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala
index 3b52833..b36949e 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala
@@ -3,6 +3,7 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats
import spray.json._
import xyz.driver.pdsuicommon.domain.FuzzyValue
import xyz.driver.pdsuidomain.entities._
+import xyz.driver.pdsuidomain.services.PatientLabelService.RichPatientLabel
object patientlabel {
import DefaultJsonProtocol._
@@ -28,25 +29,23 @@ object patientlabel {
case _ => deserializationError(s"Expected Json Object as PatientLabel, but got $json")
}
- implicit val patientLabelWriter: JsonWriter[(PatientLabel, Boolean)] = new JsonWriter[(PatientLabel, Boolean)] {
- override def write(obj: (PatientLabel, Boolean)): JsValue = {
- val patientLabel = obj._1
- val isVerified = obj._2
+ implicit val richPatientLabelWriter: RootJsonWriter[RichPatientLabel] = new RootJsonWriter[RichPatientLabel] {
+ override def write(obj: RichPatientLabel): JsValue = {
JsObject(
- "id" -> patientLabel.id.toJson,
- "labelId" -> patientLabel.labelId.toJson,
- "primaryValue" -> patientLabel.primaryValue.toJson,
- "verifiedPrimaryValue" -> patientLabel.verifiedPrimaryValue.toJson,
- "score" -> patientLabel.score.toJson,
- "isImplicitMatch" -> patientLabel.isImplicitMatch.toJson,
- "isVisible" -> patientLabel.isVisible.toJson,
- "isVerified" -> isVerified.toJson
+ "id" -> obj.patientLabel.id.toJson,
+ "labelId" -> obj.patientLabel.labelId.toJson,
+ "primaryValue" -> obj.patientLabel.primaryValue.toJson,
+ "verifiedPrimaryValue" -> obj.patientLabel.verifiedPrimaryValue.toJson,
+ "score" -> obj.patientLabel.score.toJson,
+ "isImplicitMatch" -> obj.patientLabel.isImplicitMatch.toJson,
+ "isVisible" -> obj.patientLabel.isVisible.toJson,
+ "isVerified" -> obj.isVerified.toJson
)
}
}
- implicit val patientLabelEvidenceWriter: JsonWriter[PatientLabelEvidenceView] =
- new JsonWriter[PatientLabelEvidenceView] {
+ implicit val patientLabelEvidenceWriter: RootJsonWriter[PatientLabelEvidenceView] =
+ new RootJsonWriter[PatientLabelEvidenceView] {
override def write(evidence: PatientLabelEvidenceView): JsValue =
JsObject(
"id" -> evidence.id.toJson,