aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/entities/export/patient')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala28
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidence.scala32
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidenceDocument.scala30
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientWithLabels.scala25
4 files changed, 0 insertions, 115 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala
deleted file mode 100644
index 3b7a6ad..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-package xyz.driver.pdsuidomain.entities.export.patient
-
-import xyz.driver.pdsuicommon.domain.LongId
-import xyz.driver.pdsuicommon.logging._
-import xyz.driver.pdsuidomain.entities.{Label, RawPatientLabel}
-
-case class ExportPatientLabel(id: LongId[Label], name: String, evidences: List[ExportPatientLabelEvidence])
-
-object ExportPatientLabel extends PhiLogging {
-
- implicit def toPhiString(x: ExportPatientLabel): PhiString = {
- import x._
- phi"ExportPatientLabel(id=$id, evidences=$evidences)"
- }
-
- def fromRaw(labelId: LongId[Label], rawPatientLabels: List[RawPatientLabel]): ExportPatientLabel = {
- val firstLabel = rawPatientLabels.headOption
- if (firstLabel.isEmpty) {
- logger.warn(phi"rawPatientLabels is empty, labelId: $labelId")
- }
-
- ExportPatientLabel(
- id = labelId,
- name = firstLabel.map(_.label).getOrElse(""),
- evidences = rawPatientLabels.map(ExportPatientLabelEvidence.fromRaw)
- )
- }
-}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidence.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidence.scala
deleted file mode 100644
index ff0fb6c..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidence.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-package xyz.driver.pdsuidomain.entities.export.patient
-
-import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId}
-import xyz.driver.pdsuicommon.logging._
-import xyz.driver.pdsuidomain.entities.{ExtractedData, RawPatientLabel}
-
-case class ExportPatientLabelEvidence(id: LongId[ExtractedData],
- value: FuzzyValue,
- evidenceText: String,
- document: ExportPatientLabelEvidenceDocument)
-
-object ExportPatientLabelEvidence {
-
- implicit def toPhiString(x: ExportPatientLabelEvidence): PhiString = {
- import x._
- phi"ExportPatientLabelEvidence(id=${Unsafe(id)}, value=$value, " +
- phi"evidenceText=${Unsafe(evidenceText)}, document=$document)"
- }
-
- def fromRaw(x: RawPatientLabel) = ExportPatientLabelEvidence(
- id = x.evidenceId,
- value = x.value,
- evidenceText = x.evidenceText,
- document = ExportPatientLabelEvidenceDocument(
- x.documentId,
- x.requestId,
- x.documentType,
- x.providerType,
- x.startDate
- )
- )
-}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidenceDocument.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidenceDocument.scala
deleted file mode 100644
index 978c4b8..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabelEvidenceDocument.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-package xyz.driver.pdsuidomain.entities.export.patient
-
-import java.time.LocalDate
-
-import xyz.driver.pdsuicommon.domain.LongId
-import xyz.driver.pdsuicommon.logging._
-import xyz.driver.pdsuidomain.entities.{Document, RawPatientLabel, RecordRequestId}
-
-case class ExportPatientLabelEvidenceDocument(documentId: LongId[Document],
- requestId: RecordRequestId,
- documentType: String,
- providerType: String,
- date: LocalDate)
-
-object ExportPatientLabelEvidenceDocument extends PhiLogging {
-
- implicit def toPhiString(x: ExportPatientLabelEvidenceDocument): PhiString = {
- import x._
- phi"ExportPatientLabelEvidenceDocument(documentId=$documentId, requestId=$requestId, " +
- phi"documentType=${Unsafe(documentType)}, providerType=${Unsafe(providerType)}, date=$date)"
- }
-
- def fromRaw(x: RawPatientLabel) = ExportPatientLabelEvidenceDocument(
- documentId = x.documentId,
- requestId = x.requestId,
- documentType = x.documentType,
- providerType = x.providerType,
- date = x.startDate
- )
-}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientWithLabels.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientWithLabels.scala
deleted file mode 100644
index 718255b..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientWithLabels.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-package xyz.driver.pdsuidomain.entities.export.patient
-
-import xyz.driver.pdsuicommon.domain.UuidId
-import xyz.driver.pdsuicommon.logging._
-import xyz.driver.pdsuidomain.entities.{Patient, RawPatientLabel}
-
-import scala.collection.breakOut
-
-case class ExportPatientWithLabels(patientId: UuidId[Patient], labelVersion: Long, labels: List[ExportPatientLabel])
-
-object ExportPatientWithLabels {
-
- implicit def toPhiString(x: ExportPatientWithLabels): PhiString = {
- import x._
- phi"ExportPatientWithLabels(patientId=$patientId, version=${Unsafe(labelVersion)}, labels=$labels)"
- }
-
- def fromRaw(patientId: UuidId[Patient], rawPatientRefs: List[RawPatientLabel]) = ExportPatientWithLabels(
- patientId = patientId,
- labelVersion = 1L, // TODO It is needed to replace this mock label version.
- labels = rawPatientRefs
- .groupBy(_.labelId)
- .map(Function.tupled(ExportPatientLabel.fromRaw))(breakOut)
- )
-}