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

Fixes discharged patients CSV export #2009

Merged
merged 2 commits into from
Mar 25, 2024
Merged
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
3 changes: 2 additions & 1 deletion care/facility/api/viewsets/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@
if self.action == "list" and settings.CSV_REQUEST_PARAMETER in self.request.GET:
for backend in (PatientDRYFilter, filters.DjangoFilterBackend):
queryset = backend().filter_queryset(self.request, queryset, self)
return queryset.filter(last_consultation__discharge_date__isnull=True)
is_active = self.request.GET.get("is_active", "False") == "True"
return queryset.filter(last_consultation__discharge_date__isnull=is_active)

Check warning on line 414 in care/facility/api/viewsets/patient.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/viewsets/patient.py#L413-L414

Added lines #L413 - L414 were not covered by tests

return super().filter_queryset(queryset)

Expand Down
Loading