Skip to content

Commit

Permalink
Error: Show different range for lab-test Bahmni#441
Browse files Browse the repository at this point in the history
  • Loading branch information
TriumfM committed Sep 15, 2022
1 parent 386a4c9 commit 3c15701
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<span ng-if="test.labReportUrl">
<a class="uploaded-file" href="{{test.labReportUrl}}" stop-event-propagation="click" target="_blank">{{test.preferredNameByLocale}}
<span bo-show="test.hasRange" class="range">
<span bo-text="'(' + test.minNormal + ' - ' + test.maxNormal + ')'"></span>
<span bo-text="getFormattedRange(test)"></span>
</span>
<span bo-show="test.testUnitOfMeasurement" class="range" bo-text="test.testUnitOfMeasurement"></span>
</a>
</span>
<span bo-show="test.hasRange && !test.uploadedFileName" class="range">
<span bo-text="'(' + test.minNormal + ' - ' + test.maxNormal + ')'"></span>
<span bo-text="getFormattedRange(test)"></span>
</span>
<span bo-show="test.testUnitOfMeasurement" class="range" bo-text="test.testUnitOfMeasurement"></span>
</td>
Expand Down

0 comments on commit 3c15701

Please sign in to comment.