Skip to content

Commit

Permalink
changed discover filter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Jul 19, 2023
1 parent 869966c commit e0a1a59
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions care/abdm/api/viewsets/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class DiscoverView(GenericAPIView):

def post(self, request, *args, **kwargs):
data = request.data
print(data)

patients = PatientRegistration.objects.all()
verified_identifiers = data["patient"]["verifiedIdentifiers"]
Expand Down Expand Up @@ -139,11 +140,8 @@ def post(self, request, *args, **kwargs):
abha_number__health_id=identifier["value"]
)

patient = patients.filter(
abha_number__name=data["patient"]["name"],
abha_number__gender=data["patient"]["gender"],
# TODO: check date also
).last()
# TODO: also filter by demographics
patient = patients.last()

if not patient:
return Response(
Expand Down

0 comments on commit e0a1a59

Please sign in to comment.