aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2017-10-10 16:31:00 -0700
committerGitHub <noreply@github.com>2017-10-10 16:31:00 -0700
commit385a9a99e5a95c3d623cddd927c37564e32dbd2d (patch)
tree0671a39174899dce09ade3c571ef21bab6172e0e /src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala
parent0653b90dddc294fddb0e81059aef00b202113d78 (diff)
parent9c95eb7247cb0818af9a9e4afe884698360f994c (diff)
downloadrest-query-385a9a99e5a95c3d623cddd927c37564e32dbd2d.tar.gz
rest-query-385a9a99e5a95c3d623cddd927c37564e32dbd2d.tar.bz2
rest-query-385a9a99e5a95c3d623cddd927c37564e32dbd2d.zip
Merge pull request #35 from drivergroup/trial-46-disease-entity
Trial 46 disease entity
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala
index f782cab..07734ed 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala
@@ -23,9 +23,17 @@ object PatientHypothesisService {
def userMessage: String = "Access denied"
}
+ final case class RichPatientHypothesis(patientHypothesis: PatientHypothesis, isRequired: Boolean)
+
+ object RichPatientHypothesis {
+ implicit def toPhiString(x: RichPatientHypothesis): PhiString = {
+ phi"RichPatientHypothesis(patientHypothesis=${x.patientHypothesis}, isRequired=${x.isRequired})"
+ }
+ }
+
sealed trait GetListReply
object GetListReply {
- final case class EntityList(xs: Seq[(PatientHypothesis, Boolean)], totalFound: Int) extends GetListReply
+ final case class EntityList(xs: Seq[RichPatientHypothesis], totalFound: Int) extends GetListReply
case object AuthorizationError
extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError
@@ -38,7 +46,7 @@ object PatientHypothesisService {
sealed trait GetByIdReply
object GetByIdReply {
- final case class Entity(x: PatientHypothesis, isRequired: Boolean) extends GetByIdReply
+ final case class Entity(x: RichPatientHypothesis) extends GetByIdReply
type Error = GetByIdReply with DomainError
@@ -53,8 +61,8 @@ object PatientHypothesisService {
final case class CommonError(userMessage: String) extends GetByIdReply with DomainError
implicit def toPhiString(reply: GetByIdReply): PhiString = reply match {
- case x: DomainError => phi"GetByIdReply.Error($x)"
- case Entity(x, isRequired) => phi"GetByIdReply.Entity($x, $isRequired)"
+ case x: DomainError => phi"GetByIdReply.Error($x)"
+ case Entity(x) => phi"GetByIdReply.Entity($x)"
}
}