Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:esaude/openmrs-module-bahmniapps…
Browse files Browse the repository at this point in the history
… into release-0.91
  • Loading branch information
Nathan Floor committed Sep 9, 2019
2 parents afb4953 + 8ff8a52 commit 2b5a7b8
Show file tree
Hide file tree
Showing 120 changed files with 2,436 additions and 502 deletions.
Empty file added .attach_pid30762
Empty file.
6 changes: 3 additions & 3 deletions ui/app/admin/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<html lang="en" ng-app="admin">
<head>
<meta charset="utf-8">
<title>Bahmni Admin</title>
<title>{{'ADMIN_APP_TITLE'|translate}}</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0, minimal-ui" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
Expand All @@ -13,7 +13,7 @@
<link rel="stylesheet" href="../styles/home.css"/>
<!-- endbuild -->
</head>
<body ng-app="admin" class="admin-app">
<body class="admin-app">
<div ng-include src="'../common/ui-helper/header.html'"></div>
<div ng-include src="'../common/ui-helper/messages.html'"></div>
<div class="opd-wrapper">
Expand Down
2 changes: 2 additions & 0 deletions ui/app/adt/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<script src="../common/ui-helper/services/contextChangeHandler.js"></script>
<script src="../common/ui-helper/directives/popOver.js"></script>
<script src="../common/ui-helper/directives/splitButton.js"></script>
<script src="../common/ui-helper/directives/splitButtonNew.js"></script>
<script src="../common/ui-helper/directives/backLinks.js"></script>
<script src="../common/ui-helper/directives/focusOn.js"></script>
<script src="../common/ui-helper/directives/bmShow.js"></script>
Expand Down Expand Up @@ -196,6 +197,7 @@
<script src="../common/displaycontrols/disposition/directives/disposition.js"></script>
<script src="../common/displaycontrols/conditionsList/directives/conditionsList.js"></script>
<script src="../common/displaycontrols/allergiesList/directives/allergiesList.js"></script>
<script src="../common/displaycontrols/treatmentStartdate/directives/TreatmentDate.js"></script>

<script src="../common/displaycontrols/admissiondetails/init.js"></script>
<script src="../common/displaycontrols/admissiondetails/directives/admissionDetails.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ angular.module('bahmni.appointments')
$state.go(path, $state.params, {reload: false});
};

$scope.hideAppointmentButton = false;

$scope.$on("HideAppointmentButton", function (evt, data) {
if (data === true) {
$scope.hideAppointmentButton = true;
} else {
$scope.hideAppointmentButton = false;
}
});

