Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated name of patient count field in stats #207

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cumulus_library/statistics/counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_counts_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down