diff options
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/fakes/entities')
5 files changed, 10 insertions, 13 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala index 7318ff6..f77c2e0 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala @@ -3,7 +3,7 @@ package xyz.driver.pdsuidomain.fakes.entities import java.time.{LocalDate, LocalDateTime, LocalTime} import xyz.driver.core.generators.{nextDouble, nextOption} -import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId, StringId, UuidId} +import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId} import xyz.driver.pdsuidomain.entities.{Trial, TrialHistory} import scala.util.Random @@ -29,8 +29,6 @@ object common { 1 + Random.nextInt(28) // all months have at least 28 days ) - def nextCondition = generators.oneOf[Trial.Condition](Trial.Condition.All) - def nextTrialAction = generators.oneOf[TrialHistory.Action](TrialHistory.Action.All) def nextTrialState = generators.oneOf[TrialHistory.State](TrialHistory.State.All) @@ -52,9 +50,6 @@ object common { ranges.map(_._1) -> ranges.flatMap(_._2) } - def nextFuzzyValue(): FuzzyValue = - generators.oneOf[FuzzyValue](FuzzyValue.All) - def nextStartAndEndPages: (Option[Double], Option[Double]) = genBoundedRangeOption[Double](nextDouble(), nextDouble()) diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/export.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/export.scala index 7f3c410..a3ba562 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/export.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/export.scala @@ -26,7 +26,7 @@ object export { ExportTrialWithLabels( nctId = nextStringId[Trial], trialId = nextUuidId[Trial], - condition = nextString(100), + disease = nextString(100), lastReviewed = nextLocalDateTime, labelVersion = nextInt(100).toLong, arms = listOf(nextExportTrialArm()), diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala index 3fcc4cb..85bab8c 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala @@ -1,9 +1,9 @@ package xyz.driver.pdsuidomain.fakes.entities.rep +import xyz.driver.core.generators import xyz.driver.core.generators._ -import xyz.driver.entities.labels.Label +import xyz.driver.entities.labels.{Label, LabelValue} import xyz.driver.pdsuicommon.domain.{LongId, UuidId} -import xyz.driver.pdsuidomain.fakes.entities.common._ import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.entities.export.patient._ import xyz.driver.pdsuidomain.fakes.entities.common.{nextLocalDate, nextLongId} @@ -26,7 +26,7 @@ object ExportPatientGen { def nextExportPatientLabelEvidence(documentId: LongId[Document]): ExportPatientLabelEvidence = { ExportPatientLabelEvidence( id = nextLongId[ExtractedData], - value = nextFuzzyValue(), + value = generators.oneOf[LabelValue](LabelValue.Yes, LabelValue.No, LabelValue.Maybe), evidenceText = nextString(), document = nextExportPatientLabelEvidenceDocument(documentId) ) diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExtractedDataGen.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExtractedDataGen.scala index 8e77445..70ddd10 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExtractedDataGen.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExtractedDataGen.scala @@ -1,7 +1,8 @@ package xyz.driver.pdsuidomain.fakes.entities.rep +import xyz.driver.core.generators import xyz.driver.core.generators._ -import xyz.driver.entities.labels.{Label, LabelCategory} +import xyz.driver.entities.labels.{Label, LabelCategory, LabelValue} import xyz.driver.pdsuicommon.domain.{LongId, TextJson} import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.entities.ExtractedData.Meta @@ -85,7 +86,7 @@ object ExtractedDataGen { dataId = nextLongId[ExtractedData], labelId = nextOption(nextLongId[Label]), categoryId = nextOption(nextLongId[LabelCategory]), - value = nextOption(nextFuzzyValue()) + value = nextOption(generators.oneOf[LabelValue](LabelValue.Yes, LabelValue.No, LabelValue.Maybe)) ) } diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/trialcuration.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/trialcuration.scala index 9a5022c..069d1f1 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/trialcuration.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/trialcuration.scala @@ -1,6 +1,7 @@ package xyz.driver.pdsuidomain.fakes.entities import xyz.driver.entities.labels.{Label, LabelCategory} +import xyz.driver.entities.patient.CancerType import xyz.driver.pdsuicommon.domain.{LongId, User} import xyz.driver.pdsuidomain.entities._ import xyz.driver.pdsuidomain.services.CriterionService.RichCriterion @@ -19,7 +20,7 @@ object trialcuration { previousAssignee = Option(nextStringId[User]), lastActiveUserId = Option(nextStringId[User]), lastUpdate = nextLocalDateTime, - condition = nextCondition, + disease = generators.oneOf[CancerType](CancerType.Breast, CancerType.Lung, CancerType.Prostate), phase = generators.nextString(), hypothesisId = Option(nextUuidId[Hypothesis]), studyDesignId = Option(nextLongId[StudyDesign]), |