aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/patienthistory.scala
blob: c9cdc63b2960caea6002e4c3eea991581ffd4f09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package xyz.driver.pdsuidomain.formats.json

import spray.json._
import xyz.driver.core.json._
import xyz.driver.pdsuidomain.entities._

object patienthistory {
  import DefaultJsonProtocol._
  import PatientHistory._
  import common._

  implicit val patientStateFormat: RootJsonFormat[State] = new EnumJsonFormat[State](
    "Verify" -> State.Verify,
    "Curate" -> State.Curate,
    "Review" -> State.Review,
    "Flag"   -> State.Flag
  )

  implicit val patientActionFormat: RootJsonFormat[Action] = new EnumJsonFormat[Action](
    "Start"    -> Action.Start,
    "Submit"   -> Action.Submit,
    "Unassign" -> Action.Unassign,
    "Resolve"  -> Action.Resolve,
    "Flag"     -> Action.Flag,
    "Archive"  -> Action.Archive
  )

  implicit val patientHistoryFormat: RootJsonFormat[PatientHistory] = jsonFormat6(PatientHistory.apply)

}