diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-09-28 14:32:21 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-09-28 14:32:21 +0700 |
commit | 1f569ac1a31f88334c25976d94e7c495a7bbde80 (patch) | |
tree | 584162d344db1ea767adb72dc6a67164a1e89e68 /src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala | |
parent | d8e71e0a9ee7db58032384d059403bc227a35138 (diff) | |
download | rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.tar.gz rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.tar.bz2 rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.zip |
Implemented all generator for REP's entities
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala deleted file mode 100644 index 1536c65..0000000 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/MedicalRecordMetaGen.scala +++ /dev/null @@ -1,63 +0,0 @@ -package xyz.driver.pdsuidomain.fakes.entities.rep - -import xyz.driver.pdsuidomain.entities.MedicalRecord -import xyz.driver.core.generators -import xyz.driver.core.generators._ - -object MedicalRecordMetaGen { - private val maxItemsInCollectionNumber = 50 - private val pageMaxNumber = 1000 - - private val medicalRecordMetas = { - Set( - () => nextMedicalRecordMetaReorder, - () => nextMedicalRecordMetaDuplicate, - () => nextMedicalRecordMetaRotation - ) - } - - - def nextMedicalRecordMetaReorder: MedicalRecord.Meta.Reorder = { - val itemsNumber = - maxItemsInCollectionNumber - val items = scala.util.Random - .shuffle(Seq.tabulate(itemsNumber)(identity)) - - MedicalRecord.Meta.Reorder( - predicted = nextOption(nextBoolean), - items = items - ) - } - - - def nextMedicalRecordMetaDuplicate: MedicalRecord.Meta.Duplicate = { - val startPageGen = - nextInt(pageMaxNumber, minValue = 0) - val endPageGen = - nextInt(pageMaxNumber, startPageGen) - - MedicalRecord.Meta.Duplicate( - predicted = nextOption(nextBoolean), - startPage = startPageGen.toDouble, - endPage = endPageGen.toDouble, - startOriginalPage = startPageGen.toDouble, - endOriginalPage = nextOption(endPageGen.toDouble) - ) - } - - def nextMedicalRecordMetaRotation: MedicalRecord.Meta.Rotation = { - val items = - Array.tabulate(maxItemsInCollectionNumber)( - index => nextString() -> index - ).toMap - - MedicalRecord.Meta.Rotation( - predicted = nextOption(nextBoolean()), - items = items - ) - } - - def nextMedicalRecordMeta: MedicalRecord.Meta = { - generators.oneOf(medicalRecordMetas)() - } -} |