aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
diff options
context:
space:
mode:
authorAleksandr <ognelisar@gmail.com>2017-10-04 16:23:04 +0700
committerAleksandr <ognelisar@gmail.com>2017-10-04 16:23:04 +0700
commit7446fbcb6f51ae67ae8bf0f54729e774da8e7f73 (patch)
tree667c0f62d13561732096c2c9b251e3a227abfbe0 /src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
parent996af2657cdd779e08e46fc1ba5f47d9e7c5aac5 (diff)
downloadrest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.tar.gz
rest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.tar.bz2
rest-query-7446fbcb6f51ae67ae8bf0f54729e774da8e7f73.zip
Implemented new spray json formats for PatientHypothesis and PatientLabel
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
index 8b7c138..ffb1bd4 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
@@ -10,7 +10,7 @@ import xyz.driver.pdsuidomain.services.PatientLabelService.RichPatientLabel
class PatientLabelFormatSuite extends FlatSpec with Matchers {
- "Json format for PatientLabel" should "read and write correct JSON" in {
+ "Json format for RichPatientLabel" should "read and write correct JSON" in {
import patientlabel._
val orig = PatientLabel(
id = LongId(1),
@@ -22,7 +22,7 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
score = 1,
isImplicitMatch = false
)
- val writtenJson = patientLabelWriter.write(RichPatientLabel(orig, true))
+ val writtenJson = richPatientLabelWriter.write(RichPatientLabel(orig, isVerified = true))
writtenJson should be (
"""{"id":1,"labelId":20,"primaryValue":"Yes","verifiedPrimaryValue":null,"isVisible":true,"isVerified":true,
@@ -34,6 +34,26 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
parsedUpdatePatientLabel should be(expectedUpdatedPatientLabel)
}
+ "Json format for PatientLabel" should "read and write correct JSON" in {
+ import patientlabel._
+ val orig = PatientLabel(
+ id = LongId(1),
+ patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
+ labelId = LongId(20),
+ primaryValue = Some(FuzzyValue.Yes),
+ verifiedPrimaryValue = None,
+ isVisible = true,
+ score = 1,
+ isImplicitMatch = false
+ )
+ val writtenJson = patientLabelWriter.write(orig)
+
+ writtenJson should be (
+ """{"id":1,"labelId":20,"primaryValue":"Yes","verifiedPrimaryValue":null,"isVisible":true,
+ "score":1,"isImplicitMatch":false}""".parseJson)
+ }
+
+
"Json format for PatientLabelEvidence" should "read and write correct JSON" in {
import patientlabel._
val orig = PatientLabelEvidenceView(