From ef9517e1b8f599fbdd15c474cf7dfea61e803c2f Mon Sep 17 00:00:00 2001 From: Kseniya Tomskikh Date: Fri, 4 Aug 2017 17:57:12 +0600 Subject: PDSUI-2188 Created and fixed spray json formats for tric and rep --- .../formats/json/sprayformats/recordhistory.scala | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordhistory.scala (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordhistory.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordhistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordhistory.scala new file mode 100644 index 0000000..bd14d43 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/recordhistory.scala @@ -0,0 +1,30 @@ +package xyz.driver.pdsuidomain.formats.json.sprayformats + +import spray.json._ +import xyz.driver.core.json.EnumJsonFormat +import xyz.driver.pdsuidomain.entities._ + +object recordhistory { + import DefaultJsonProtocol._ + import common._ + import MedicalRecordHistory._ + + implicit val recordStateFormat = new EnumJsonFormat[State]( + "Clean" -> State.Clean, + "Organize" -> State.Organize, + "Review" -> State.Review, + "Flag" -> State.Flag + ) + + implicit val recordActionFormat = new EnumJsonFormat[Action]( + "Start" -> Action.Start, + "Submit" -> Action.Submit, + "Unassign" -> Action.Unassign, + "Resolve" -> Action.Resolve, + "Flag" -> Action.Flag, + "Archive" -> Action.Archive + ) + + implicit val recordHistoryFormat: RootJsonFormat[MedicalRecordHistory] = jsonFormat6(MedicalRecordHistory.apply) + +} -- cgit v1.2.3