From dda9e93bd3c3ca270cc1f742ab532f8047058d3f Mon Sep 17 00:00:00 2001 From: vigneshhari Date: Mon, 6 Jan 2025 14:19:55 +0530 Subject: [PATCH] Fix issue with encounter filter in questionnaire response --- .github/workflows/deploy.yml | 2 -- care/emr/api/viewsets/questionnaire_response.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ff5869d723..5de8105165 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -194,5 +194,3 @@ jobs: service: ${{ env.ECS_SERVICE_BACKEND }} cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true - - diff --git a/care/emr/api/viewsets/questionnaire_response.py b/care/emr/api/viewsets/questionnaire_response.py index dadaae11ef..b799118c0d 100644 --- a/care/emr/api/viewsets/questionnaire_response.py +++ b/care/emr/api/viewsets/questionnaire_response.py @@ -3,7 +3,7 @@ from rest_framework.generics import get_object_or_404 from care.emr.api.viewsets.base import EMRModelReadOnlyViewSet -from care.emr.models import Patient +from care.emr.models import Encounter, Patient from care.emr.models.questionnaire import QuestionnaireResponse from care.emr.resources.questionnaire_response.spec import QuestionnaireResponseReadSpec from care.security.authorization import AuthorizationController @@ -39,7 +39,7 @@ def get_queryset(self): ) if "encounter" in self.request.GET: encounter = get_object_or_404( - Patient, external_id=self.request.GET["encounter"] + Encounter, external_id=self.request.GET["encounter"] ) else: obj = get_object_or_404(QuestionnaireResponse, self.kwargs["external_id"])