diff options
Diffstat (limited to 'src/test/scala/xyz')
3 files changed, 21 insertions, 6 deletions
diff --git a/src/test/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParserSuite.scala b/src/test/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParserSuite.scala index ac5eec1..0209222 100644 --- a/src/test/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParserSuite.scala +++ b/src/test/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParserSuite.scala @@ -1,5 +1,7 @@ package xyz.driver.pdsuicommon.parsers +import java.util.UUID + import xyz.driver.pdsuicommon.db.SearchFilterExpr.Dimension import xyz.driver.pdsuicommon.db.{SearchFilterBinaryOperation, SearchFilterExpr, SearchFilterNAryOperation} import xyz.driver.pdsuicommon.utils.Implicits.toStringOps @@ -126,6 +128,14 @@ class SearchFilterParserSuite extends FreeSpecLike with Checkers { } } + "actual patientId uuid" - { + "should parse the full UUID as java.util.UUID type" in { + val filter = SearchFilterParser.parse(Seq("filters" -> "patientId EQ 4b4879f7-42b3-4b7c-a685-5c97d9e69e7c")) + assert(filter === Success(SearchFilterExpr.Atom.Binary( + Dimension(None, "patient_id"), Eq, UUID.fromString("4b4879f7-42b3-4b7c-a685-5c97d9e69e7c")))) + } + } + "all operators" - { "should be parsed with numeric values" in check { val testQueryGen = queryGen( diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/ExportFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/ExportFormatSuite.scala index d78e754..767f832 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/ExportFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/ExportFormatSuite.scala @@ -92,7 +92,8 @@ class ExportFormatSuite extends FlatSpec with Matchers { armIds = Set(LongId(1), LongId(2)), criteria = "criteria 10 text", isCompound = false, - isDefining = false + isDefining = false, + inclusion = Some(false) ), ExportTrialLabelCriterion( criterionId = LongId(11), @@ -101,7 +102,8 @@ class ExportFormatSuite extends FlatSpec with Matchers { armIds = Set(LongId(2)), criteria = "criteria 11 text", isCompound = true, - isDefining = false + isDefining = false, + inclusion = None ) ) val trialWithLabels = ExportTrialWithLabels( @@ -117,8 +119,10 @@ class ExportFormatSuite extends FlatSpec with Matchers { writtenJson should be( """{"nctId":"NCT000001","trialId":"40892a07-c638-49d2-9795-1edfefbbcc7c","lastReviewed":"2017-08-10T18:00Z", "labelVersion":1,"arms":[{"armId":1,"armName":"arm 1","diseaseList":["Breast"]},{"armId":2,"armName":"arm 2","diseaseList":["Breast"]}],"criteria":[ - {"value":"Yes","labelId":21,"criterionId":10,"criterionText":"criteria 10 text","armIds":[1,2],"isCompound":false,"isDefining":false}, - {"value":"Unknown","labelId":21,"criterionId":11,"criterionText":"criteria 11 text","armIds":[2],"isCompound":true,"isDefining":false}]}""".parseJson) + {"value":"Yes","labelId":21,"criterionId":10,"criterionText":"criteria 10 text","armIds":[1,2],"isCompound":false, + "isDefining":false,"inclusion":false}, + {"value":"Unknown","labelId":21,"criterionId":11,"criterionText":"criteria 11 text","armIds":[2],"isCompound":true, + "isDefining":false,"inclusion":null}]}""".parseJson) } } diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala index b254013..27e27c2 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala @@ -26,7 +26,8 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers { verifiedEligibilityStatus = None, isVisible = true, isVerified = true, - lastUpdate = LocalDateTime.parse("2017-08-10T18:00:00") + lastUpdate = LocalDateTime.parse("2017-08-10T18:00:00"), + inclusion = Some(true) ) val arms = List( PatientCriterionArm(patientCriterionId = LongId(1), armId = LongId(31), armName = "arm 31"), @@ -38,7 +39,7 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers { writtenJson should be( """{"id":1,"labelId":21,"nctId":"NCT00001","criterionId":101,"criterionText":"criterion text","criterionValue":"Yes", "criterionIsDefining":false,"criterionIsCompound":false,"eligibilityStatus":"Yes","verifiedEligibilityStatus":null, - "isVisible":true,"isVerified":true,"lastUpdate":"2017-08-10T18:00Z","arms":["arm 31","arm 32"]}""".parseJson) + "isVisible":true,"isVerified":true,"lastUpdate":"2017-08-10T18:00Z","arms":["arm 31","arm 32"],"inclusion":true}""".parseJson) val updatePatientCriterionJson = """{"verifiedEligibilityStatus":"No"}""".parseJson val expectedUpdatedPatientCriterion = orig.copy(verifiedEligibilityStatus = Some(LabelValue.No)) |