aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-07-21 15:11:19 -0700
committervlad <vlad@driver.xyz>2017-07-21 15:11:19 -0700
commit4c9d4f0679f7b1f4ab179c8d3208cf207c81635a (patch)
tree399852c34f3c5bb734a8deb5df4e85fae09cfd3d /src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala
parent5279d01cedb35a759347f194c0e8adb21d19e88e (diff)
downloadrest-query-4c9d4f0679f7b1f4ab179c8d3208cf207c81635a.tar.gz
rest-query-4c9d4f0679f7b1f4ab179c8d3208cf207c81635a.tar.bz2
rest-query-4c9d4f0679f7b1f4ab179c8d3208cf207c81635a.zip
Export service separation
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala
index ce70934..b2a140c 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala
@@ -8,6 +8,7 @@ import xyz.driver.pdsuicommon.domain._
import xyz.driver.pdsuicommon.error.DomainError
import xyz.driver.pdsuicommon.logging._
import xyz.driver.pdsuidomain.entities._
+import xyz.driver.pdsuidomain.entities.export.patient.ExportPatientWithLabels
import scala.concurrent.Future
@@ -50,6 +51,17 @@ object PatientService {
}
}
+ sealed trait GetPatientWithLabelsReply
+ object GetPatientWithLabelsReply {
+ type Error = GetPatientWithLabelsReply with DomainError
+
+ final case class Entity(x: ExportPatientWithLabels) extends GetPatientWithLabelsReply
+
+ case object NotFoundError extends GetPatientWithLabelsReply with DomainError.NotFoundError {
+ def userMessage: String = "Patient not found"
+ }
+ }
+
sealed trait UpdateReply
object UpdateReply {
type Error = UpdateReply with DomainError
@@ -76,6 +88,9 @@ trait PatientService {
def getById(id: UuidId[Patient])(implicit requestContext: AuthenticatedRequestContext): Future[GetByIdReply]
+ def getExportPatient(id: UuidId[Patient])(
+ implicit requestContext: AuthenticatedRequestContext): Future[GetPatientWithLabelsReply]
+
def getAll(filter: SearchFilterExpr = SearchFilterExpr.Empty,
sorting: Option[Sorting] = None,
pagination: Option[Pagination] = None)(