Skip to content

Commit

Permalink
Add. Use lucene search for patient search
Browse files Browse the repository at this point in the history
  • Loading branch information
deeptirawat1510 committed Jan 16, 2024
1 parent b78c1d6 commit f412923
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/app/registration/services/patientService.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ angular.module('bahmni.registration')
};

var searchByNameOrIdentifier = function (query, limit) {
return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient", {
return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene", {
method: "GET",
params: {
filterOnAllIdentifiers: true,
q: query,
s: "byIdOrName",
limit: limit,
Expand Down
2 changes: 1 addition & 1 deletion ui/test/unit/registration/services/patientService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('Patient resource', function () {
var query = "demo";
patientService.searchByNameOrIdentifier(query, 100);
expect(mockHttp.get).toHaveBeenCalled();
expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient");
expect(mockHttp.get.calls.mostRecent().args[0]).toBe(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene");
expect(mockHttp.get.calls.mostRecent().args[1].params.q).toBe(query);
expect(mockHttp.get.calls.mostRecent().args[1].params.limit).toBe(100);
expect(mockHttp.get.calls.mostRecent().args[1].params.s).toBe("byIdOrName");
Expand Down

0 comments on commit f412923

Please sign in to comment.