Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made icd search case insensitive #1085

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand All @@ -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]))