From 3c15701090eb23e995f04b3380cdad0fddb4fa80 Mon Sep 17 00:00:00 2001 From: Triumf Maqedonci Date: Thu, 15 Sep 2022 14:50:27 +0200 Subject: [PATCH] Error: Show different range for lab-test #441 --- .../directives/investigationTableRow.js | 13 +++++++++++++ .../services/labOrderResultService.js | 2 +- .../views/investigationTableRow.html | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ui/app/clinical/displaycontrols/investigationresults/directives/investigationTableRow.js b/ui/app/clinical/displaycontrols/investigationresults/directives/investigationTableRow.js index dc2828140e..a03331c669 100644 --- a/ui/app/clinical/displaycontrols/investigationresults/directives/investigationTableRow.js +++ b/ui/app/clinical/displaycontrols/investigationresults/directives/investigationTableRow.js @@ -13,6 +13,19 @@ angular.module('bahmni.clinical') $scope.hasNotes = function () { return $scope.test.notes || $scope.test.showNotes ? true : false; }; + + $scope.getFormattedRange = function(test) { + if (test.minNormal && test.maxNormal) { + return "(" + test.minNormal + " - " + test.maxNormal + ")" + } else if (test.minNormal && !test.maxNormal) { + return "(" + test.minNormal + "<)" + } else if (!test.minNormal && test.maxNormal) { + return "(<" + test.maxNormal + ")" + } else { + return "" + } + }; + $scope.getLocaleSpecificNameForPanel = function (test) { if ($scope.test.preferredPanelName != null) { return test.preferredPanelName; diff --git a/ui/app/clinical/displaycontrols/investigationresults/services/labOrderResultService.js b/ui/app/clinical/displaycontrols/investigationresults/services/labOrderResultService.js index 5df31bba55..c72e67702f 100644 --- a/ui/app/clinical/displaycontrols/investigationresults/services/labOrderResultService.js +++ b/ui/app/clinical/displaycontrols/investigationresults/services/labOrderResultService.js @@ -9,7 +9,7 @@ angular.module('bahmni.clinical') var sanitizeData = function (labOrderResults) { labOrderResults.forEach(function (result) { result.accessionDateTime = Bahmni.Common.Util.DateUtil.parse(result.accessionDateTime); - result.hasRange = result.minNormal && result.maxNormal; + result.hasRange = result.minNormal || result.maxNormal; }); }; diff --git a/ui/app/clinical/displaycontrols/investigationresults/views/investigationTableRow.html b/ui/app/clinical/displaycontrols/investigationresults/views/investigationTableRow.html index a8fd3562ed..82c0b0b968 100644 --- a/ui/app/clinical/displaycontrols/investigationresults/views/investigationTableRow.html +++ b/ui/app/clinical/displaycontrols/investigationresults/views/investigationTableRow.html @@ -8,13 +8,13 @@ {{test.preferredNameByLocale}} - + - +