Skip to content

Commit

Permalink
Made icd search case insensitive (#1085)
Browse files Browse the repository at this point in the history
fix (icd): made icd search case insensitive
  • Loading branch information
khavinshankar authored Nov 1, 2022
1 parent 2b6c282 commit eb52c8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion care/facility/api/viewsets/icd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from re import IGNORECASE

from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet
@@ -22,6 +24,6 @@ def list(self, request):
if request.GET.get("query", False):
query = request.GET.get("query")
queryset = queryset.where(
label=queryset.re_match(r".*" + query + r".*")
label=queryset.re_match(r".*" + query + r".*", IGNORECASE)
) # can accept regex from FE if needed.
return Response(serailize_data(queryset[0:100]))

0 comments on commit eb52c8a

Please sign in to comment.