diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-20 16:25:04 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-20 16:25:04 +0700 |
commit | 54b15dae509212f6661dc1f1bc4ca248cb487443 (patch) | |
tree | 85b1ceafd9a56da511513797bd263977f52b556c /src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala | |
parent | 6d6e732368e97e319653f00e498189afceeb4671 (diff) | |
download | rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.tar.gz rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.tar.bz2 rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.zip |
PDSUI-2336 Deleted api classes of play format, userhistory and message services
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.scala | 66 |
1 files changed, 0 insertions, 66 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 deleted file mode 100644 index 57dca1e..0000000 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/patientlabel.scala +++ /dev/null @@ -1,66 +0,0 @@ -package xyz.driver.pdsuidomain.formats.json.sprayformats - -import spray.json._ -import xyz.driver.entities.labels.LabelValue -import xyz.driver.pdsuidomain.entities._ -import xyz.driver.pdsuidomain.services.PatientLabelService.RichPatientLabel -import xyz.driver.formats.json.labels._ -import xyz.driver.pdsuidomain.formats.json.sprayformats.record._ -import xyz.driver.pdsuidomain.formats.json.sprayformats.document._ - -object patientlabel { - import DefaultJsonProtocol._ - import common._ - - def applyUpdateToPatientLabel(json: JsValue, orig: PatientLabel): PatientLabel = json match { - case JsObject(fields) => - val primaryValue = fields - .get("primaryValue") - .map(_.convertTo[Option[LabelValue]]) - .getOrElse(orig.primaryValue) - - val verifiedPrimaryValue = fields - .get("verifiedPrimaryValue") - .map(_.convertTo[Option[LabelValue]]) - .getOrElse(orig.verifiedPrimaryValue) - - orig.copy( - primaryValue = primaryValue, - verifiedPrimaryValue = verifiedPrimaryValue - ) - - case _ => deserializationError(s"Expected Json Object as PatientLabel, but got $json") - } - - implicit val richPatientLabelWriter: RootJsonWriter[RichPatientLabel] = new RootJsonWriter[RichPatientLabel] { - override def write(obj: RichPatientLabel): JsValue = { - JsObject( - "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: RootJsonWriter[PatientLabelEvidenceView] = - new RootJsonWriter[PatientLabelEvidenceView] { - override def write(evidence: PatientLabelEvidenceView): JsValue = - JsObject( - "id" -> evidence.id.toJson, - "value" -> evidence.value.toJson, - "evidenceText" -> evidence.evidenceText.toJson, - "documentId" -> evidence.documentId.toJson, - "evidenceId" -> evidence.evidenceId.toJson, - "reportId" -> evidence.reportId.toJson, - "documentType" -> evidence.documentType.toJson, - "date" -> evidence.date.toJson, - "providerType" -> evidence.providerType.toJson - ) - } - -} |