Skip to content

Commit

Permalink
Merge pull request #190 from jembi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
tresorluz authored Dec 7, 2023
2 parents 9af451e + 6221899 commit e51d1df
Show file tree
Hide file tree
Showing 18 changed files with 714 additions and 20 deletions.
3 changes: 2 additions & 1 deletion ui/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ module.exports = function (grunt) {
'<%= yeoman.dist %>/clinical/common/views/visitTabPrint.html',
'<%= yeoman.dist %>/clinical/dashboard/views/dashboardPrint.html',
'<%= yeoman.dist %>/clinical/dashboard/views/printPrescriptionReport.html',
'<%= yeoman.dist %>/common/displaycontrols/prescription/views/prescription.html'
'<%= yeoman.dist %>/common/displaycontrols/prescription/views/prescription.html',
'<%= yeoman.dist %>/clinical/dashboard/views/printLabTestsReport.html'
],
css: '<%= yeoman.dist %>/styles/**/*.css',
options: {
Expand Down
4 changes: 4 additions & 0 deletions ui/app/clinical/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ angular.module('consultation')
'print-prescription': {
templateUrl: 'dashboard/views/printPrescriptionReport.html',
controller: 'PrintPrescriptionReportController'
},
'print-lab-tests': {
templateUrl: 'dashboard/views/printLabTestsReport.html',
controller: 'PrintLabTestsReportController'
}
}
})
Expand Down
34 changes: 24 additions & 10 deletions ui/app/clinical/consultation/controllers/consultationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ angular.module('bahmni.clinical').controller('ConsultationController',
['$scope', '$rootScope', '$state', '$location', '$translate', 'clinicalAppConfigService', 'diagnosisService', 'urlHelper', 'contextChangeHandler',
'spinner', 'encounterService', 'messagingService', 'sessionService', 'retrospectiveEntryService', 'patientContext', '$q',
'patientVisitHistoryService', '$stateParams', '$window', 'visitHistory', 'clinicalDashboardConfig', 'appService',
'ngDialog', '$filter', 'configurations', 'visitConfig', 'conditionsService', 'configurationService', 'auditLogService', 'printer', 'printPrescriptionReportService',
'ngDialog', '$filter', 'configurations', 'visitConfig', 'conditionsService', 'configurationService', 'auditLogService', 'printer', 'printPrescriptionReportService', 'printLabTestsReportService',
function ($scope, $rootScope, $state, $location, $translate, clinicalAppConfigService, diagnosisService, urlHelper, contextChangeHandler,
spinner, encounterService, messagingService, sessionService, retrospectiveEntryService, patientContext, $q,
patientVisitHistoryService, $stateParams, $window, visitHistory, clinicalDashboardConfig, appService,
ngDialog, $filter, configurations, visitConfig, conditionsService, configurationService, auditLogService, printer, printPrescriptionReportService) {
ngDialog, $filter, configurations, visitConfig, conditionsService, configurationService, auditLogService, printer, printPrescriptionReportService, printLabTestsReportService) {
var DateUtil = Bahmni.Common.Util.DateUtil;
var getPreviousActiveCondition = Bahmni.Common.Domain.Conditions.getPreviousActiveCondition;
$scope.togglePrintList = false;
Expand All @@ -19,7 +19,6 @@ angular.module('bahmni.clinical').controller('ConsultationController',
};
$scope.showComment = true;
$scope.showSaveAndContinueButton = true;

$scope.visitHistory = visitHistory;
$scope.consultationBoardLink = clinicalAppConfigService.getConsultationBoardLink();
$scope.showControlPanel = false;
Expand Down Expand Up @@ -74,11 +73,13 @@ angular.module('bahmni.clinical').controller('ConsultationController',
var clinicalDashboardUuid = '0623e3b6-8701-4c07-8493-2930bd67f11a';
var prescriptionReportUuid = '2c6c27b0-3eef-4010-bfbb-9133d0016d25';
var tarvPrescriptionReportUuid = '31f15798-9983-4066-9b06-6868e1ba7210';
var labTestsReportUuid = 'ce9eb283-1852-47eb-8902-11c6dadf220e';

$scope.printButtonDropdownOptions = [
{name: $translate.instant('PRINT_CLINICAL_DASHBOARD_LABEL'), uuid: clinicalDashboardUuid},
{name: $translate.instant('PRESCRIPTION_REPORT_PRINT_PRESCRIPTION_LABEL'), uuid: prescriptionReportUuid},
{name: $translate.instant('PRESCRIPTION_REPORT_PRINT_TARV_PRESCRIPTION_LABEL'), uuid: tarvPrescriptionReportUuid}];
{name: $translate.instant('PRESCRIPTION_REPORT_PRINT_TARV_PRESCRIPTION_LABEL'), uuid: tarvPrescriptionReportUuid},
{name: $translate.instant('PRINT_LAB_TESTS_LABEL'), uuid: labTestsReportUuid} ];

$scope.optionText = function (value) {
return value.name;
Expand All @@ -90,15 +91,28 @@ angular.module('bahmni.clinical').controller('ConsultationController',
} else {
if (option.uuid === prescriptionReportUuid) {
$rootScope.isTarvReport = false;
$rootScope.isLabTestsReport = false;
} else if (option.uuid === tarvPrescriptionReportUuid) {
$rootScope.isTarvReport = true;
$rootScope.isLabTestsReport = false;
} else if (option.uuid === labTestsReportUuid) {
$rootScope.isTarvReport = false;
$rootScope.isLabTestsReport = true;
}
if ($rootScope.isLabTestsReport) {
printLabTestsReportService.getReportModel($stateParams.patientUuid)
.then(function (reportData) {
$rootScope.labTestsReportData = reportData;
printer.printFromScope("dashboard/views/printLabTestsReport.html", $scope, function () { });
});
}
else {
printPrescriptionReportService.getReportModel($stateParams.patientUuid)
.then(function (reportData) {
$rootScope.prescriptionReportData = reportData;
printer.printFromScope("dashboard/views/printPrescriptionReport.html", $scope, function () { });
});
}

printPrescriptionReportService.getReportModel($stateParams.patientUuid)
.then(function (reportData) {
$rootScope.prescriptionReportData = reportData;
printer.printFromScope("dashboard/views/printPrescriptionReport.html", $scope, function () { });
});
}
};

Expand Down
4 changes: 2 additions & 2 deletions ui/app/clinical/consultation/views/disposition.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
</div>
<div class="box disposition-tab">
<form ng-submit="submit()">
<label for="dispositionAction">{{ 'DISPOSITION_TYPE_LABEL'|translate }}: </label>
<label for="dispositionAction">{{ ::'DISPOSITION_TYPE_LABEL'|translate }}: </label>
<select id="dispositionAction" ng-model="dispositionCode" ng-options="d.code as d.name for d in dispositionActions" ng-change="clearDispositionNote();" ng-disabled="isRetrospectiveMode()">
<option value=""></option>
</select>
<div class="dispositionNotesWrap">
<label class="disposition-notes" for="dispositionNotes">{{ 'DISPOSITION_NOTE_LABEL'|translate }}: </label>
<label class="disposition-notes" for="dispositionNotes">{{ ::'DISPOSITION_NOTE_LABEL'|translate }}: </label>
<p ng-if="showWarningForEarlierDispositionNote()" class="caution" >
<i class="fa fa-exclamation-sign small"></i>
<span>{{ 'DISPOSITION_NOTE_WILL_BE_REMOVED_WARNING_MESSAGE'|translate }}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';
angular.module('bahmni.clinical')
.controller('PrintLabTestsReportController', ['$scope', '$rootScope',
function ($scope, $rootScope) {
$scope.isLabTestsReport = $rootScope.isLabTestsReport;
$scope.data = $rootScope.labTestsReportData;
}]);
24 changes: 24 additions & 0 deletions ui/app/clinical/dashboard/directives/labTestsReport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

angular.module('bahmni.clinical')
.directive('labTestsReport', function () {
var controller = function ($scope) {
$scope.getCurrentDate = function () {
return moment().format('DD/MM/YYYY');
};

$scope.getFullname = function () {
return $scope.data.patientInfo.lastName + ' ' + $scope.data.patientInfo.firstName;
};
};

return {
restrict: 'E',
controller: controller,
scope: {
data: "=",
isLabTestsReport: "="
},
templateUrl: "dashboard/views/labTestsReport.html"
};
});
Loading

0 comments on commit e51d1df

Please sign in to comment.