aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-09-28 13:12:32 -0700
committervlad <vlad@driver.xyz>2017-09-28 13:12:32 -0700
commitdeba20326e3269fee3ef51f8e6841f17453b4155 (patch)
tree29aac6bf4d0cd679a39ab1e1b84aef8ce1328b3f /src/main/scala/xyz/driver/pdsuidomain/services
parentc24679f1ae7d7ccc4e6693535b0aa3ac0e1ca225 (diff)
downloadrest-query-deba20326e3269fee3ef51f8e6841f17453b4155.tar.gz
rest-query-deba20326e3269fee3ef51f8e6841f17453b4155.tar.bz2
rest-query-deba20326e3269fee3ef51f8e6841f17453b4155.zip
Simplified Export entities for EVLSv0.4.1
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/rest/RestExtractedDataService.scala9
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala8
2 files changed, 10 insertions, 7 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestExtractedDataService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestExtractedDataService.scala
index 53b9f38..a65e1f4 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestExtractedDataService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestExtractedDataService.scala
@@ -1,7 +1,6 @@
package xyz.driver.pdsuidomain.services.rest
import scala.concurrent.{ExecutionContext, Future}
-
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model._
import akka.stream.Materializer
@@ -10,10 +9,12 @@ import xyz.driver.pdsuicommon.auth._
import xyz.driver.pdsuicommon.db._
import xyz.driver.pdsuicommon.domain._
import xyz.driver.pdsuidomain.entities._
+import xyz.driver.pdsuidomain.entities.export.patient.ExportPatientWithLabels
import xyz.driver.pdsuidomain.formats.json.ListResponse
-import xyz.driver.pdsuidomain.formats.json.export.ApiExportPatientWithLabels
import xyz.driver.pdsuidomain.formats.json.extracteddata.ApiExtractedData
import xyz.driver.pdsuidomain.services.ExtractedDataService
+import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
+import xyz.driver.pdsuidomain.formats.json.sprayformats.export._
class RestExtractedDataService(transport: ServiceTransport, baseUri: Uri)(
implicit protected val materializer: Materializer,
@@ -88,9 +89,9 @@ class RestExtractedDataService(transport: ServiceTransport, baseUri: Uri)(
val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/export/patient/$id"))
for {
response <- transport.sendRequestGetResponse(requestContext)(request)
- reply <- apiResponse[ApiExportPatientWithLabels](response)
+ reply <- apiResponse[ExportPatientWithLabels](response)
} yield {
- GetPatientLabelsReply.Entity(reply.toDomain)
+ GetPatientLabelsReply.Entity(reply)
}
}
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 b77e6df..7e33919 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestTrialService.scala
@@ -12,10 +12,12 @@ import xyz.driver.pdsuicommon.auth._
import xyz.driver.pdsuicommon.db._
import xyz.driver.pdsuicommon.domain._
import xyz.driver.pdsuidomain.entities._
+import xyz.driver.pdsuidomain.entities.export.trial.ExportTrialWithLabels
import xyz.driver.pdsuidomain.formats.json.ListResponse
-import xyz.driver.pdsuidomain.formats.json.export.ApiExportTrialWithLabels
import xyz.driver.pdsuidomain.formats.json.trial.ApiTrial
import xyz.driver.pdsuidomain.services.TrialService
+import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
+import xyz.driver.pdsuidomain.formats.json.sprayformats.export._
class RestTrialService(transport: ServiceTransport, baseUri: Uri)(implicit protected val materializer: Materializer,
protected val exec: ExecutionContext)
@@ -39,9 +41,9 @@ class RestTrialService(transport: ServiceTransport, baseUri: Uri)(implicit prote
val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, s"/v1/export/trial/$disease/$trialId"))
for {
response <- transport.sendRequestGetResponse(requestContext)(request)
- reply <- apiResponse[ApiExportTrialWithLabels](response)
+ reply <- apiResponse[ExportTrialWithLabels](response)
} yield {
- GetTrialWithLabelsReply.Entity(reply.toDomain)
+ GetTrialWithLabelsReply.Entity(reply)
}
}