There was an error while loading. Please reload this page.
1 parent 2105f85 commit 76564e4Copy full SHA for 76564e4
1 file changed
lib/cypress/population_clone_job.rb
@@ -76,8 +76,9 @@ def randomize_ids(patients, prng)
76
randomization_ids = options['randomization_ids'].shuffle(random: prng)[0..how_many]
77
random_patients = Patient.find(randomization_ids).to_a
78
random_patients.each do |patient|
79
+ seconds_in_day = 86_400 # 60 secs per min * 60 min per hour * 24 hours
80
plus_minus = prng.rand(2).zero? ? 1 : -1 # use this to make move dates forward or backwards
- date_shift = prng.rand(1_944_000) * plus_minus # 1_944_000 = 60 secs per min * 60 min per hour * 24 hours in day * 10 days
81
+ date_shift = prng.rand(10) * seconds_in_day * plus_minus
82
patient.qdmPatient.shift_dates(date_shift)
83
patients << patient
84
end
0 commit comments