Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-4064 | Refactor. IPD Dashboard Link Position #998

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading