diff --git a/ui/app/clinical/consultation/models/visitHistoryEntry.js b/ui/app/clinical/consultation/models/visitHistoryEntry.js index 5c0baef496..4ddb66f817 100644 --- a/ui/app/clinical/consultation/models/visitHistoryEntry.js +++ b/ui/app/clinical/consultation/models/visitHistoryEntry.js @@ -10,6 +10,10 @@ Bahmni.Clinical.VisitHistoryEntry = (function () { return this.stopDatetime === null; }, + isActiveIPDVisit: function () { + return this.stopDatetime === null && (this.visitType.name || this.visitType.display) === "IPD"; + }, + isFromCurrentLocation: function (currentVisitLocation) { var visitLocation = _.get(this.location, 'uuid'); return visitLocation === currentVisitLocation; diff --git a/ui/app/clinical/displaycontrols/allvisits/directives/visitsTable.js b/ui/app/clinical/displaycontrols/allvisits/directives/visitsTable.js index 0ad170bf47..d53eff8e77 100644 --- a/ui/app/clinical/displaycontrols/allvisits/directives/visitsTable.js +++ b/ui/app/clinical/displaycontrols/allvisits/directives/visitsTable.js @@ -8,17 +8,21 @@ angular.module('bahmni.clinical') var emitNoDataPresentEvent = function () { $scope.$emit("no-data-present-event"); }; + $scope.openVisit = function (visit) { if ($scope.$parent.closeThisDialog) { $scope.$parent.closeThisDialog("closing modal"); } - if (visit.visitType.display === "IPD" && enableIPDFeature) { - $state.go('patient.dashboard.ipdVisit', {visitUuid: visit.uuid, source: 'clinical'}); - } else { - $state.go('patient.dashboard.visit', {visitUuid: visit.uuid}); - } + $state.go('patient.dashboard.visit', {visitUuid: visit.uuid}); }; + $scope.openIPDDashboard = function (visit) { + if ($scope.$parent.closeThisDialog) { + $scope.$parent.closeThisDialog("closing modal"); + } + $state.go('patient.dashboard.ipdVisit', {visitUuid: visit.uuid, source: 'clinical'}); + } + $scope.hasVisits = function () { return $scope.visits && $scope.visits.length > 0; }; diff --git a/ui/app/clinical/displaycontrols/allvisits/views/visitsTable.html b/ui/app/clinical/displaycontrols/allvisits/views/visitsTable.html index 8693bf92f1..9cab966842 100644 --- a/ui/app/clinical/displaycontrols/allvisits/views/visitsTable.html +++ b/ui/app/clinical/displaycontrols/allvisits/views/visitsTable.html @@ -19,7 +19,14 @@

title="Current Visit"> - {{::translateVisitTypes(visit.getVisitType())}} + + + {{::translateVisitTypes(visit.getVisitType())}} + + + + {{::translateVisitTypes(visit.getVisitType())}} +