diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-11-01 18:54:15 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-11-01 18:54:15 +0700 |
commit | aefa081802218fad505ba1bca02c0497f2ce7be4 (patch) | |
tree | f8b8f6ef6f70fef57110117c601abf49b6e3662b /src/main/scala/xyz/driver/pdsuidomain | |
parent | ff8729639c7067aee7dca130c0a0fc3f425488f0 (diff) | |
download | rest-query-0.12.1.tar.gz rest-query-0.12.1.tar.bz2 rest-query-0.12.1.zip |
Fixed patient's criteria updatev0.12.1
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/fakes/entities/treatmentmatching.scala | 4 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/treatmentmatching.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/treatmentmatching.scala index 3c14a37..e4d7de6 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/treatmentmatching.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/treatmentmatching.scala @@ -94,7 +94,9 @@ object treatmentmatching { def nextDraftPatientCriterion(): DraftPatientCriterion = DraftPatientCriterion( id = nextLongId[PatientCriterion], - eligibilityStatus = generators.nextOption(fakes.entities.labels.nextLabelValue()), + eligibilityStatus = generators.nextOption( + generators.nextOption(fakes.entities.labels.nextLabelValue()) + ), isVerified = generators.nextOption(generators.nextBoolean()) ) diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala index 4d0e188..f2b4434 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala @@ -15,16 +15,22 @@ import scala.concurrent.Future object PatientCriterionService { final case class DraftPatientCriterion(id: LongId[PatientCriterion], - eligibilityStatus: Option[LabelValue], + eligibilityStatus: Option[Option[LabelValue]], isVerified: Option[Boolean]) { def applyTo(orig: PatientCriterion) = { orig.copy( - eligibilityStatus = eligibilityStatus.orElse(orig.eligibilityStatus), + eligibilityStatus = eligibilityStatus.getOrElse(orig.eligibilityStatus), isVerified = isVerified.getOrElse(orig.isVerified) ) } } + object DraftPatientCriterion { + implicit def toPhiString(x: DraftPatientCriterion): PhiString = { + phi"DraftPatientCriterion(id=${x.id}, eligibilityStatus=${Unsafe(x.eligibilityStatus)}, isVerified=${x.isVerified})" + } + } + trait DefaultPatientNotFoundError { def userMessage: String = "Patient not found" } |