Skip to content

Commit

Permalink
BAH-3481 | Added lucene search to Appointment list view search. (#315)
Browse files Browse the repository at this point in the history
* BAH-3481 | Deepti,Mohan | Add lucene search to Appointment list view search.

* BAH-3481 | Fix. test case of Patient Search

---------

Co-authored-by: MOHANKUMAR T <[email protected]>
  • Loading branch information
deeptirawat1510 and mohan-13 authored Jan 21, 2024
1 parent 92b2ce5 commit 4be6cd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"angular-translate-storage-local": "*",
"angular-ui-calendar": "1.0.2",
"angular-ui-select2": "0.0.5",
"bahmni-commons-ng": "0.0.1",
"bahmni-commons-ng": "0.0.2",
"fullcalendar": "2.7.3",
"fullcalendar-scheduler": "1.3.2",
"jquery": "1.9.1",
Expand Down
2 changes: 1 addition & 1 deletion src/directives/patientSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ angular.module('bahmni.appointments')
link: {
pre: function ($scope) {
$scope.search = function () {
return spinner.forPromise(patientService.search($scope.patient).then(function (response) {
return spinner.forPromise(patientService.luceneSearch($scope.patient).then(function (response) {
return response.data.pageOfResults;
}));
};
Expand Down
6 changes: 3 additions & 3 deletions test/directives/patientSearch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ describe("Patient Search", function () {
beforeEach(module('bahmni.appointments', function ($provide) {
$location = jasmine.createSpyObj('$location', ['search']);
$location.search.and.returnValue({});
patientService = jasmine.createSpyObj('patientService', ['search','getPatient']);
patientService.search.and.returnValue(specUtil.simplePromise({data: {}}));
patientService = jasmine.createSpyObj('patientService', ['search', 'getPatient','luceneSearch']);
patientService.luceneSearch.and.returnValue(specUtil.simplePromise({data: {}}));
spinner = jasmine.createSpyObj('spinner', ['forPromise']);
spinner.forPromise.and.callFake(function (param) {
return {
Expand Down Expand Up @@ -50,7 +50,7 @@ describe("Patient Search", function () {
var compiledScope = element.isolateScope();
compiledScope.patient = 'test patient';
compiledScope.search();
expect(patientService.search).toHaveBeenCalledWith(compiledScope.patient);
expect(patientService.luceneSearch).toHaveBeenCalledWith(compiledScope.patient);
});

it('should build response map with patient name and identifier for list of patients', function () {
Expand Down

0 comments on commit 4be6cd0

Please sign in to comment.