aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala
index ad6bc80..585d4ed 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patient/ApiPatient.scala
@@ -19,7 +19,7 @@ final case class ApiPatient(id: String,
previousAssignee: Option[String],
lastActiveUser: Option[String],
lastUpdate: ZonedDateTime,
- condition: String,
+ disease: String,
orderId: UUID) {
private def extractStatus(status: String): Patient.Status =
@@ -45,9 +45,9 @@ final case class ApiPatient(id: String,
previousAssignee = this.previousAssignee.map(StringId(_)),
lastActiveUserId = this.lastActiveUser.map(StringId(_)),
isUpdateRequired = false,
- cancerType = patient.CancerType
- .fromString(this.condition)
- .getOrElse(throw new IllegalArgumentException(s"Unknown cancer type ${this.condition}")),
+ disease = patient.CancerType
+ .fromString(this.disease)
+ .getOrElse(throw new IllegalArgumentException(s"Unknown cancer type ${this.disease}")),
orderId = PatientOrderId(this.orderId),
lastUpdate = this.lastUpdate.toLocalDateTime
)
@@ -66,7 +66,7 @@ object ApiPatient {
(JsPath \ "previousAssignee").formatNullable[String] and
(JsPath \ "lastActiveUser").formatNullable[String] and
(JsPath \ "lastUpdate").format[ZonedDateTime] and
- (JsPath \ "condition").format[String] and
+ (JsPath \ "disease").format[String] and
(JsPath \ "orderId").format[UUID]
)(ApiPatient.apply, unlift(ApiPatient.unapply))
@@ -80,7 +80,7 @@ object ApiPatient {
previousAssignee = patient.previousAssignee.map(_.id),
lastActiveUser = patient.lastActiveUserId.map(_.id),
lastUpdate = ZonedDateTime.of(patient.lastUpdate, ZoneId.of("Z")),
- condition = patient.cancerType.toString,
+ disease = patient.disease.toString,
orderId = patient.orderId.id
)
}