From 2e2f9213a16bf5728f4615f927ba29536b3c20be Mon Sep 17 00:00:00 2001 From: tomskikh_ka Date: Thu, 14 Sep 2017 16:26:18 +0700 Subject: PDSUI-2273 Renamed intervention.description to dosage --- .../pdsuidomain/formats/json/intervention/ApiIntervention.scala | 8 ++++---- .../formats/json/intervention/ApiPartialIntervention.scala | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiIntervention.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiIntervention.scala index 39acbde..ba383b6 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiIntervention.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiIntervention.scala @@ -8,7 +8,7 @@ import play.api.libs.json.{Format, JsPath} final case class ApiIntervention(id: Long, name: String, typeId: Option[Long], - description: String, + dosage: String, isActive: Boolean, arms: List[Long], trialId: String, @@ -24,7 +24,7 @@ final case class ApiIntervention(id: Long, originalName = this.originalName, typeId = this.typeId.map(id => LongId(id)), originalType = this.originalType.map(id => id.toString), - description = this.description, + dosage = this.dosage, originalDescription = this.originalDescription, isActive = this.isActive ) @@ -43,7 +43,7 @@ object ApiIntervention { (JsPath \ "id").format[Long] and (JsPath \ "name").format[String] and (JsPath \ "typeId").formatNullable[Long] and - (JsPath \ "description").format[String] and + (JsPath \ "dosage").format[String] and (JsPath \ "isActive").format[Boolean] and (JsPath \ "arms").format[List[Long]] and (JsPath \ "trialId").format[String] and @@ -60,7 +60,7 @@ object ApiIntervention { id = intervention.id.id, name = intervention.name, typeId = intervention.typeId.map(_.id), - description = intervention.description, + dosage = intervention.dosage, isActive = intervention.isActive, arms = arms.map(_.armId.id), trialId = intervention.trialId.id, diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiPartialIntervention.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiPartialIntervention.scala index f67ba6b..aa55506 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiPartialIntervention.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/intervention/ApiPartialIntervention.scala @@ -6,7 +6,7 @@ import play.api.libs.functional.syntax._ import play.api.libs.json._ final case class ApiPartialIntervention(typeId: Option[Long], - description: Option[String], + dosage: Option[String], isActive: Option[Boolean], arms: Option[List[Long]]) { @@ -16,7 +16,7 @@ final case class ApiPartialIntervention(typeId: Option[Long], orig.copy( intervention = origIntervention.copy( typeId = typeId.map(LongId(_)).orElse(origIntervention.typeId), - description = description.getOrElse(origIntervention.description), + dosage = dosage.getOrElse(origIntervention.dosage), isActive = isActive.getOrElse(origIntervention.isActive) ), arms = draftArmList.getOrElse(orig.arms) @@ -28,14 +28,14 @@ object ApiPartialIntervention { private val reads: Reads[ApiPartialIntervention] = ( (JsPath \ "typeId").readNullable[Long] and - (JsPath \ "description").readNullable[String] and + (JsPath \ "dosage").readNullable[String] and (JsPath \ "isActive").readNullable[Boolean] and (JsPath \ "arms").readNullable[List[Long]] )(ApiPartialIntervention.apply _) private val writes: Writes[ApiPartialIntervention] = ( (JsPath \ "typeId").writeNullable[Long] and - (JsPath \ "description").writeNullable[String] and + (JsPath \ "dosage").writeNullable[String] and (JsPath \ "isActive").writeNullable[Boolean] and (JsPath \ "arms").writeNullable[List[Long]] )(unlift(ApiPartialIntervention.unapply)) -- cgit v1.2.3