aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/eligibility.scala
blob: 1796fe64e7cf7d47fb36d9e432ca510e76fd6943 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package xyz.driver.pdsuidomain.fakes.entities

import xyz.driver.core.generators
import xyz.driver.entities.clinic.{ClinicalRecord, TestOrder}
import xyz.driver.entities.patient.{CancerType, Patient}
import xyz.driver.entities.report.Report
import xyz.driver.fakes
import xyz.driver.pdsuidomain.entities.eligibility._

object eligibility {
  import xyz.driver.core.generators._

  def nextMolecularEvidenceDocument(): MolecularEvidenceDocument =
    MolecularEvidenceDocument(
      documentType = xyz.driver.pdsuidomain.fakes.entities.common.nextDocumentType(),
      providerType = xyz.driver.pdsuidomain.fakes.entities.common.nextProviderType(),
      providerName = nextOption(nextString(100)),
      date = nextOption(nextDate()),
      reportId = nextId[Report](),
      reportType = fakes.entities.assays.nextAssayType(),
      isDriverDocument = nextBoolean()
    )

  def nextClinicalEvidenceDocument(): ClinicalEvidenceDocument =
    ClinicalEvidenceDocument(
      documentType = xyz.driver.pdsuidomain.fakes.entities.common.nextDocumentType(),
      providerType = xyz.driver.pdsuidomain.fakes.entities.common.nextProviderType(),
      providerName = nextOption(nextString(100)),
      date = nextOption(nextDate()),
      documentId = nextId[ClinicalEvidenceDocument](),
      requestId = nextId[ClinicalRecord](),
      isDriverDocument = nextBoolean()
    )

  def nextEvidenceDocument(): EvidenceDocument =
    oneOf[EvidenceDocument](nextMolecularEvidenceDocument(),
                            nextClinicalEvidenceDocument(),
                            nextClinicalEvidenceDocument()) // For more clinical documents

  def nextEvidence(): Evidence =
    Evidence(
      evidenceId = Option(nextId[Evidence]()),
      evidenceText = nextString(100),
      labelValue = xyz.driver.fakes.entities.labels.nextLabelValue(),
      nextEvidenceDocument(),
      isPrimaryValue = nextOption(nextBoolean())
    )

  def nextLabelEvidence(): LabelEvidence =
    LabelEvidence(label = fakes.entities.labels.nextLabel(), evidence = Seq.empty)

  def nextLabelMismatchRank(): LabelMismatchRank =
    LabelMismatchRank(
      label = fakes.entities.labels.nextLabel(),
      score = nextInt(100),
      trials = seqOf(xyz.driver.pdsuidomain.fakes.entities.export.nextExportTrialWithLabels()),
      evidence = seqOf(nextEvidence())
    )

  def nextMismatchRankedLabels(): MismatchRankedLabels =
    MismatchRankedLabels(data = seqOf(nextLabelMismatchRank()), labelVersion = nextInt(100))

  def nextMatchedPatient(): MatchedPatient =
    MatchedPatient(
      patientId = nextId[Patient](),
      name = fakes.entities.common.nextFullName[Patient](),
      birthDate = nextDate(),
      orderId = nextId[TestOrder](),
      disease = generators.oneOf[CancerType](CancerType.Breast, CancerType.Lung, CancerType.Prostate),
      patientDataStatus = fakes.entities.process.nextProcessStepExecutionStatus()
    )
}