diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2017-07-21 19:14:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-21 19:14:02 -0700 |
commit | a835eef22830ab86a9f65194a6645f4f474ae0cc (patch) | |
tree | 13c14e33e346560a8db587b589b6a9464f3e6616 /src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala | |
parent | 525ef428d950a6c9ddb58247101aeb1cb1f42d80 (diff) | |
parent | 92f503ce18e90c9955bed8b0a8c6ec2e30f0304e (diff) | |
download | rest-query-a835eef22830ab86a9f65194a6645f4f474ae0cc.tar.gz rest-query-a835eef22830ab86a9f65194a6645f4f474ae0cc.tar.bz2 rest-query-a835eef22830ab86a9f65194a6645f4f474ae0cc.zip |
Merge pull request #9 from drivergroup/export-service-separationv0.2.4
Export service separation
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala index b2fc9f9..46e9156 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/MedicalRecordService.scala @@ -4,7 +4,7 @@ import java.time.LocalDateTime import xyz.driver.pdsuicommon.auth.AuthenticatedRequestContext import xyz.driver.pdsuicommon.db._ -import xyz.driver.pdsuicommon.domain.LongId +import xyz.driver.pdsuicommon.domain.{LongId, UuidId} import xyz.driver.pdsuicommon.error._ import xyz.driver.pdsuidomain.entities.MedicalRecord.PdfSource import xyz.driver.pdsuidomain.entities._ @@ -60,8 +60,14 @@ object MedicalRecordService { final case class EntityList(xs: Seq[MedicalRecord], totalFound: Int, lastUpdate: Option[LocalDateTime]) extends GetListReply + type Error = GetListReply with DomainError + case object AuthorizationError extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError + + case object NotFoundError extends GetListReply with DomainError.NotFoundError { + def userMessage: String = "Patient wasn't found" + } } sealed trait CreateReply @@ -93,6 +99,9 @@ trait MedicalRecordService { def getById(recordId: LongId[MedicalRecord])( implicit requestContext: AuthenticatedRequestContext): Future[GetByIdReply] + def getPatientRecords(patientId: UuidId[Patient])( + implicit requestContext: AuthenticatedRequestContext): Future[GetListReply] + def getPdfSource(recordId: LongId[MedicalRecord])( implicit requestContext: AuthenticatedRequestContext): Future[GetPdfSourceReply] |