aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-11 16:56:06 +0700
committerGitHub <noreply@github.com>2017-10-11 16:56:06 +0700
commit3375f1beeab7af9a6732d6fce8762c3a3038e1f3 (patch)
treee4f1ad85a2ea17c76bcc844420d5f97bfd116e23 /src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala
parentbbbcaf35a6081dba24dbb9a9aeb9d25fc2ca60be (diff)
parent85c78f58f0428d13795aa0419ff42471513a34d6 (diff)
downloadrest-query-3375f1beeab7af9a6732d6fce8762c3a3038e1f3.tar.gz
rest-query-3375f1beeab7af9a6732d6fce8762c3a3038e1f3.tar.bz2
rest-query-3375f1beeab7af9a6732d6fce8762c3a3038e1f3.zip
Merge pull request #37 from drivergroup/add-slot-eligibility-armsv0.8.1
Add slot eligibility arms
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala
index a2a1ca9..133a2c8 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/ApiTrial.scala
@@ -3,11 +3,10 @@ package xyz.driver.pdsuidomain.formats.json.trial
import java.time.{ZoneId, ZonedDateTime}
import java.util.UUID
-import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId}
-import xyz.driver.pdsuidomain.entities.Trial
import play.api.libs.functional.syntax._
import play.api.libs.json._
-import xyz.driver.entities.patient.CancerType
+import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId}
+import xyz.driver.pdsuidomain.entities.Trial
final case class ApiTrial(id: String,
externalId: UUID,
@@ -17,7 +16,6 @@ final case class ApiTrial(id: String,
previousStatus: Option[String],
previousAssignee: Option[String],
lastActiveUser: Option[String],
- disease: String,
phase: String,
hypothesisId: Option[UUID],
studyDesignId: Option[Long],
@@ -38,9 +36,6 @@ final case class ApiTrial(id: String,
previousAssignee = this.previousAssignee.map(id => StringId(id)),
lastActiveUserId = this.lastActiveUser.map(id => StringId(id)),
lastUpdate = this.lastUpdate.toLocalDateTime,
- disease = CancerType
- .fromString(this.disease)
- .getOrElse(throw new NoSuchElementException(s"Unknown disease ${this.disease}")),
phase = this.phase,
hypothesisId = this.hypothesisId.map(id => UuidId(id)),
studyDesignId = this.studyDesignId.map(id => LongId(id)),
@@ -66,7 +61,6 @@ object ApiTrial {
(JsPath \ "previousStatus").formatNullable[String] and
(JsPath \ "previousAssignee").formatNullable[String] and
(JsPath \ "lastActiveUser").formatNullable[String] and
- (JsPath \ "disease").format[String] and
(JsPath \ "phase").format[String] and
(JsPath \ "hypothesisId").formatNullable[UUID] and
(JsPath \ "studyDesignId").formatNullable[Long] and
@@ -88,7 +82,6 @@ object ApiTrial {
previousAssignee = trial.previousAssignee.map(_.id),
lastActiveUser = trial.lastActiveUserId.map(_.id),
lastUpdate = ZonedDateTime.of(trial.lastUpdate, ZoneId.of("Z")),
- disease = trial.disease.toString,
phase = trial.phase,
hypothesisId = trial.hypothesisId.map(_.id),
studyDesignId = trial.studyDesignId.map(_.id),