diff options
author | Marvin Bertin <marvin.bertin@gmail.com> | 2017-10-10 17:17:18 -0700 |
---|---|---|
committer | Marvin Bertin <marvin.bertin@gmail.com> | 2017-10-10 17:17:18 -0700 |
commit | b124608a4faa9cb94474f27c1d4605e5cb0ab63d (patch) | |
tree | c3439f756f023facbbae4deea1972ad2f511dda3 /src/main/scala/xyz/driver/pdsuidomain/services/rest | |
parent | f55212361d6126a05075a1f00f3915484b4f334e (diff) | |
parent | 385a9a99e5a95c3d623cddd927c37564e32dbd2d (diff) | |
download | rest-query-b124608a4faa9cb94474f27c1d4605e5cb0ab63d.tar.gz rest-query-b124608a4faa9cb94474f27c1d4605e5cb0ab63d.tar.bz2 rest-query-b124608a4faa9cb94474f27c1d4605e5cb0ab63d.zip |
fix merge conflictsv0.7.5
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/rest')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/rest/RestEligibilityVerificationService.scala | 5 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestEligibilityVerificationService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestEligibilityVerificationService.scala index f6879d0..8869106 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestEligibilityVerificationService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestEligibilityVerificationService.scala @@ -8,6 +8,7 @@ import xyz.driver.core.rest.{AuthorizedServiceRequestContext, RestService, Servi import xyz.driver.entities.patient import xyz.driver.entities.patient.Patient import xyz.driver.entities.users.AuthUserInfo +import xyz.driver.pdsuicommon.domain.LongId import xyz.driver.pdsuidomain.entities.eligibility.{MatchedPatient, MismatchRankedLabels} import xyz.driver.pdsuidomain.entities.{Arm, eligibility} import xyz.driver.pdsuidomain.services.EligibilityVerificationService @@ -33,11 +34,11 @@ class RestEligibilityVerificationService(transport: ServiceTransport, baseUri: U override def getMismatchRankedLabels(patientId: Id[Patient], cancerType: patient.CancerType, - excludedArms: Seq[Id[Arm]])( + excludedArms: Seq[LongId[Arm]])( implicit ctx: AuthorizedServiceRequestContext[AuthUserInfo]): Future[eligibility.MismatchRankedLabels] = { val query = - Seq("disease" -> cancerType.toString.toUpperCase, "ineligible_arms" -> excludedArms.map(_.value).mkString(",")) + Seq("disease" -> cancerType.toString.toUpperCase, "ineligible_arms" -> excludedArms.map(_.id).mkString(",")) val request = get(baseUri, s"/v1/patients/$patientId/labels", query) optionalResponse[MismatchRankedLabels](transport.sendRequest(ctx)(request)) diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala index 7e33919..ea719e1 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala @@ -16,7 +16,9 @@ import xyz.driver.pdsuidomain.entities.export.trial.ExportTrialWithLabels import xyz.driver.pdsuidomain.formats.json.ListResponse import xyz.driver.pdsuidomain.formats.json.trial.ApiTrial import xyz.driver.pdsuidomain.services.TrialService +import spray.json.DefaultJsonProtocol._ import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import xyz.driver.entities.patient.CancerType import xyz.driver.pdsuidomain.formats.json.sprayformats.export._ class RestTrialService(transport: ServiceTransport, baseUri: Uri)(implicit protected val materializer: Materializer, @@ -36,9 +38,9 @@ class RestTrialService(transport: ServiceTransport, baseUri: Uri)(implicit prote } } - def getTrialWithLabels(trialId: StringId[Trial], disease: String)( + def getTrialWithLabels(trialId: StringId[Trial], cancerType: CancerType)( implicit requestContext: AuthenticatedRequestContext): Future[GetTrialWithLabelsReply] = { - val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/export/trial/$disease/$trialId")) + val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/export/trial/$cancerType/$trialId")) for { response <- transport.sendRequestGetResponse(requestContext)(request) reply <- apiResponse[ExportTrialWithLabels](response) @@ -47,6 +49,17 @@ class RestTrialService(transport: ServiceTransport, baseUri: Uri)(implicit prote } } + def getTrialsWithLabels(cancerType: CancerType)( + implicit requestContext: AuthenticatedRequestContext): Future[GetTrialsWithLabelsReply] = { + val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/export/trial/$cancerType")) + for { + response <- transport.sendRequestGetResponse(requestContext)(request) + reply <- apiResponse[Seq[ExportTrialWithLabels]](response) + } yield { + GetTrialsWithLabelsReply.EntityList(reply) + } + } + def getPdfSource(trialId: StringId[Trial])( implicit requestContext: AuthenticatedRequestContext): Future[Source[ByteString, NotUsed]] = { val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/trial/$trialId/source")) |