aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2017-10-03 13:08:00 -0700
committerMarvin Bertin <marvin.bertin@gmail.com>2017-10-03 13:08:00 -0700
commit0653b90dddc294fddb0e81059aef00b202113d78 (patch)
tree3d8abb424b0f0495f1cbb18849184dd20d6897fc /src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala
parent5750f2f3633e75f2f96d6a36264ab4b8f3fec7d2 (diff)
parenta321a978353439fc516b0f2016c28fb32ba1b7ae (diff)
downloadrest-query-0653b90dddc294fddb0e81059aef00b202113d78.tar.gz
rest-query-0653b90dddc294fddb0e81059aef00b202113d78.tar.bz2
rest-query-0653b90dddc294fddb0e81059aef00b202113d78.zip
Merge branch 'master' into add-slot-eligibility-arms
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala
deleted file mode 100644
index d141762..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-package xyz.driver.pdsuidomain.formats.json.export
-
-import play.api.libs.functional.syntax._
-import play.api.libs.json._
-import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId}
-import xyz.driver.pdsuidomain.entities.export.patient.ExportPatientLabelEvidence
-
-final case class ApiExportPatientLabelEvidence(evidenceId: String,
- labelValue: String,
- evidenceText: String,
- document: ApiExportPatientLabelEvidenceDocument) {
-
- def toDomain = ExportPatientLabelEvidence(
- id = LongId(this.evidenceId.toLong),
- value = FuzzyValue.fromString
- .applyOrElse(this.labelValue, (s: String) => throw new NoSuchElementException(s"Unknown fuzzy value $s")),
- evidenceText = this.evidenceText,
- document = this.document.toDomain
- )
-
-}
-
-object ApiExportPatientLabelEvidence {
-
- implicit val format: Format[ApiExportPatientLabelEvidence] = (
- (JsPath \ "evidenceId").format[String] and
- (JsPath \ "labelValue").format[String](Writes[String](x => JsString(x.toUpperCase))) and
- (JsPath \ "evidenceText").format[String] and
- (JsPath \ "document").format[ApiExportPatientLabelEvidenceDocument]
- )(ApiExportPatientLabelEvidence.apply, unlift(ApiExportPatientLabelEvidence.unapply))
-
- def fromDomain(evidence: ExportPatientLabelEvidence) = ApiExportPatientLabelEvidence(
- evidenceId = evidence.id.toString,
- labelValue = FuzzyValue.valueToString(evidence.value),
- evidenceText = evidence.evidenceText,
- document = ApiExportPatientLabelEvidenceDocument.fromDomain(evidence.document)
- )
-}