From 9a5a03e4aeb861e63dcb7c5f47cd4a6e339c7866 Mon Sep 17 00:00:00 2001 From: kavitha-sundararajan <90255023+kavitha-sundararajan@users.noreply.github.com> Date: Thu, 9 May 2024 16:16:31 +0530 Subject: [PATCH] Kid icon and pre-patient flow revamp (#933) * BAH-3053 | add pre-patient attribute in registration page (#600) (#638) * BAH-3053 | add pre-patient attribute in registration page (#600) * BAH-3053 | add pre-patient attribute in registration page * BAH-3053 | added check for pre-registration attribute * BAH-3053 | refactored to drive by single config * Kavitha | refactored pre-patient flow based on configs * Kavitha | BAH-3065 | add additional search param for lucene search (#604) * Update package.json (#884) * [Rahul] | BAH-3710 | Fix. Remove Transifex Script * [Bahmni Infra] | Add. Update Translation Resources * Parvathy | BAH-2833 | Add. Display Error Message When Document Size Limit Exceed (#875) * [Rahu] | BAH-3522 | Fix. Improve Test Coverage For DateUtils * [Bahmni Infra] | Add. Update Translation Resources * Parvathy | BAH-2833 | Fix. Handle Document Size Limit Error Message * Revert "Update package.json (#884)" This reverts commit 30091b30b4a0f33597f859c4279e04f0341dad22. * Revert "[Rahul] | BAH-3710 | Fix. Remove Transifex Script" This reverts commit bbc704df83ead8767dbc261e6c50a335b4b888c3. * Revert "Parvathy | BAH-2833 | Add. Display Error Message When Document Size Limit Exceed (#875)" This reverts commit 67a004b84dfb0574409a98aa1c75bfa7f9bdded9. * Revert "[Rahu] | BAH-3522 | Fix. Improve Test Coverage For DateUtils" This reverts commit 1bf9ff7224f6f3e297006d6bbe661ec36d419869. * Revert "[Bahmni Infra] | Add. Update Translation Resources" This reverts commit 95d96c41ccd4c7ff8e1dded8275da44395552bd3. * Revert "Parvathy | BAH-2833 | Fix. Handle Document Size Limit Error Message" This reverts commit 95fdfac2196d94dcc0a705263d5af823ac7988fc. * Kavitha | refactor to accept grouped configs * Revert unnecessary commit * BAH-3053 | renamed configuration names * BAH-3053 | renamed lables to related patient identifier --------- * BAH-3742 | Add. Custom Patient Attribute Icon * kid icon refactor * Kavitha|BAH-3742| refactor for combined icon configs * Kavitha|fix failed test cases * BAH-3472| refactor icon config in patient context * BAH-3742 | fix failed test cases * [Rahul] | BAH-3742 | Fix. Broken Icon HTML * [Rahul] | BAH-3742 | Refactor. Remove Whitespace --------- Co-authored-by: Rahul Ramesh * add custom attr for lucene search * Kavitha|add test cases to meet coverage --------- Co-authored-by: Rahul Ramesh --- ui/app/adt/controllers/wardListController.js | 9 ++---- ui/app/adt/models/wardDetails.js | 5 ++-- ui/app/adt/views/wardList.html | 4 +-- .../directives/patientProfile.js | 5 ++-- .../patientprofile/views/patientProfile.html | 2 +- .../directives/patientContext.js | 5 ++++ .../patient-context/views/patientContext.html | 4 +-- .../controllers/patientsListController.js | 2 ++ .../patient-search/views/patientsList.html | 4 +-- .../common/patient/services/patientService.js | 6 ++-- ui/app/i18n/registration/locale_en.json | 2 +- .../controllers/createPatientController.js | 6 ++-- .../controllers/editPatientController.js | 10 +++++-- ui/app/registration/views/editpatient.html | 9 +++--- ui/app/registration/views/newpatient.html | 10 +++---- ui/app/styles/clinical/_patientDashboard.scss | 6 +++- ui/app/styles/clinical/_patientSearch.scss | 3 ++ ui/app/styles/clinical/_visit.scss | 3 ++ .../_patientCommonInformation.scss | 5 +++- .../controllers/wardListController.spec.js | 18 +++++------ .../directives/patientProfile.spec.js | 7 ++++- .../patient/services/patientService.spec.js | 30 ++++++++++++++++++- 22 files changed, 108 insertions(+), 47 deletions(-) diff --git a/ui/app/adt/controllers/wardListController.js b/ui/app/adt/controllers/wardListController.js index e39bf47bba..86469d4cb9 100644 --- a/ui/app/adt/controllers/wardListController.js +++ b/ui/app/adt/controllers/wardListController.js @@ -15,7 +15,7 @@ angular.module('bahmni.adt') }; $scope.searchText = ''; - + $scope.iconAttributeConfig = appService.getAppDescriptor().getConfigValue('iconAttribute') || {}; $scope.searchTextFilter = function (row) { var searchText = $scope.searchText; if (!searchText) { @@ -39,12 +39,9 @@ angular.module('bahmni.adt') v: "full", location_name: $scope.ward.ward.name }; - return queryService.getResponseFromQuery(params).then(function (response) { - $scope.tableDetails = Bahmni.ADT.WardDetails.create(response.data, $rootScope.diagnosisStatus); - $scope.tableHeadings = $scope.tableDetails.length > 0 ? - Object.keys($scope.tableDetails[0]).filter(function (name) { return name !== 'kid'; }) - : []; + $scope.tableDetails = Bahmni.ADT.WardDetails.create(response.data, $rootScope.diagnosisStatus, $scope.iconAttributeConfig.attrName); + $scope.tableHeadings = $scope.tableDetails.length > 0 ? Object.keys($scope.tableDetails[0]).filter(function (name) { return name !== $scope.iconAttributeConfig.attrName; }) : []; }); }; spinner.forPromise(getTableDetails()); diff --git a/ui/app/adt/models/wardDetails.js b/ui/app/adt/models/wardDetails.js index c7e2e83c65..44b78a53a4 100644 --- a/ui/app/adt/models/wardDetails.js +++ b/ui/app/adt/models/wardDetails.js @@ -2,9 +2,10 @@ Bahmni.ADT.WardDetails = {}; -Bahmni.ADT.WardDetails.create = function (details, diagnosisStatus) { +Bahmni.ADT.WardDetails.create = function (details, diagnosisStatus, iconAttribute) { var detailsMap = {}; - var attributesToCopy = ["Bed", "Ward", "Id", "Name", "Age", "Gender", "District", "Village", "Admission By", "Admission Time", "Disposition By", "Disposition Time", "ADT Notes", "kid"]; + var attributesToCopy = ["Bed", "Ward", "Id", "Name", "Age", "Gender", "District", "Village", "Admission By", "Admission Time", "Disposition By", "Disposition Time", "ADT Notes"]; + iconAttribute && attributesToCopy.push(iconAttribute); var diagnosisProperties = ["Diagnosis", "Diagnosis Certainty", "Diagnosis Order", "Diagnosis Status", "Diagnosis Provider", "Diagnosis Datetime"]; var hiddenAttributesToCopy = ["Patient Uuid", "Visit Uuid"]; diff --git a/ui/app/adt/views/wardList.html b/ui/app/adt/views/wardList.html index fb8fa7d9c7..cda0727431 100644 --- a/ui/app/adt/views/wardList.html +++ b/ui/app/adt/views/wardList.html @@ -15,8 +15,8 @@
{{row[heading]}} - - + +
diff --git a/ui/app/common/displaycontrols/patientprofile/directives/patientProfile.js b/ui/app/common/displaycontrols/patientprofile/directives/patientProfile.js index c48a31086e..1e4559a688 100644 --- a/ui/app/common/displaycontrols/patientprofile/directives/patientProfile.js +++ b/ui/app/common/displaycontrols/patientprofile/directives/patientProfile.js @@ -31,8 +31,8 @@ }; angular.module('bahmni.common.displaycontrol.patientprofile') .directive('patientProfile', ['patientService', 'spinner', '$sce', '$rootScope', '$stateParams', '$window', '$translate', - 'configurations', '$q', 'visitService', - function (patientService, spinner, $sce, $rootScope, $stateParams, $window, $translate, configurations, $q, visitService) { + 'configurations', '$q', 'visitService', 'appService', + function (patientService, spinner, $sce, $rootScope, $stateParams, $window, $translate, configurations, $q, visitService, appService) { var controller = function ($scope) { $scope.isProviderRelationship = function (relationship) { return _.includes($rootScope.relationshipTypeMap.provider, relationship.relationshipType.aIsToB); @@ -41,6 +41,7 @@ var configName = $stateParams.configName || Bahmni.Common.Constants.defaultExtensionName; $window.open("../clinical/#/" + configName + "/patient/" + patientUuid + "/dashboard"); }; + $scope.iconAttributeConfig = appService.getAppDescriptor().getConfigValue('iconAttribute') || {}; var assignPatientDetails = function () { var patientMapper = new Bahmni.PatientMapper(configurations.patientConfig(), $rootScope, $translate); return patientService.getPatient($scope.patientUuid).then(function (response) { diff --git a/ui/app/common/displaycontrols/patientprofile/views/patientProfile.html b/ui/app/common/displaycontrols/patientprofile/views/patientProfile.html index 9b4d8693d5..662e953d00 100644 --- a/ui/app/common/displaycontrols/patientprofile/views/patientProfile.html +++ b/ui/app/common/displaycontrols/patientprofile/views/patientProfile.html @@ -23,7 +23,7 @@
- +
diff --git a/ui/app/common/patient-context/directives/patientContext.js b/ui/app/common/patient-context/directives/patientContext.js index 5c55935e33..45301ab3be 100644 --- a/ui/app/common/patient-context/directives/patientContext.js +++ b/ui/app/common/patient-context/directives/patientContext.js @@ -8,6 +8,11 @@ angular.module('bahmni.common.patientContext') $scope.allowNavigation = angular.isDefined($scope.isConsultation); $scope.initPromise.then(function (response) { $scope.patientContext = response.data; + $scope.iconAttributeConfig = appService.getAppDescriptor().getConfigValue('iconAttribute') || {}; + $scope.showIcon = $scope.iconAttributeConfig && $scope.iconAttributeConfig.attrName && $scope.iconAttributeConfig.attrValue && $scope.patientContext.personAttributes && $scope.patientContext.personAttributes[$scope.iconAttributeConfig.attrName] && $scope.patientContext.personAttributes[$scope.iconAttributeConfig.attrName].value === $scope.iconAttributeConfig.attrValue; + if ($scope.patientContext.personAttributes && $scope.showIcon) { + delete $scope.patientContext.personAttributes[$scope.iconAttributeConfig.attrName]; + } var programAttributes = $scope.patientContext.programAttributes; var personAttributes = $scope.patientContext.personAttributes; convertBooleanValuesToEnglish(personAttributes); diff --git a/ui/app/common/patient-context/views/patientContext.html b/ui/app/common/patient-context/views/patientContext.html index e541b2f155..d60b7a5d4f 100644 --- a/ui/app/common/patient-context/views/patientContext.html +++ b/ui/app/common/patient-context/views/patientContext.html @@ -9,8 +9,8 @@ ({{patientContext.identifier}}) - - + +
  • {{'GENDER_KEY' | translate}} {{patientContext.gender}}
  • diff --git a/ui/app/common/patient-search/controllers/patientsListController.js b/ui/app/common/patient-search/controllers/patientsListController.js index c1c5dc487c..008f34031e 100644 --- a/ui/app/common/patient-search/controllers/patientsListController.js +++ b/ui/app/common/patient-search/controllers/patientsListController.js @@ -181,6 +181,8 @@ angular.module('bahmni.common.patientSearch') } }; + $scope.iconAttributeConfig = appService.getAppDescriptor().getConfigValue('iconAttribute') || {}; + var mapExtensionToSearchType = function (appExtn) { return { name: appExtn.label, diff --git a/ui/app/common/patient-search/views/patientsList.html b/ui/app/common/patient-search/views/patientsList.html index 52836eb172..bbd092625e 100644 --- a/ui/app/common/patient-search/views/patientsList.html +++ b/ui/app/common/patient-search/views/patientsList.html @@ -73,7 +73,7 @@ - + @@ -95,7 +95,7 @@
    {{::patient.extraIdentifier}}
    - + diff --git a/ui/app/common/patient/services/patientService.js b/ui/app/common/patient/services/patientService.js index 746b585a6d..87413cd26b 100644 --- a/ui/app/common/patient/services/patientService.js +++ b/ui/app/common/patient/services/patientService.js @@ -41,8 +41,10 @@ angular.module('bahmni.common.patient') loginLocationUuid: sessionService.getLoginLocationUuid(), patientSearchResultsConfig: customAttribute }; - if (appService.getAppDescriptor().getConfigValue("filterAttributeForAllSearch")) { - searchParams.attributeToFilterOut = appService.getAppDescriptor().getConfigValue("filterAttributeForAllSearch"); + var filterOutAttributeForAllSearch = appService.getAppDescriptor().getConfigValue("filterOutAttributeForAllSearch") || []; + if (filterOutAttributeForAllSearch && filterOutAttributeForAllSearch.length > 0) { + searchParams.attributeToFilterOut = filterOutAttributeForAllSearch[0].attrName; + searchParams.attributeValueToFilterOut = filterOutAttributeForAllSearch[0].attrValue; } return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene", { method: "GET", diff --git a/ui/app/i18n/registration/locale_en.json b/ui/app/i18n/registration/locale_en.json index 9124a5eb6d..60bb31d5ff 100644 --- a/ui/app/i18n/registration/locale_en.json +++ b/ui/app/i18n/registration/locale_en.json @@ -126,5 +126,5 @@ "PATIENT_ATTRIBUTE_GIVEN_NAME_LOCAL": "First Name in Arabic", "PATIENT_ATTRIBUTE_FAMILY_NAME_LOCAL": "Last Name in Arabic", "PATIENT_ATTRIBUTE_MIDDLE_NAME_LOCAL": "Middle Name in Arabic", - "PRE_REGISTRATION_LABEL": "Patient" + "RELATED_PATIENT_IDENTIFIER_LABEL": "Patient" } diff --git a/ui/app/registration/controllers/createPatientController.js b/ui/app/registration/controllers/createPatientController.js index 0f0ce6cfe5..522577a7f6 100644 --- a/ui/app/registration/controllers/createPatientController.js +++ b/ui/app/registration/controllers/createPatientController.js @@ -10,7 +10,7 @@ angular.module('bahmni.registration') $scope.addressHierarchyConfigs = appService.getAppDescriptor().getConfigValue("addressHierarchy"); $scope.disablePhotoCapture = appService.getAppDescriptor().getConfigValue("disablePhotoCapture"); $scope.showEnterID = configValueForEnterId === null ? true : configValueForEnterId; - $scope.preRegistrationAttribute = appService.getAppDescriptor().getConfigValue('preRegistrationAttribute'); + $scope.relatedIdentifierAttribute = appService.getAppDescriptor().getConfigValue('relatedIdentifierAttribute'); $scope.today = Bahmni.Common.Util.DateTimeFormatter.getDateWithoutTime(dateUtil.now()); $scope.moduleName = appService.getAppDescriptor().getConfigValue('registrationModuleName'); var patientId; @@ -99,7 +99,9 @@ angular.module('bahmni.registration') _.chain(defaultsWithAnswers).filter(isConcept).each(setDefaultConcept).value(); _.chain(defaultsWithAnswers).filter(isLocation).each(setDefaultLocation).value(); _.chain(defaultsWithAnswers).filter(isDateType).each(setDefaultValue).value(); - $scope.patient[$scope.preRegistrationAttribute] = false; + if ($scope.relatedIdentifierAttribute && $scope.relatedIdentifierAttribute.name) { + $scope.patient[$scope.relatedIdentifierAttribute.name] = false; + } }; var expandSectionsWithDefaultValue = function () { diff --git a/ui/app/registration/controllers/editPatientController.js b/ui/app/registration/controllers/editPatientController.js index dc45becb81..d13e4e066c 100644 --- a/ui/app/registration/controllers/editPatientController.js +++ b/ui/app/registration/controllers/editPatientController.js @@ -30,8 +30,14 @@ angular.module('bahmni.registration') expandDataFilledSections(); $scope.patientLoaded = true; $scope.enableWhatsAppButton = (appService.getAppDescriptor().getConfigValue("enableWhatsAppButton") || Bahmni.Registration.Constants.enableWhatsAppButton) && ($scope.patient.phoneNumber != undefined); - $scope.preRegistrationAttribute = appService.getAppDescriptor().getConfigValue('preRegistrationAttribute'); - $scope.showPreRegistrationOption = $scope.preRegistrationAttribute && $scope.patient[$scope.preRegistrationAttribute] == false; + $scope.relatedIdentifierAttribute = appService.getAppDescriptor().getConfigValue('relatedIdentifierAttribute'); + if ($scope.relatedIdentifierAttribute && $scope.relatedIdentifierAttribute.name) { + const hideOrDisableAttr = $scope.relatedIdentifierAttribute.hideOrDisable; + const hideAttrOnValue = $scope.relatedIdentifierAttribute.hideOnValue; + $scope.showRelatedIdentifierOption = !(hideOrDisableAttr === "hide" && $scope.patient[$scope.relatedIdentifierAttribute.name] && + $scope.patient[$scope.relatedIdentifierAttribute.name].toString() === hideAttrOnValue); + $scope.showDisabledAttrOption = hideOrDisableAttr === "disable" ? true : false; + } }; var expandDataFilledSections = function () { diff --git a/ui/app/registration/views/editpatient.html b/ui/app/registration/views/editpatient.html index 4a1e1ce474..e066ec0a1f 100644 --- a/ui/app/registration/views/editpatient.html +++ b/ui/app/registration/views/editpatient.html @@ -20,17 +20,16 @@
    {{patient.registrationDate | bahmniDate}}
    -
    +
    - +
    - +
    -
    diff --git a/ui/app/registration/views/newpatient.html b/ui/app/registration/views/newpatient.html index e3e0da4a76..be025d6f06 100644 --- a/ui/app/registration/views/newpatient.html +++ b/ui/app/registration/views/newpatient.html @@ -42,14 +42,14 @@ -
    -
    +
    +
    - +
    - +
    diff --git a/ui/app/styles/clinical/_patientDashboard.scss b/ui/app/styles/clinical/_patientDashboard.scss index 8364f649d2..dee2218afa 100644 --- a/ui/app/styles/clinical/_patientDashboard.scss +++ b/ui/app/styles/clinical/_patientDashboard.scss @@ -1423,7 +1423,7 @@ table.treatments-details-table { padding-left: 10px; } - .kid-icon { + .custom-attr-icon { display: table-cell; vertical-align: middle; padding-left: 10px; @@ -1435,6 +1435,10 @@ table.treatments-details-table { padding: 2px 8px; font-size: 18px; } + i.context-icon-style { + padding: 3.6px; + border-radius: 4px + } } } } diff --git a/ui/app/styles/clinical/_patientSearch.scss b/ui/app/styles/clinical/_patientSearch.scss index 13d4b35fb1..3cf9de1d24 100644 --- a/ui/app/styles/clinical/_patientSearch.scss +++ b/ui/app/styles/clinical/_patientSearch.scss @@ -86,6 +86,9 @@ } font-size: 18px; } + i.list-icon-style { + padding: 2px 12.289px; + } .ward-details-container { display: flex; diff --git a/ui/app/styles/clinical/_visit.scss b/ui/app/styles/clinical/_visit.scss index fe95d1653f..32f8a1f054 100644 --- a/ui/app/styles/clinical/_visit.scss +++ b/ui/app/styles/clinical/_visit.scss @@ -783,6 +783,9 @@ a.visit:before { top: 0; right: 0; } + .custom-icon-style { + padding: 4px 15.289px; + } } .patient-img { diff --git a/ui/app/styles/registration/_patientCommonInformation.scss b/ui/app/styles/registration/_patientCommonInformation.scss index ce0b223428..9fcade1f39 100644 --- a/ui/app/styles/registration/_patientCommonInformation.scss +++ b/ui/app/styles/registration/_patientCommonInformation.scss @@ -10,9 +10,12 @@ margin:8px 5px 8px 5px; } &.uneditable-input{ - width: 5.2em; + width: 5.7em; } } + .related-identifier-label{ + width: 14em !important; + } } form .form-field{ diff --git a/ui/test/unit/adt/controllers/wardListController.spec.js b/ui/test/unit/adt/controllers/wardListController.spec.js index c5fa1e7dea..d0ba29d117 100644 --- a/ui/test/unit/adt/controllers/wardListController.spec.js +++ b/ui/test/unit/adt/controllers/wardListController.spec.js @@ -11,15 +11,15 @@ describe('WardListController', function () { module('bahmni.adt'); module(function ($provide) { - var realAppDescriptor = new Bahmni.Common.AppFramework.AppDescriptor(); - realAppDescriptor.getConfigValue = function (config) { - if (config === 'enableIPDFeature') { - return false; - } - }; - - appService = jasmine.createSpyObj('appService', ['getAppDescriptor']); - appService.getAppDescriptor.and.returnValue(realAppDescriptor); + var realAppDescriptor = new Bahmni.Common.AppFramework.AppDescriptor(); + realAppDescriptor.getConfigValue = function (config) { + if (config === 'enableIPDFeature') { + return false; + } + }; + + appService = jasmine.createSpyObj('appService', ['getAppDescriptor']); + appService.getAppDescriptor.and.returnValue(realAppDescriptor); $provide.value('appService', {}); queryService = jasmine.createSpyObj('queryService', ['getResponseFromQuery']); queryService.getResponseFromQuery.and.returnValue(specUtil.createServicePromise('queryService')); diff --git a/ui/test/unit/common/displaycontrols/patientProfile/directives/patientProfile.spec.js b/ui/test/unit/common/displaycontrols/patientProfile/directives/patientProfile.spec.js index 2cbe0a76ff..2eab708593 100644 --- a/ui/test/unit/common/displaycontrols/patientProfile/directives/patientProfile.spec.js +++ b/ui/test/unit/common/displaycontrols/patientProfile/directives/patientProfile.spec.js @@ -1,7 +1,7 @@ 'use strict'; describe("Patient Profile display control", function () { - var element, scope, $compile, mockBackend, $window, $q, openMRSPatientMockData, visitService, translateFilter; + var element, scope, $compile, mockBackend, $window, $q, openMRSPatientMockData, visitService, translateFilter, appService; beforeEach(module('ngHtml2JsPreprocessor')); beforeEach(module('bahmni.common.patient')); @@ -30,6 +30,11 @@ describe("Patient Profile display control", function () { visitService = jasmine.createSpyObj('visitService', ['getVisit']); $provide.value('visitService', visitService); + appService = jasmine.createSpyObj('appService', ['getAppDescriptor']); + var appDescriptor = jasmine.createSpyObj('appDescriptor', ['getConfigValue']); + appService.getAppDescriptor.and.returnValue(appDescriptor); + $provide.value('appService', appService); + var patientService = jasmine.createSpyObj('patientService', ['getRelationships', 'getPatient']); patientService.getRelationships.and.callFake(function (param) { return specUtil.respondWithPromise($q, {data: {results: []}}); diff --git a/ui/test/unit/common/patient/services/patientService.spec.js b/ui/test/unit/common/patient/services/patientService.spec.js index 4227af78e9..268d5df585 100644 --- a/ui/test/unit/common/patient/services/patientService.spec.js +++ b/ui/test/unit/common/patient/services/patientService.spec.js @@ -7,8 +7,11 @@ describe('patientService', function () { module('bahmni.common.patient'); module(function($provide) { sessionService = jasmine.createSpyObj('sessionService', ['getLoginLocationUuid']); + sessionService.getLoginLocationUuid.and.returnValue("loginLocationUuid"); $provide.value('sessionService', sessionService); - appService = jasmine.createSpyObj('appDescriptor', ['getConfigValue']); + appService = jasmine.createSpyObj('appService', ['getAppDescriptor']); + var appDescriptor = jasmine.createSpyObj('appDescriptor', ['getConfigValue']); + appService.getAppDescriptor.and.returnValue(appDescriptor); $provide.value('appService', appService); }); @@ -36,4 +39,29 @@ describe('patientService', function () { mockBackend.flush(); }); }) + + describe('luceneSearch', function () { + it('should make http call to lucene search api', function () { + var q = 'test'; + var startIndex = 0; + var identifier = 'identifier'; + var customAttribute = 'customAttribute'; + var searchParams = { + filterOnAllIdentifiers: true, + q: q, + startIndex: startIndex, + identifier: identifier, + loginLocationUuid: sessionService.getLoginLocationUuid(), + patientSearchResultsConfig: customAttribute + } + var results = {}; + mockBackend.expectGET('/openmrs/ws/rest/v1/bahmni/search/patient/lucene?filterOnAllIdentifiers=true&identifier=identifier&loginLocationUuid=loginLocationUuid&patientSearchResultsConfig=customAttribute&q=test&startIndex=0').respond({results: results}); + + patientService.search(q, customAttribute, startIndex, identifier).then(function (response) { + expect(response.data.results).toEqual(results); + }); + + mockBackend.flush(); + }); + }) }); \ No newline at end of file