diff options
author | ktomskikh <ktomskih@datamonsters.co> | 2017-08-03 18:04:00 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 18:04:00 +0700 |
commit | 40ee33a7c176895a19ee0f9066849d34c38c75fd (patch) | |
tree | 21b9d9b308f91af1eefaa5f68b4fef0e011c9e98 /src/main/scala/xyz/driver/pdsuidomain/formats/json | |
parent | a0c4fdf5f4280aa05518b925ed7bdc319758145a (diff) | |
parent | fc7c7063cafd7df8efe2c6c0dbc28e5ff0de06f6 (diff) | |
download | rest-query-40ee33a7c176895a19ee0f9066849d34c38c75fd.tar.gz rest-query-40ee33a7c176895a19ee0f9066849d34c38c75fd.tar.bz2 rest-query-40ee33a7c176895a19ee0f9066849d34c38c75fd.zip |
Merge pull request #15 from drivergroup/PDSUI-2181v0.2.13
PDSUI-2181 Created entities for patient history
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/patienthistory/ApiPatientHistory.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/patienthistory/ApiPatientHistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patienthistory/ApiPatientHistory.scala new file mode 100644 index 0000000..cdcd510 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/patienthistory/ApiPatientHistory.scala @@ -0,0 +1,28 @@ +package xyz.driver.pdsuidomain.formats.json.patienthistory + +import java.time.{ZoneId, ZonedDateTime} +import java.util.UUID + +import play.api.libs.json.{Format, Json} +import xyz.driver.pdsuidomain.entities.PatientHistory + +final case class ApiPatientHistory(id: Long, + executor: String, + patientId: UUID, + state: String, + action: String, + created: ZonedDateTime) + +object ApiPatientHistory { + implicit val format: Format[ApiPatientHistory] = + Json.format[ApiPatientHistory] + + def fromDomain(x: PatientHistory) = ApiPatientHistory( + id = x.id.id, + executor = x.executor.id, + patientId = x.patientId.id, + state = PatientHistory.State.stateToString(x.state), + action = PatientHistory.Action.actionToString(x.action), + created = ZonedDateTime.of(x.created, ZoneId.of("Z")) + ) +} |