File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 55import uuid
66from datetime import datetime
77
8- # we want to generate random UUIDs but, we want to make them reproducible
9- # see: https://stackoverflow.com/a/56757552/3943054
8+ # generate reproducible random UUIDs
109rd = random .Random ()
1110rd .seed (0 )
12- uuid .uuid4 = lambda : uuid .UUID (int = rd .getrandbits (128 ))
11+
12+
13+ def make_rand_id ():
14+ return uuid .UUID (int = rd .getrandbits (128 ))
15+
1316
1417patient_pool = [
1518 {"nhs_number" : "9999999999" , "dob" : "1952-05-06" },
@@ -43,9 +46,9 @@ def generate_immunisation(num):
4346 for _ in range (num ):
4447 _imms = copy .deepcopy (imms )
4548 # ID
46- _imms ["id" ] = str (uuid . uuid4 ())
49+ _imms ["id" ] = str (make_rand_id ())
4750 _imms ["identifier" ][0 ]["system" ] = pick_rand (suppliers )
48- _imms ["identifier" ][0 ]["value" ] = str (uuid . uuid4 ())
51+ _imms ["identifier" ][0 ]["value" ] = str (make_rand_id ())
4952
5053 all_imms .append (_imms )
5154
You can’t perform that action at this time.
0 commit comments