$scope.getCurrentAppointmentTabName = function () {
return $state.current.tabName;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ angular.module('bahmni.appointments')
$scope.appointment = Bahmni.Appointments.AppointmentViewModel.create(appointmentContext.appointment || { appointmentKind: 'Scheduled' }, appointmentCreateConfig);
$scope.selectedService = appointmentCreateConfig.selectedService;
$scope.isPastAppointment = $scope.isEditMode() ? Bahmni.Common.Util.DateUtil.isBeforeDate($scope.appointment.date, moment().startOf('day')) : false;
$scope.appointment.patient = $state.params.patient;
if ($state.params.patient) {
$scope.appointment.patient = $state.params.patient;
}
$scope.appointment.date = $stateParams.selectedAppointmentDate || null;
$scope.selectedAppointmentBlock = $stateParams.selectedAppointmentBlock;
if ($scope.selectedAppointmentBlock) {
Expand Down Expand Up @@ -183,7 +185,7 @@ angular.module('bahmni.appointments')
};
formattedUrl = appService.getAppDescriptor().formatUrl(patientSearchURL, params);
}
return (spinner.forPromise(formattedUrl ? $http.get(Bahmni.Common.Constants.RESTWS_V1 + formattedUrl) : patientService.search($scope.appointment.patient.label)).then(function (response) {
return (spinner.forPromise(formattedUrl ? $http.get(Bahmni.Common.Constants.RESTWS_V1 + formattedUrl) : patientService.statusBasedSearch($scope.appointment.patient.label)).then(function (response) {
return response.data.pageOfResults;
}));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ angular.module('bahmni.appointments')
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnResize,
eventRender: $scope.eventRender,
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source'
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
slotLabelFormat: ['HH:mm']
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ angular.module('bahmni.appointments')
};

$scope.goBackToPreviousView = function () {
$scope.$emit("HideAppointmentButton", false);
$state.params.patient = null;
$scope.searchedPatient = false;
$scope.tableInfo[2].enable = false;
$scope.filteredAppointments = oldPatientData;
Expand Down
12 changes: 9 additions & 3 deletions ui/app/appointments/directives/patientSearch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

angular.module('bahmni.appointments')
.directive('patientSearch', ['patientService', 'appointmentsService', 'spinner', '$state', function (patientService, appointmentsService, spinner, $state) {
.directive('patientSearch', ['patientService', 'appointmentsService', 'spinner', '$state', '$q', function (patientService, appointmentsService, spinner, $state, $q) {
return {
restrict: "E",
scope: {
Expand All @@ -25,8 +25,14 @@ angular.module('bahmni.appointments')

$scope.onSelectPatient = function (data) {
$state.params.patient = data;
spinner.forPromise(appointmentsService.search({patientUuid: data.uuid}).then(function (oldAppointments) {
var appointmentInDESCOrderBasedOnStartDateTime = _.sortBy(oldAppointments.data, "startDateTime").reverse();
spinner.forPromise($q.all([appointmentsService.search({patientUuid: data.uuid}), patientService.getPatientStatusState(data.uuid)]).then(function (oldAppointments) {
var patientState = oldAppointments[1].data[0].patient_state;
if (patientState == 'INACTIVE_TRANSFERRED_OUT' || patientState == 'INACTIVE_SUSPENDED' || patientState == 'INACTIVE_DEATH') {
$scope.$emit("HideAppointmentButton", true);
} else {
$scope.$emit("HideAppointmentButton", false);
}
var appointmentInDESCOrderBasedOnStartDateTime = _.sortBy(oldAppointments[0].data, "startDateTime").reverse();
$scope.onSearch(appointmentInDESCOrderBasedOnStartDateTime);
}));
};
Expand Down
6 changes: 3 additions & 3 deletions ui/app/appointments/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<html lang="en" ng-app="bahmni.appointments">
<head>
<meta charset="utf-8">
<title>Appointment Scheduling</title>
<title>{{'APPOINTMENTS_APP_TITLE'|translate}}</title>
<link rel="stylesheet" href="../lib/jquery/jquery-ui-1.10.4.custom.min.css">
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link rel="stylesheet" href="../components/ngDialog/css/ngDialog.min.css"/>
Expand All @@ -19,7 +19,7 @@
<!-- endbuild -->
</head>
<body>
<div ng-app="bahmni.appointments" class="bahmni-appointments">
<div class="bahmni-appointments">
<div ui-view="additional-header"></div>
<div ng-include src="'../common/ui-helper/messages.html'"></div>
<div ui-view="mainContent"></div>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/appointments/views/manage/allAppointments.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a ng-class="{'active': getCurrentTabName() === 'calendar'}" ng-if="enableCalendarView && !isSearchEnabled" ng-click="navigateTo('calendar')">
{{::'CALENDAR_VIEW' | translate}}
</a>
<a show-if-privilege="{{manageAppointmentPrivilege}}" class="add-app-btn" ng-click="navigateTo(getCurrentTabName() + '.new')">
<a show-if-privilege="{{manageAppointmentPrivilege}}" ng-if="!hideAppointmentButton" class="add-app-btn" ng-click="navigateTo(getCurrentTabName() + '.new')">
{{::'ADD_NEW_APPOINTMENT' | translate }}
</a>
</p>
Expand Down
1 change: 1 addition & 0 deletions ui/app/bedmanagement/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<script src="../common/ui-helper/services/contextChangeHandler.js"></script>
<script src="../common/ui-helper/directives/popOver.js"></script>
<script src="../common/ui-helper/directives/splitButton.js"></script>
<script src="../common/ui-helper/directives/splitButtonNew.js"></script>
<script src="../common/ui-helper/directives/backLinks.js"></script>
<script src="../common/ui-helper/directives/focusOn.js"></script>
<script src="../common/ui-helper/directives/bmShow.js"></script>
Expand Down
9 changes: 8 additions & 1 deletion ui/app/clinical/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ angular.module('consultation', ['ui.router', 'bahmni.clinical', 'bahmni.common.c
'bahmni.common.displaycontrol.disposition', 'bahmni.common.displaycontrol.custom', 'bahmni.common.displaycontrol.admissiondetails',
'bahmni.common.routeErrorHandler', 'bahmni.common.displaycontrol.disposition',
'httpErrorInterceptor', 'pasvaz.bindonce', 'infinite-scroll', 'bahmni.common.util', 'ngAnimate', 'ngDialog',
'bahmni.common.displaycontrol.patientprofile', 'bahmni.common.displaycontrol.diagnosis', 'bahmni.common.displaycontrol.conditionsList', 'bahmni.common.displaycontrol.allergiesList', 'RecursionHelper', 'ngSanitize',
'bahmni.common.displaycontrol.patientprofile', 'bahmni.common.displaycontrol.diagnosis', 'bahmni.common.displaycontrol.conditionsList', 'bahmni.common.displaycontrol.allergiesList', 'bahmni.common.displaycontrol.treatmentDate', 'RecursionHelper', 'ngSanitize',
'bahmni.common.orders', 'bahmni.common.displaycontrol.orders', 'bahmni.common.displaycontrol.prescription',
'bahmni.common.displaycontrol.navigationlinks', 'bahmni.common.displaycontrol.programs',
'bahmni.common.displaycontrol.pacsOrders', 'bahmni.common.uicontrols', 'bahmni.common.uicontrols.programmanagment', 'pascalprecht.translate',
Expand Down Expand Up @@ -157,6 +157,10 @@ angular.module('consultation')
'dashboard-content': {
templateUrl: 'dashboard/views/dashboard.html',
controller: 'PatientDashboardController'
},
'print-prescription': {
templateUrl: 'dashboard/views/printPrescriptionReport.html',
controller: 'PrintPrescriptionReportController'
}
}
})
Expand Down Expand Up @@ -343,6 +347,9 @@ angular.module('consultation')
resolve: {
visitSummary: function (visitSummaryInitialization, $stateParams) {
return visitSummaryInitialization($stateParams.visitUuid);
},
visitHistory: function (visitHistoryInitialization, $stateParams) {
return visitHistoryInitialization($stateParams.patientUuid);
}
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
'use strict';

angular.module('bahmni.clinical')
.controller('PatientListHeaderController', ['$scope', '$rootScope', '$bahmniCookieStore', 'providerService', 'spinner', 'locationService', '$window', 'ngDialog', 'retrospectiveEntryService', '$translate',
function ($scope, $rootScope, $bahmniCookieStore, providerService, spinner, locationService, $window, ngDialog, retrospectiveEntryService, $translate) {
.controller('PatientListHeaderController', ['$scope', '$rootScope', '$stateParams', '$bahmniCookieStore', 'providerService', 'spinner', 'locationService', '$window', 'ngDialog', 'retrospectiveEntryService', '$translate',
function ($scope, $rootScope, $stateParams, $bahmniCookieStore, providerService, spinner, locationService, $window, ngDialog, retrospectiveEntryService, $translate) {
var DateUtil = Bahmni.Common.Util.DateUtil;
if ($stateParams.configName === 'programs') {
$rootScope.title = $translate.instant('SERVICES_APP_TITLE');
} else {
$rootScope.title = $translate.instant('CLINICAL_APP_TITLE');
}
$scope.maxStartDate = DateUtil.getDateWithoutTime(DateUtil.today());
var selectedProvider = {};
$scope.retrospectivePrivilege = Bahmni.Common.Constants.retrospectivePrivilege;
Expand Down
3 changes: 3 additions & 0 deletions ui/app/clinical/common/views/visitSummary.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<div data-ng-switch-when="allergiesList">
<allergies-list params="section" patient="patient"></allergies-list>
</div>
<div data-ng-switch-when="treatmentDate">
<treatment-date params="section" patient="patient"></treatment-date>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 2b5a7b8

Please sign in to comment.