You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select("count(distinct(case_cohort_unionedAndIntersectedWithFilters.subject_id)) as case_control_overlap").
184
-
Joins("INNER JOIN "+resultsDataSource.Schema+".cohort as control_cohort ON control_cohort.subject_id = case_cohort_unionedAndIntersectedWithFilters.subject_id") // this one allows for the intersection between case and control and the assessment of the overlap
query=query.Select("count(distinct(case_cohort_unionedAndIntersectedWithFilters.subject_id)) as case_control_overlap").
187
+
Joins("INNER JOIN "+resultsDataSource.Schema+".cohort as control_cohort ON control_cohort.subject_id = case_cohort_unionedAndIntersectedWithFilters.subject_id"). // this one allows for the intersection between case and control and the assessment of the overlap
query=query.Select(tmpTableName+".value_as_concept_id), count(distinct("+tmpTableName+".person_id)) as npersons_in_cohort_with_value").
192
-
Group(tmpTableName+".value_as_concept_id")
190
+
iffinalObservationTableAlias!="" {
191
+
query=query.Select(finalObservationTableAlias+".value_as_concept_id, count(distinct("+finalObservationTableAlias+".person_id)) as npersons_in_cohort_with_value").
query=query.Select("observation.value_as_concept_id, count(distinct(observation.person_id)) as npersons_in_cohort_with_value").
195
195
Joins("INNER JOIN "+omopDataSource.Schema+".observation_continuous as observation"+omopDataSource.GetViewDirective()+" ON "+finalSetAlias+".subject_id = observation.person_id").
// very rough check (ideally we would check the individual stats as well...TODO?):
505
505
iflen(stats) >len(stats2) {
506
-
t.Errorf("First query is more restrictive, so its stats should not be larger than stats2 of second query. Got %d and %d", len(stats), len(stats2))
506
+
t.Errorf("First query is more restrictive, so its stats should not be larger than stats2 of second query. Got %d and %d. Error: %v", len(stats), len(stats2), err)
507
507
}
508
508
509
509
// test filtering with secondLargestCohort, smallest and largestCohort.
0 commit comments