diff --git a/cumulus_library/statistics/counts.py b/cumulus_library/statistics/counts.py index 1b7f3a81..6dac7dc2 100644 --- a/cumulus_library/statistics/counts.py +++ b/cumulus_library/statistics/counts.py @@ -47,11 +47,11 @@ def get_where_clauses( """Convenience method for constructing arbitrary where clauses. :param clause: either a string or a list of sql where statements - :param min_subject: if clause is none, the bin size for a cnt_subject filter + :param min_subject: if clause is none, the bin size for a cnt_subject_ref filter (deprecated, use count_[fhir_resource](min_subject) instead) """ if clause is None: - return [f"cnt_subject >= {min_subject}"] + return [f"cnt_subject_ref >= {min_subject}"] elif isinstance(clause, str): return [clause] elif isinstance(clause, list): diff --git a/tests/test_counts_builder.py b/tests/test_counts_builder.py index b37f5f1a..6ef8d901 100644 --- a/tests/test_counts_builder.py +++ b/tests/test_counts_builder.py @@ -27,8 +27,8 @@ def test_get_table_name(name, duration, expected): @pytest.mark.parametrize( "clause,min_subject,expected,raises", [ - (None, None, ["cnt_subject >= 10"], does_not_raise()), - (None, 5, ["cnt_subject >= 5"], does_not_raise()), + (None, None, ["cnt_subject_ref >= 10"], does_not_raise()), + (None, 5, ["cnt_subject_ref >= 5"], does_not_raise()), ("age > 5", None, ["age > 5"], does_not_raise()), (["age > 5", "sex =='F'"], None, ["age > 5", "sex =='F'"], does_not_raise()), ("age > 5", 7, ["age > 5"], does_not_raise()),