aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/export.scala
blob: 1fe75333b774c2bad101b8df18ea25b6e61a1945 (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
31
32
33
34
35
36
package xyz.driver.pdsuidomain.fakes.entities

import xyz.driver.entities.labels.Label
import xyz.driver.pdsuidomain.entities.export.trial._
import xyz.driver.pdsuidomain.entities.{Criterion, EligibilityArm, Trial}

object export {
  import common._
  import xyz.driver.core.generators._

  def nextExportTrialArm(): ExportTrialArm =
    ExportTrialArm(armId = nextLongId[EligibilityArm],
                   armName = nextString(100),
                   diseaseList = listOf(nextString(100)))

  def nextExportTrialLabelCriterion(): ExportTrialLabelCriterion =
    ExportTrialLabelCriterion(
      criterionId = nextLongId[Criterion],
      value = nextOption[Boolean](nextBoolean()),
      labelId = nextLongId[Label],
      armIds = setOf(nextLongId[EligibilityArm]),
      criteria = nextString(100),
      isCompound = nextBoolean(),
      isDefining = nextBoolean()
    )

  def nextExportTrialWithLabels(): ExportTrialWithLabels =
    ExportTrialWithLabels(
      nctId = nextStringId[Trial],
      trialId = nextUuidId[Trial],
      lastReviewed = nextLocalDateTime,
      labelVersion = nextInt(100).toLong,
      arms = listOf(nextExportTrialArm()),
      criteria = listOf(nextExportTrialLabelCriterion())
    )
}