aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2017-10-03 13:08:00 -0700
committerMarvin Bertin <marvin.bertin@gmail.com>2017-10-03 13:08:00 -0700
commit0653b90dddc294fddb0e81059aef00b202113d78 (patch)
tree3d8abb424b0f0495f1cbb18849184dd20d6897fc /src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala
parent5750f2f3633e75f2f96d6a36264ab4b8f3fec7d2 (diff)
parenta321a978353439fc516b0f2016c28fb32ba1b7ae (diff)
downloadrest-query-0653b90dddc294fddb0e81059aef00b202113d78.tar.gz
rest-query-0653b90dddc294fddb0e81059aef00b202113d78.tar.bz2
rest-query-0653b90dddc294fddb0e81059aef00b202113d78.zip
Merge branch 'master' into add-slot-eligibility-arms
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala54
1 files changed, 54 insertions, 0 deletions
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
new file mode 100644
index 0000000..3fcc4cb
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/ExportPatientGen.scala
@@ -0,0 +1,54 @@
+package xyz.driver.pdsuidomain.fakes.entities.rep
+
+import xyz.driver.core.generators._
+import xyz.driver.entities.labels.Label
+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}
+import xyz.driver.pdsuidomain.fakes.entities.rep.DocumentGen._
+import xyz.driver.pdsuidomain.fakes.entities.rep.MedicalRecordGen._
+
+object ExportPatientGen {
+ private val maxItemsInCollectionNumber = 3
+
+ def nextExportPatientLabelEvidenceDocument(documentId: LongId[Document]): ExportPatientLabelEvidenceDocument = {
+ ExportPatientLabelEvidenceDocument(
+ documentId = documentId,
+ requestId = RecordRequestId(nextUuid()),
+ documentType = nextDocumentType(),
+ providerType = nextProviderType(),
+ date = nextLocalDate
+ )
+ }
+
+ def nextExportPatientLabelEvidence(documentId: LongId[Document]): ExportPatientLabelEvidence = {
+ ExportPatientLabelEvidence(
+ id = nextLongId[ExtractedData],
+ value = nextFuzzyValue(),
+ evidenceText = nextString(),
+ document = nextExportPatientLabelEvidenceDocument(documentId)
+ )
+ }
+
+ def nextExportPatientLabel(documentId: LongId[Document]): ExportPatientLabel = {
+ ExportPatientLabel(
+ id = nextLongId[Label],
+ evidences = List.fill(
+ nextInt(maxItemsInCollectionNumber, minValue = 0)
+ )(nextExportPatientLabelEvidence(documentId))
+ )
+ }
+
+ def nextExportPatientWithLabels(documentId: LongId[Document]): ExportPatientWithLabels = {
+ ExportPatientWithLabels(
+ patientId = UuidId[xyz.driver.pdsuidomain.entities.Patient](nextUuid()),
+ labelVersion = scala.util.Random.nextLong(),
+ labels = List.fill(
+ nextInt(maxItemsInCollectionNumber, minValue = 0)
+ )(nextExportPatientLabel(documentId))
+ )
+ }
+
+}