Skip to content

Commit

Permalink
fix location filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Oct 23, 2023
1 parent f09cb13 commit 4dbc584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions care/facility/api/viewsets/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def filter_by_category(self, queryset, name, value):
last_consultation_medico_legal_case = filters.BooleanFilter(
field_name="last_consultation__medico_legal_case"
)
last_consultation_current_bed__location = filters.UUIDFilter(
field_name="last_consultation__current_bed__bed__location__external_id"
)

def filter_by_bed_type(self, queryset, name, value):
if not value:
Expand Down
1 change: 0 additions & 1 deletion care/facility/api/viewsets/patient_consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
class PatientConsultationFilter(filters.FilterSet):
patient = filters.CharFilter(field_name="patient__external_id")
facility = filters.NumberFilter(field_name="facility_id")
location = filters.CharFilter(field_name="current_bed__location_external_id")


class PatientConsultationViewSet(
Expand Down

0 comments on commit 4dbc584

Please sign in to comment.