Skip to content

Commit

Permalink
Bindu | Show order names based on the locale. (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
binduak authored Nov 5, 2024
1 parent a506b04 commit 2f7ca8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ui/app/clinical/consultation/directives/orderSelector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

angular.module('bahmni.clinical')
.directive('orderSelector', [function () {
.directive('orderSelector', ['$rootScope', function ($rootScope) {
var link = function ($scope) {
$scope.hasTests = function () {
var rootConcept = $scope.tab.leftCategory;
Expand All @@ -19,6 +19,11 @@ angular.module('bahmni.clinical')
$scope.filterBySearchString = function (test) {
return _.some(test.names, filterBySearchString);
};

$scope.filterNameByLocale = function (test) {
return _.find(test.names, {conceptNameType: "SHORT", locale: $rootScope.currentUser.userProperties.defaultLocale }) || _.find(test.names, {conceptNameType: "SHORT"})
|| _.find(test.names, {conceptNameType: "FULLY_SPECIFIED"});
};
};

return {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/clinical/consultation/views/orderSelector.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ng-click="toggleOrderSelection(test)"
ng-class="{active:isActiveOrderPresent(test), noteditable:isTestIndirectlyPresent(test)}"
ng-disabled="isTestIndirectlyPresent(test)">
<i class="fa fa-ok" ng-show="isActiveOrderPresent(test)"></i>{{getName(test)}}
<i class="fa fa-ok" ng-show="isActiveOrderPresent(test)"></i>{{filterNameByLocale(test).name}}
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/clinical/ordersTabInitialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
angular.module('bahmni.clinical').factory('ordersTabInitialization',
['conceptSetService', 'spinner', function (conceptSetService, spinner) {
return function () {
var allOrderables = spinner.forPromise(conceptSetService.getConcept({name: "All Orderables", v: "custom:(uuid,name:(display,uuid),names:(display,conceptNameType,name),set,setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name),set,setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name),set,conceptClass:(uuid,name,description),setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name),set,conceptClass:(uuid,name,description),setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name),set,conceptClass:(uuid,name,description))))))"})).then(function (response) {
var allOrderables = spinner.forPromise(conceptSetService.getConcept({name: "All Orderables", v: "custom:(uuid,name:(display,uuid),names:(display,conceptNameType,name,locale),set,setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name,locale),set,setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name,locale),set,conceptClass:(uuid,name,description),setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name,locale),set,conceptClass:(uuid,name,description),setMembers:(uuid,name:(display,uuid),names:(display,conceptNameType,name,locale),set,conceptClass:(uuid,name,description))))))"})).then(function (response) {
var allOrderables = {};
_.forEach(response.data.results[0].setMembers, function (orderable) {
var conceptName = _.find(orderable.names, {conceptNameType: "SHORT"}) || _.find(orderable.names, {conceptNameType: "FULLY_SPECIFIED"});
Expand Down

0 comments on commit 2f7ca8c

Please sign in to comment.