diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-10-10 16:41:33 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-10-10 16:41:33 +0700 |
commit | 4c22afe6a34641f5b35ff4953a5821a2bc940255 (patch) | |
tree | 4f77275d4460a184cf64085e9d7597841a50fbc9 /src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala | |
parent | c32f965212481e4d26c2ae1ae5616f2d4b3e22ae (diff) | |
parent | 4f83461cba1f78e607ca2a4edb6fa26f6e16e732 (diff) | |
download | rest-query-4c22afe6a34641f5b35ff4953a5821a2bc940255.tar.gz rest-query-4c22afe6a34641f5b35ff4953a5821a2bc940255.tar.bz2 rest-query-4c22afe6a34641f5b35ff4953a5821a2bc940255.zip |
All merge conflicts are resolved
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala index 6eeb40b..b9bf772 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/trial/ApiPatientCriterion.scala @@ -2,12 +2,12 @@ package xyz.driver.pdsuidomain.formats.json.patient.trial import java.time.{ZoneId, ZonedDateTime} -import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId} +import xyz.driver.pdsuicommon.domain.LongId import xyz.driver.pdsuidomain.entities.{PatientCriterion, PatientCriterionArm} import play.api.data.validation.ValidationError import play.api.libs.functional.syntax._ import play.api.libs.json.{Format, JsPath, Reads, Writes} -import xyz.driver.entities.labels.Label +import xyz.driver.entities.labels.{Label, LabelValue} final case class ApiPatientCriterion(id: Long, labelId: Long, @@ -39,13 +39,13 @@ object ApiPatientCriterion { (JsPath \ "criterionIsCompound").format[Boolean] and (JsPath \ "arms").format[List[String]] and (JsPath \ "eligibilityStatus").formatNullable[String](Format(Reads.of[String].filter(ValidationError("unknown status"))({ - case x if FuzzyValue.fromString.isDefinedAt(x) => true - case _ => false + case x if LabelValue.fromString(x).isDefined => true + case _ => false }), Writes.of[String])) and (JsPath \ "verifiedEligibilityStatus").formatNullable[String](Format( Reads.of[String].filter(ValidationError("unknown status"))({ - case x if FuzzyValue.fromString.isDefinedAt(x) => true - case _ => false + case x if LabelValue.fromString(x).isDefined => true + case _ => false }), Writes.of[String])) and (JsPath \ "isVerified").format[Boolean] and (JsPath \ "isVisible").format[Boolean] and @@ -61,13 +61,13 @@ object ApiPatientCriterion { criterionId = patientCriterion.criterionId.id, criterionText = patientCriterion.criterionText, criterionValue = patientCriterion.criterionValue.map { x => - FuzzyValue.valueToString(FuzzyValue.fromBoolean(x)) + LabelValue.fromBoolean(x).toString }, criterionIsDefining = patientCriterion.criterionIsDefining, criterionIsCompound = patientCriterion.criterionValue.isEmpty, arms = arms.map(_.armName), - eligibilityStatus = patientCriterion.eligibilityStatus.map(FuzzyValue.valueToString), - verifiedEligibilityStatus = patientCriterion.verifiedEligibilityStatus.map(FuzzyValue.valueToString), + eligibilityStatus = patientCriterion.eligibilityStatus.map(_.toString), + verifiedEligibilityStatus = patientCriterion.verifiedEligibilityStatus.map(_.toString), isVerified = patientCriterion.isVerified, isVisible = patientCriterion.isVisible, lastUpdate = ZonedDateTime.of(patientCriterion.lastUpdate, ZoneId.of("Z")) |