aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/RawPatientLabel.scala4
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala13
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabel.scala4
3 files changed, 4 insertions, 17 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/RawPatientLabel.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/RawPatientLabel.scala
index e7956a8..6114661 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/RawPatientLabel.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/entities/RawPatientLabel.scala
@@ -7,7 +7,6 @@ import xyz.driver.pdsuicommon.logging._
final case class RawPatientLabel(patientId: UuidId[Patient],
labelId: LongId[Label],
- label: String,
value: FuzzyValue,
evidenceId: LongId[ExtractedData],
evidenceText: String,
@@ -23,8 +22,7 @@ object RawPatientLabel {
implicit def toPhiString(x: RawPatientLabel): PhiString = {
import x._
- phi"RawPatientLabel(patientId=$patientId, labelId=$labelId, label=${Unsafe(label)}, value=$value," +
- phi"evidenceId=${Unsafe(evidenceId)}, " +
+ phi"RawPatientLabel(patientId=$patientId, labelId=$labelId, value=$value, evidenceId=${Unsafe(evidenceId)}, " +
phi"evidenceText=${Unsafe(evidenceText)}, documentId=$documentId, requestId=${Unsafe(requestId)}, " +
phi"documentType=${Unsafe(documentType)}, providerType=${Unsafe(providerType)}, " +
phi"startDate=$startDate, endDate=$endDate)"
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
index 5135c21..c69fc09 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/entities/export/patient/ExportPatientLabel.scala
@@ -4,7 +4,7 @@ import xyz.driver.pdsuicommon.domain.LongId
import xyz.driver.pdsuicommon.logging._
import xyz.driver.pdsuidomain.entities.{Label, RawPatientLabel}
-final case class ExportPatientLabel(id: LongId[Label], name: String, evidences: List[ExportPatientLabelEvidence])
+final case class ExportPatientLabel(id: LongId[Label], evidences: List[ExportPatientLabelEvidence])
object ExportPatientLabel extends PhiLogging {
@@ -14,15 +14,6 @@ object ExportPatientLabel extends PhiLogging {
}
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)
- )
+ ExportPatientLabel(id = labelId, evidences = rawPatientLabels.map(ExportPatientLabelEvidence.fromRaw))
}
}
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabel.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabel.scala
index 3deccbf..1d5a171 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabel.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientLabel.scala
@@ -4,19 +4,17 @@ import play.api.libs.functional.syntax._
import play.api.libs.json.{Format, JsPath}
import xyz.driver.pdsuidomain.entities.export.patient.ExportPatientLabel
-final case class ApiExportPatientLabel(id: String, labelName: String, evidences: List[ApiExportPatientLabelEvidence])
+final case class ApiExportPatientLabel(id: String, evidences: List[ApiExportPatientLabelEvidence])
object ApiExportPatientLabel {
implicit val format: Format[ApiExportPatientLabel] = (
(JsPath \ "labelId").format[String] and
- (JsPath \ "labelName").format[String] and
(JsPath \ "evidence").format[List[ApiExportPatientLabelEvidence]]
)(ApiExportPatientLabel.apply, unlift(ApiExportPatientLabel.unapply))
def fromDomain(label: ExportPatientLabel) = ApiExportPatientLabel(
id = label.id.toString,
- labelName = label.name,
evidences = label.evidences.map(ApiExportPatientLabelEvidence.fromDomain)
)
}