Skip to content

Commit

Permalink
Merge pull request #681 from Bahmni/patient-search-results
Browse files Browse the repository at this point in the history
BAH-3179 | Config for displaying patient search results
  • Loading branch information
umair-fayaz authored Aug 28, 2023
2 parents 108a7e9 + a1e413d commit 7476cb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion ui/app/registration/controllers/searchPatientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ angular.module('bahmni.registration')
'messagingService', '$translate', '$filter',
function ($rootScope, $scope, $location, $window, spinner, patientService, appService, messagingService, $translate, $filter) {
$scope.results = [];
var searchDisplayOptions = appService.getAppDescriptor().getConfigValue("patientSearchResultOptions") || {};
var ignoredIdentifiers = new Set(searchDisplayOptions.ignorePatientIdentifiers || []);
$scope.showAge = searchDisplayOptions.showAge != null ? searchDisplayOptions.showAge : true;
$scope.showDOB = searchDisplayOptions.showDOB != null ? searchDisplayOptions.showDOB : false;
$scope.extraIdentifierTypes = _.filter($rootScope.patientConfiguration.identifierTypes, function (identifierType) {
return !identifierType.primary;
return !identifierType.primary && !ignoredIdentifiers.has(identifierType.name);
});
var searching = false;
var maxAttributesFromConfig = 5;
Expand Down
8 changes: 5 additions & 3 deletions ui/app/registration/views/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<section class="reg-search">
<article class="search-seperator-l" ng-if="::patientIdentifierSearchConfig.show">
<form name="searchByIdForm" ng-submit="searchById()" class="simple-form-ui clearfix" >
<label for="registrationNumber"><strong>{{ ::'REGISTRATION_LABEL_PATIENT_ID' | translate}}</strong></label>
<label for="registrationNumber"><strong style="padding-left: 5px;">{{ ::'REGISTRATION_LABEL_PATIENT_ID' | translate}}</strong></label>
<div class="search-patient-id fl">
<input tabindex="2" class="fl" type="text" id="registrationNumber"
ng-model="searchParameters.registrationNumber" focus-me="true"
Expand Down Expand Up @@ -62,7 +62,8 @@
<th><strong>{{ ::'REGISTRATION_LABEL_NAME' | translate}}</strong></th>
<th ng-repeat = "field in ::personSearchResultsConfig.fields track by $index"><strong>{{::convertToTableHeader(field)}}</strong></th>
<th><strong>{{ ::'REGISTRATION_LABEL_GENDER' | translate}}</strong></th>
<th><strong>{{ ::'REGISTRATION_LABEL_AGE' | translate}}</strong></th>
<th ng-if="::showAge"><strong>{{ ::'REGISTRATION_LABEL_AGE' | translate}}</strong></th>
<th ng-if="::showDOB"><strong>{{ ::'REGISTRATION_LABEL_DOB' | translate}}</strong></th>
<th ng-repeat = "field in ::addressSearchResultsConfig.fields"><strong>{{::convertToTableHeader(getAddressColumnName(field))}}</strong></th>
<th><strong>{{ ::'REGISTRATION_LABEL_REGISTRATION_DATE' | translate}}</strong></th>
<th ng-if="::programAttributesSearchConfig.show"><strong>{{::convertToTableHeader(programAttributesSearchConfig.label)}}</strong></th>
Expand All @@ -82,7 +83,8 @@
<td>{{::result.givenName}} {{::result.middleName}} {{::result.familyName}}</td>
<td ng-repeat = "field in ::personSearchResultsConfig.fields track by $index">{{::result.customAttribute[field] || "" | bahmniDateInStrictMode}}</td>
<td>{{::result.gender}}</td>
<td>{{::result.age}}</td>
<td ng-if="::showAge">{{::result.age}}</td>
<td ng-if="::showDOB">{{::result.birthDate | bahmniDate}}</td>
<td ng-repeat = "field in ::addressSearchResultsConfig.fields">{{::result.addressFieldValue[field] || ""}}</td>
<td>{{::result.dateCreated | bahmniDate}}</td>
<td ng-if="::programAttributesSearchConfig.show">{{getProgramAttributeValues(result) | bahmniDateInStrictMode}}</td>
Expand Down

0 comments on commit 7476cb6

Please sign in to comment.