diff options
author | vlad <vlad@driver.xyz> | 2017-10-09 12:24:59 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-10-09 12:24:59 -0700 |
commit | 7d8712a62d30b412717e1b730c0ad267cd207aa4 (patch) | |
tree | 76662e1b233943c1c840a658682aac9766aa64d7 /src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats | |
parent | 52b5e1a5febc91aa316565fdea309df2b646481e (diff) | |
download | rest-query-7d8712a62d30b412717e1b730c0ad267cd207aa4.tar.gz rest-query-7d8712a62d30b412717e1b730c0ad267cd207aa4.tar.bz2 rest-query-7d8712a62d30b412717e1b730c0ad267cd207aa4.zip |
Getting rid of the FuzzyValues, Name as a string, and condition
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats')
8 files changed, 19 insertions, 19 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/common.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/common.scala index dbd0a43..61e0e7f 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/common.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/common.scala @@ -3,7 +3,7 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import java.time.{LocalDate, LocalDateTime, ZoneId, ZonedDateTime} import spray.json._ -import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId, StringId, UuidId} +import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId} object common { @@ -55,14 +55,6 @@ object common { } } - implicit def fuzzyValueFormat: RootJsonFormat[FuzzyValue] = new RootJsonFormat[FuzzyValue] { - override def write(value: FuzzyValue): JsString = JsString(FuzzyValue.valueToString(value)) - override def read(json: JsValue): FuzzyValue = json match { - case JsString(value) => FuzzyValue.fromString(value) - case _ => deserializationError(s"Expected value as FuzzyValue, but got $json") - } - } - implicit val integerFormat: RootJsonFormat[Integer] = new RootJsonFormat[Integer] { override def write(obj: Integer): JsNumber = JsNumber(obj.intValue()) override def read(json: JsValue): Integer = json match { diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/export.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/export.scala index 39d5c59..85d614d 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/export.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/export.scala @@ -5,6 +5,7 @@ import xyz.driver.entities.labels.Label import xyz.driver.pdsuidomain.entities.{Arm, Criterion} import xyz.driver.pdsuidomain.entities.export.patient._ import xyz.driver.pdsuidomain.entities.export.trial.{ExportTrialArm, ExportTrialLabelCriterion, ExportTrialWithLabels} +import xyz.driver.formats.json.labels._ object export { import DefaultJsonProtocol._ diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/extracteddata.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/extracteddata.scala index d6eadbd..5d5585a 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/extracteddata.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/extracteddata.scala @@ -1,10 +1,11 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ -import xyz.driver.entities.labels.{Label, LabelCategory} -import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId, TextJson} +import xyz.driver.entities.labels.{Label, LabelCategory, LabelValue} +import xyz.driver.pdsuicommon.domain.{LongId, TextJson} import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.services.ExtractedDataService.RichExtractedData +import xyz.driver.formats.json.labels._ object extracteddata { import DefaultJsonProtocol._ @@ -44,7 +45,7 @@ object extracteddata { val value = fields .get("value") - .map(_.convertTo[FuzzyValue]) + .map(_.convertTo[LabelValue]) ExtractedDataLabel( id = LongId(0), diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patient.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patient.scala index 95c0674..3da76c1 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patient.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patient.scala @@ -3,6 +3,8 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ import xyz.driver.core.json.EnumJsonFormat import xyz.driver.pdsuidomain.entities._ +import xyz.driver.formats.json.common._ +import xyz.driver.formats.json.patient._ object patient { import DefaultJsonProtocol._ @@ -38,7 +40,7 @@ object patient { "previousAssignee" -> patient.previousAssignee.toJson, "lastActiveUser" -> patient.lastActiveUserId.toJson, "lastUpdate" -> patient.lastUpdate.toJson, - "condition" -> patient.condition.toJson, + "condition" -> patient.cancerType.toJson, "orderId" -> patient.orderId.toJson ) } diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientcriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientcriterion.scala index affb346..7e8c220 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientcriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientcriterion.scala @@ -1,9 +1,10 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ -import xyz.driver.pdsuicommon.domain.FuzzyValue +import xyz.driver.entities.labels.LabelValue import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.services.PatientCriterionService.{DraftPatientCriterion, RichPatientCriterion} +import xyz.driver.formats.json.labels._ object patientcriterion { import DefaultJsonProtocol._ @@ -14,13 +15,13 @@ object patientcriterion { val eligibilityStatus = if (fields.contains("eligibilityStatus")) { fields .get("eligibilityStatus") - .map(_.convertTo[FuzzyValue]) + .map(_.convertTo[LabelValue]) } else orig.eligibilityStatus val verifiedEligibilityStatus = if (fields.contains("verifiedEligibilityStatus")) { fields .get("verifiedEligibilityStatus") - .map(_.convertTo[FuzzyValue]) + .map(_.convertTo[LabelValue]) } else orig.verifiedEligibilityStatus orig.copy( diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientdefiningcriteria.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientdefiningcriteria.scala index 0520ef2..746c7b4 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientdefiningcriteria.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientdefiningcriteria.scala @@ -2,6 +2,7 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ import xyz.driver.pdsuidomain.entities.PatientLabel +import xyz.driver.formats.json.labels._ object patientdefiningcriteria { import DefaultJsonProtocol._ diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienteligibletrial.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienteligibletrial.scala index 041d9da..342d3a8 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienteligibletrial.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patienteligibletrial.scala @@ -3,6 +3,7 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.services.PatientEligibleTrialService.RichPatientEligibleTrial +import xyz.driver.formats.json.labels._ object patienteligibletrial { import DefaultJsonProtocol._ 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 b36949e..ff6d24d 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 @@ -1,9 +1,10 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ -import xyz.driver.pdsuicommon.domain.FuzzyValue +import xyz.driver.entities.labels.LabelValue import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.services.PatientLabelService.RichPatientLabel +import xyz.driver.formats.json.labels._ object patientlabel { import DefaultJsonProtocol._ @@ -13,12 +14,12 @@ object patientlabel { case JsObject(fields) => val primaryValue = fields .get("primaryValue") - .map(_.convertTo[Option[FuzzyValue]]) + .map(_.convertTo[Option[LabelValue]]) .getOrElse(orig.primaryValue) val verifiedPrimaryValue = fields .get("verifiedPrimaryValue") - .map(_.convertTo[Option[FuzzyValue]]) + .map(_.convertTo[Option[LabelValue]]) .getOrElse(orig.verifiedPrimaryValue) orig.copy( |