diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2017-07-27 09:22:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 09:22:50 -0700 |
commit | e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9 (patch) | |
tree | 8d782fdb79c56615dcaf052e7a4bd0cfd7f4d5ef /src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala | |
parent | 56209581161e4cc2f83f85b52bd573dd25bb7201 (diff) | |
parent | 4c7b4102dede53b9707fe3758a4a9ff9ccf87bf8 (diff) | |
download | rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.tar.gz rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.tar.bz2 rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.zip |
Merge pull request #10 from drivergroup/PDSUI-2145v0.2.7
PDSUI-2145 Create own user history for Documents and Medical Records
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala new file mode 100644 index 0000000..c55a78f --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/recordhistory/ApiRecordHistory.scala @@ -0,0 +1,27 @@ +package xyz.driver.pdsuidomain.formats.json.recordhistory + +import java.time.{ZoneId, ZonedDateTime} + +import play.api.libs.json.{Format, Json} +import xyz.driver.pdsuidomain.entities.MedicalRecordHistory + +final case class ApiRecordHistory(id: Long, + executor: String, + recordId: Long, + state: String, + action: String, + created: ZonedDateTime) + +object ApiRecordHistory { + implicit val format: Format[ApiRecordHistory] = + Json.format[ApiRecordHistory] + + def fromDomain(x: MedicalRecordHistory) = ApiRecordHistory( + id = x.id.id, + executor = x.executor.id, + recordId = x.recordId.id, + state = MedicalRecordHistory.State.stateToString(x.state), + action = MedicalRecordHistory.Action.actionToString(x.action), + created = ZonedDateTime.of(x.created, ZoneId.of("Z")) + ) +} |