aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-11-03 15:22:38 -0700
committervlad <vlad@driver.xyz>2017-11-03 15:22:38 -0700
commit6402a866735c463d5794bb8461c498fa5199b819 (patch)
tree8ba6c5e32c298fa8da8ae35bf04e1cd67281af14
parent5a6cb5737b524dc063e7a30921f8f847313690b0 (diff)
downloadrest-query-6402a866735c463d5794bb8461c498fa5199b819.tar.gz
rest-query-6402a866735c463d5794bb8461c498fa5199b819.tar.bz2
rest-query-6402a866735c463d5794bb8461c498fa5199b819.zip
Fixing missing evidence error in EVv0.13.3
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/document.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document.scala
index 3cce5de..8ab6f13 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document.scala
@@ -12,7 +12,7 @@ object document {
import Document._
import common._
- implicit val documentStatusFormat = new EnumJsonFormat[Status](
+ implicit val documentStatusFormat: RootJsonFormat[Status] = new EnumJsonFormat[Status](
"New" -> Status.New,
"Organized" -> Status.Organized,
"Extracted" -> Status.Extracted,
@@ -21,7 +21,7 @@ object document {
"Archived" -> Status.Archived
)
- implicit val requiredTypeFormat = new EnumJsonFormat[RequiredType](
+ implicit val requiredTypeFormat: RootJsonFormat[RequiredType] = new EnumJsonFormat[RequiredType](
"OPN" -> RequiredType.OPN,
"PN" -> RequiredType.PN
)
@@ -132,6 +132,10 @@ object document {
override def read(json: JsValue): Document = json match {
case JsObject(fields) =>
+ val id = fields
+ .get("id")
+ .flatMap(_.convertTo[Option[LongId[Document]]])
+
val recordId = fields
.get("recordId")
.map(_.convertTo[LongId[MedicalRecord]])
@@ -170,7 +174,7 @@ object document {
.flatMap(_.convertTo[Option[LocalDate]])
Document(
- id = LongId(0),
+ id = id.getOrElse(LongId(0)),
recordId = recordId,
status = Document.Status.New,
physician = physician,