diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-12-15 17:29:33 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-12-15 17:30:04 +0700 |
commit | 2456ac8336df69734890b325b0b2a5a1182e93e2 (patch) | |
tree | 816f15e0d0187b60304b98826118f3a38de682a6 /src/main/scala/xyz/driver/pdsuidomain/services | |
parent | 9ee674a4798cf191a5833ff7703ad497db620fce (diff) | |
download | rest-query-2456ac8336df69734890b325b0b2a5a1182e93e2.tar.gz rest-query-2456ac8336df69734890b325b0b2a5a1182e93e2.tar.bz2 rest-query-2456ac8336df69734890b325b0b2a5a1182e93e2.zip |
PDSUI-2432 Make Option's reply for getById
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services')
10 files changed, 13 insertions, 13 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala index 68cf6fa..915dc20 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientCriterionService.scala @@ -18,7 +18,7 @@ trait PatientCriterionService { implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[RichPatientCriterion]] def getById(patientId: UuidId[Patient], id: LongId[PatientCriterion])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientCriterion] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[RichPatientCriterion]] def updateList(patientId: UuidId[Patient], draftEntities: List[DraftPatientCriterion])( implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Unit] diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientEligibleTrialService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientEligibleTrialService.scala index 79594a9..e73d537 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientEligibleTrialService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientEligibleTrialService.scala @@ -18,7 +18,7 @@ trait PatientEligibleTrialService { implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[RichPatientEligibleTrial]] def getById(patientId: UuidId[Patient], id: LongId[PatientTrialArmGroup])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientEligibleTrial] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[RichPatientEligibleTrial]] def getCriterionListByGroupId(patientId: UuidId[Patient], id: LongId[PatientTrialArmGroup])( implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[RichPatientCriterion]] diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala index 2e981d0..0191b5a 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientHypothesisService.scala @@ -18,7 +18,7 @@ trait PatientHypothesisService { implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[PatientHypothesis]] def getById(patientId: UuidId[Patient], hypothesisId: UuidId[Hypothesis])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[PatientHypothesis] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[PatientHypothesis]] def update(origPatientHypothesis: PatientHypothesis, draftPatientHypothesis: PatientHypothesis)( implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[PatientHypothesis] diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientIssueService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientIssueService.scala index 5426aac..b2ba357 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientIssueService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientIssueService.scala @@ -15,7 +15,7 @@ trait PatientIssueService { implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[PatientIssue] def getById(patientId: UuidId[Patient], id: LongId[PatientIssue])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[PatientIssue] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[PatientIssue]] def getListByPatientId(patientId: UuidId[Patient], filter: SearchFilterExpr = SearchFilterExpr.Empty, diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala index 52361a8..a999bf9 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala @@ -13,7 +13,7 @@ import scala.concurrent.Future trait PatientLabelEvidenceService { def getById(patientId: UuidId[Patient], labelId: LongId[Label], id: LongId[PatientLabelEvidence])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[PatientLabelEvidenceView] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[PatientLabelEvidenceView]] def getAll(patientId: UuidId[Patient], labelId: LongId[Label], diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelService.scala index f15c108..0eeac53 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelService.scala @@ -24,7 +24,7 @@ trait PatientLabelService { implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[PatientLabel]] def getByLabelIdOfPatient(patientId: UuidId[Patient], labelId: LongId[Label])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientLabel] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[RichPatientLabel]] def update(origPatientLabel: PatientLabel, draftPatientLabel: PatientLabel)( implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientLabel] diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala index c3b75bb..6f95fdb 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala @@ -12,7 +12,7 @@ import scala.concurrent.Future trait PatientService { def getById(id: UuidId[Patient])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Patient] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[Patient]] def getAll(filter: SearchFilterExpr = SearchFilterExpr.Empty, sorting: Option[Sorting] = None, diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientCriterionService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientCriterionService.scala index 92a79a2..cc66142 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientCriterionService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientCriterionService.scala @@ -41,13 +41,13 @@ class RestPatientCriterionService(transport: ServiceTransport, baseUri: Uri)( } def getById(patientId: UuidId[Patient], id: LongId[PatientCriterion])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientCriterion] = { + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[RichPatientCriterion]] = { val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/patient/$patientId/criterion/$id")) for { response <- transport.sendRequestGetResponse(requestContext)(request) entity <- apiResponse[RichPatientCriterion](response) } yield { - entity + Option(entity) } } diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientLabelService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientLabelService.scala index 11fb4df..932e123 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientLabelService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientLabelService.scala @@ -56,13 +56,13 @@ class RestPatientLabelService(transport: ServiceTransport, baseUri: Uri)( } def getByLabelIdOfPatient(patientId: UuidId[Patient], labelId: LongId[Label])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[RichPatientLabel] = { + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[RichPatientLabel]] = { val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/patient/$patientId/label/$labelId")) for { response <- transport.sendRequestGetResponse(requestContext)(request) entity <- apiResponse[RichPatientLabel](response) } yield { - entity + Option(entity) } } diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala index 77f12f9..67f4e38 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala @@ -20,13 +20,13 @@ class RestPatientService(transport: ServiceTransport, baseUri: Uri)(implicit pro import xyz.driver.pdsuidomain.formats.json.patient._ def getById(id: UuidId[Patient])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Patient] = { + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[Patient]] = { val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/patient/$id")) for { response <- transport.sendRequestGetResponse(requestContext)(request) entity <- apiResponse[Patient](response) } yield { - entity + Option(entity) } } |