diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-10-26 09:58:24 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-26 09:58:24 +0700 |
commit | 49e1fd60cd562f33fbad7d4dd2ceaa535b4434d1 (patch) | |
tree | c8aeae6023ad3476e3d23272249812a0019691c6 /src/test/scala/xyz/driver/pdsuidomain | |
parent | bb4176645aed22311b372f8f7f4897f9012322bd (diff) | |
parent | a0fe954d3680541de1ff8e0e7a5d762352e90072 (diff) | |
download | rest-query-49e1fd60cd562f33fbad7d4dd2ceaa535b4434d1.tar.gz rest-query-49e1fd60cd562f33fbad7d4dd2ceaa535b4434d1.tar.bz2 rest-query-49e1fd60cd562f33fbad7d4dd2ceaa535b4434d1.zip |
Merge pull request #55 from drivergroup/PDSUI-2330
PDSUI-2330 Add support for inclusion/exclusion criteria to the TM backend
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain')
2 files changed, 11 insertions, 6 deletions
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)) |