diff options
author | vlad <vlad@driver.xyz> | 2017-09-28 13:12:32 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-09-28 13:12:32 -0700 |
commit | deba20326e3269fee3ef51f8e6841f17453b4155 (patch) | |
tree | 29aac6bf4d0cd679a39ab1e1b84aef8ce1328b3f /src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabelEvidence.scala | |
parent | c24679f1ae7d7ccc4e6693535b0aa3ac0e1ca225 (diff) | |
download | rest-query-deba20326e3269fee3ef51f8e6841f17453b4155.tar.gz rest-query-deba20326e3269fee3ef51f8e6841f17453b4155.tar.bz2 rest-query-deba20326e3269fee3ef51f8e6841f17453b4155.zip |
Simplified Export entities for EVLSv0.4.1
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.scala | 38 |
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) - ) -} |