From 07be6a7982b5c46a854e3435a52662f32800c8ae Mon Sep 17 00:00:00 2001 From: Apurva Nagar Date: Tue, 31 Aug 2021 19:55:54 +0530 Subject: [PATCH] added facility param for Sample Report filter (#616) --- care/facility/api/viewsets/patient_sample.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/care/facility/api/viewsets/patient_sample.py b/care/facility/api/viewsets/patient_sample.py index 7cb442c43d..44b54c59a2 100644 --- a/care/facility/api/viewsets/patient_sample.py +++ b/care/facility/api/viewsets/patient_sample.py @@ -2,7 +2,7 @@ from django.db.models.query_utils import Q from django_filters import rest_framework as filters from dry_rest_permissions.generics import DRYPermissionFiltersBase, DRYPermissions -from rest_framework import viewsets, mixins +from rest_framework import mixins, viewsets from rest_framework.decorators import action from rest_framework.exceptions import ValidationError from rest_framework.permissions import IsAuthenticated @@ -39,6 +39,7 @@ class PatientSampleFilterSet(filters.FilterSet): status = filters.ChoiceFilter(choices=PatientSample.SAMPLE_TEST_FLOW_CHOICES) result = filters.ChoiceFilter(choices=PatientSample.SAMPLE_TEST_RESULT_CHOICES) patient_name = filters.CharFilter(field_name="patient__name", lookup_expr="icontains") + facility = filters.UUIDFilter(field_name="consultation__facility__external_id") class PatientSampleViewSet(