aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/evidence/ApiPatientLabelEvidence.scala28
1 files changed, 12 insertions, 16 deletions
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
+ )
}