@@ -86,10 +86,10 @@ def test_cohort_creation_baseline(caplog, test_db):
8686
8787 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
8888 assert_equal (len (patient_ids ), 5 )
89- assert_equal (patient_ids , {' 106' , ' 108' , ' 110' , ' 111' , ' 112' })
89+ assert_equal (patient_ids , {" 106" , " 108" , " 110" , " 111" , " 112" })
9090 # select two patients to check for cohort_start_date and cohort_end_date automatically computed
91- patient_106 = next (item for item in cohort .data if item ["subject_id" ] == ' 106' )
92- patient_108 = next (item for item in cohort .data if item ["subject_id" ] == ' 108' )
91+ patient_106 = next (item for item in cohort .data if item ["subject_id" ] == " 106" )
92+ patient_108 = next (item for item in cohort .data if item ["subject_id" ] == " 108" )
9393
9494 # Replace dates with actual values from your test data
9595 assert_equal (
@@ -127,7 +127,7 @@ def test_cohort_creation_study(test_db):
127127 assert cohort .data is not None , "Cohort creation wrongly returned None data"
128128 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
129129 assert_equal (len (patient_ids ), 4 )
130- assert_equal (patient_ids , {' 108' , ' 110' , ' 111' , ' 112' })
130+ assert_equal (patient_ids , {" 108" , " 110" , " 111" , " 112" })
131131
132132
133133def test_cohort_creation_study2 (caplog , test_db ):
@@ -155,7 +155,7 @@ def test_cohort_creation_study2(caplog, test_db):
155155 assert cohort .data is not None , "Cohort creation wrongly returned None data"
156156 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
157157 assert_equal (len (patient_ids ), 1 )
158- assert_equal (patient_ids , {' 106' })
158+ assert_equal (patient_ids , {" 106" })
159159
160160
161161def test_cohort_creation_all (caplog , test_db ):
@@ -191,7 +191,7 @@ def test_cohort_creation_all(caplog, test_db):
191191 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
192192 print (f"patient_ids: { patient_ids } " , flush = True )
193193 assert_equal (len (patient_ids ), 2 )
194- assert_equal (patient_ids , {' 108' , ' 110' })
194+ assert_equal (patient_ids , {" 108" , " 110" })
195195
196196
197197def test_cohort_creation_multiple_temporary_groups_with_no_operator (test_db ):
@@ -214,7 +214,7 @@ def test_cohort_creation_multiple_temporary_groups_with_no_operator(test_db):
214214 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
215215 print (f"patient_ids: { patient_ids } " , flush = True )
216216 assert_equal (len (patient_ids ), 2 )
217- assert_equal (patient_ids , {' 108' , ' 110' })
217+ assert_equal (patient_ids , {" 108" , " 110" })
218218
219219
220220def test_cohort_creation_mixed_domains (test_db ):
@@ -242,7 +242,7 @@ def test_cohort_creation_mixed_domains(test_db):
242242 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
243243 print (f"patient_ids: { patient_ids } " , flush = True )
244244 assert_equal (len (patient_ids ), 3 )
245- assert_equal (patient_ids , {'1' , '2' , '6' })
245+ assert_equal (patient_ids , {"1" , "2" , "6" })
246246 start_dates = [item ["cohort_start_date" ] for item in cohort .data ]
247247 assert_equal (len (start_dates ), 3 )
248248 assert_equal (start_dates , [datetime .date (2020 , 6 , 1 ), datetime .date (2020 , 6 , 1 ), datetime .date (2018 , 1 , 1 )])
@@ -356,10 +356,10 @@ def test_cohort_creation_negative_instance(test_db):
356356
357357 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
358358 assert_equal (len (patient_ids ), 6 ) # Female patients 1, 2, 3, 5
359- assert_equal (patient_ids , {'1' , '2' , '3' , '5' , '6' , '7' })
359+ assert_equal (patient_ids , {"1" , "2" , "3" , "5" , "6" , "7" })
360360
361361 # Verify dates for a specific patient (e.g., patient 1 with last diabetes diagnosis)
362- patient_1 = next (item for item in cohort .data if item ["subject_id" ] == '1' )
362+ patient_1 = next (item for item in cohort .data if item ["subject_id" ] == "1" )
363363 assert_equal (
364364 patient_1 ["cohort_start_date" ],
365365 datetime .date (2020 , 6 , 1 ),
@@ -392,10 +392,10 @@ def test_cohort_creation_offset(test_db):
392392
393393 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
394394 assert_equal (len (patient_ids ), 6 ) # Female patients 1, 2, 3, 5
395- assert_equal (patient_ids , {'1' , '2' , '3' , '5' , '6' , '7' })
395+ assert_equal (patient_ids , {"1" , "2" , "3" , "5" , "6" , "7" })
396396
397397 # Verify dates for a specific patient (e.g., patient 1 with offset)
398- patient_1 = next (item for item in cohort .data if item ["subject_id" ] == '1' )
398+ patient_1 = next (item for item in cohort .data if item ["subject_id" ] == "1" )
399399 # Diabetes on 2020-06-01: -730 days = 2018-06-02, +180 days = 2020-11-28
400400 assert_equal (
401401 patient_1 ["cohort_start_date" ],
@@ -435,10 +435,10 @@ def test_cohort_creation_negative_instance_offset(test_db):
435435
436436 patient_ids = set ([item ["subject_id" ] for item in cohort .data ])
437437 assert_equal (len (patient_ids ), 6 )
438- assert_equal (patient_ids , {'1' , '2' , '3' , '5' , '6' , '7' })
438+ assert_equal (patient_ids , {"1" , "2" , "3" , "5" , "6" , "7" })
439439
440440 # Verify dates for a specific patient (e.g., patient 1 with last diabetes and offset)
441- patient_1 = next (item for item in cohort .data if item ["subject_id" ] == '1' )
441+ patient_1 = next (item for item in cohort .data if item ["subject_id" ] == "1" )
442442 # Last diabetes on 2020-06-01: +180 days = 2020-11-28
443443 assert_equal (
444444 patient_1 ["cohort_start_date" ],
0 commit comments