From deba20326e3269fee3ef51f8e6841f17453b4155 Mon Sep 17 00:00:00 2001 From: vlad Date: Thu, 28 Sep 2017 13:12:32 -0700 Subject: Simplified Export entities for EVLS --- .../json/export/ApiExportPatientWithLabels.scala | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientWithLabels.scala (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientWithLabels.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientWithLabels.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientWithLabels.scala deleted file mode 100644 index fc9bab7..0000000 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/export/ApiExportPatientWithLabels.scala +++ /dev/null @@ -1,31 +0,0 @@ -package xyz.driver.pdsuidomain.formats.json.export - -import play.api.libs.functional.syntax._ -import play.api.libs.json.{Format, JsPath} -import xyz.driver.pdsuicommon.domain.UuidId -import xyz.driver.pdsuidomain.entities.export.patient.ExportPatientWithLabels - -final case class ApiExportPatientWithLabels(patientId: String, labelVersion: Long, labels: List[ApiExportPatientLabel]) { - - def toDomain = ExportPatientWithLabels( - patientId = UuidId(this.patientId), - labelVersion = this.labelVersion, - labels = this.labels.map(_.toDomain) - ) - -} - -object ApiExportPatientWithLabels { - - implicit val format: Format[ApiExportPatientWithLabels] = ( - (JsPath \ "patientId").format[String] and - (JsPath \ "labelVersion").format[Long] and - (JsPath \ "labels").format[List[ApiExportPatientLabel]] - )(ApiExportPatientWithLabels.apply, unlift(ApiExportPatientWithLabels.unapply)) - - def fromDomain(patient: ExportPatientWithLabels) = ApiExportPatientWithLabels( - patientId = patient.patientId.toString, - labelVersion = patient.labelVersion, - labels = patient.labels.map(ApiExportPatientLabel.fromDomain) - ) -} -- cgit v1.2.3