From 96d81a36286e41035ff4068859a3b0f9da924fbc Mon Sep 17 00:00:00 2001 From: vlad Date: Fri, 30 Jun 2017 19:38:37 -0700 Subject: Latest PDS UI utils including all the domain stuff --- .../json/evidence/ApiPatientLabelEvidence.scala | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala index 2bb4945..e0f23e3 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala @@ -2,9 +2,9 @@ package xyz.driver.pdsuidomain.formats.json.evidence import java.time.LocalDate -import xyz.driver.pdsuidomain.services.PatientLabelEvidenceService import play.api.libs.json._ import xyz.driver.pdsuicommon.domain.FuzzyValue +import xyz.driver.pdsuidomain.entities.PatientLabelEvidenceView final case class ApiPatientLabelEvidence(id: Long, value: String, @@ -20,19 +20,15 @@ object ApiPatientLabelEvidence { implicit val format: Format[ApiPatientLabelEvidence] = Json.format - def fromDomain(x: PatientLabelEvidenceService.Aggregated): ApiPatientLabelEvidence = { - import x._ - - ApiPatientLabelEvidence( - id = evidence.id.id, - value = FuzzyValue.valueToString(evidence.value), - evidenceText = evidence.evidenceText, - documentId = evidence.documentId.map(_.id), - evidenceId = evidence.evidenceId.map(_.id), - reportId = evidence.reportId.map(_.toString), - documentType = documentType, - date = date, - providerType = providerType - ) - } + def fromDomain(x: PatientLabelEvidenceView) = ApiPatientLabelEvidence( + id = x.id.id, + value = FuzzyValue.valueToString(x.value), + evidenceText = x.evidenceText, + documentId = x.documentId.map(_.id), + evidenceId = x.evidenceId.map(_.id), + reportId = x.reportId.map(_.toString), + documentType = x.documentType, + date = x.date.get, + providerType = x.providerType + ) } -- cgit v1.2.3