Skip to content

Commit

Permalink
BAH-4064 | Refactor. IPD Dashboard Link Position (#998)
Browse files Browse the repository at this point in the history
* [Rahul] | BAH-4064 | Refactor. IPD Dashboard Link Position

* [Rahul] | BAH-4064 | Add. IPD Dashboard Link For All IPD Visits

* [Rahul] | BAH-4064 | Add. Enable IPD Dashboard Link Based On Config
  • Loading branch information
rahu1ramesh authored Aug 14, 2024
1 parent 576d0e5 commit 03f75a3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
4 changes: 4 additions & 0 deletions ui/app/clinical/consultation/models/visitHistoryEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Bahmni.Clinical.VisitHistoryEntry = (function () {
return this.stopDatetime === null;
},

isIPDVisit: function () {
return (this.visitType.name || this.visitType.display) === "IPD";
},

isFromCurrentLocation: function (currentVisitLocation) {
var visitLocation = _.get(this.location, 'uuid');
return visitLocation === currentVisitLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ angular.module('bahmni.clinical')
.directive('visitsTable', ['patientVisitHistoryService', 'conceptSetService', 'spinner', '$state', '$q', '$translate', 'appService',
function (patientVisitHistoryService, conceptSetService, spinner, $state, $q, $translate, appService) {
var controller = function ($scope) {
const enableIPDFeature = appService.getAppDescriptor().getConfigValue('enableIPDFeature');
$scope.enableIPDFeature = appService.getAppDescriptor().getConfigValue('enableIPDFeature');
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 () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 class="section-title" ng-show="::params.translationKey" >
<table class="visits dashboard-table" id="visitDisplayTable" ng-if="::hasVisits()">
<tbody>
<tr id="eachVisit" ng-repeat="visit in ::visits | limitTo: params.maximumNoOfVisits">
<td class="name" width="50%">
<td class="name" width="40%">
<a class="visit" ng-click="openVisit(visit)">
<span>{{::visit.startDatetime | bahmniDate}}</span>
<span ng-if="::!visit.isOneDayVisit()">- {{::visit.stopDatetime | bahmniDate }}</span>
Expand All @@ -20,6 +20,12 @@ <h2 class="section-title" ng-show="::params.translationKey" >
</a>
</td>
<td class="value" id="visitType">{{::translateVisitTypes(visit.getVisitType())}}</td>
<td class="value" id="visitType" ng-show="::enableIPDFeature" ng-if="::visit.isIPDVisit()">
<a class="visit" ng-click="openIPDDashboard(visit)">
{{::'VIEW_IPD_DASHBOARD'|translate}}
<i class="fa fa-external-link"></i>
</a>
</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ angular.module('bahmni.common.displaycontrol.navigationlinks')
"translationKey": "PATIENT_REGISTRATION_PAGE_KEY",
"url": "../registration/#/patient/{{patientUuid}}",
"title": "Registration"
},
{
"name": "labEntry",
"translationKey": "LAB_ENTRY_KEY",
"url": "/lab/patient/{{patientUuid}}",
"title": "Lab Entry"
}
];

Expand Down
2 changes: 1 addition & 1 deletion ui/app/i18n/clinical/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"MESSAGE_DIALOG_OPTION_OKAY": "OK",
"MESSAGE_DIALOG_OPTION_REVIEW": "Review",
"MESSAGE_DIALOG_OPTION_DISCARD": "Discard",
"LAB_ENTRY_KEY": "Lab Entry",
"VIEW_IPD_DASHBOARD": "View IPD Dashboard",
"OBS_BOOLEAN_YES_KEY": "Yes",
"OBS_BOOLEAN_NO_KEY": "No",
"CLINICAL_DUPLICATE_DIAGNOSIS_ERROR_MESSAGE": "Please correct the duplicate diagnosis entered.",
Expand Down

0 comments on commit 03f75a3

Please sign in to comment.