diff --git a/ui/app/clinical/app.js b/ui/app/clinical/app.js index 107f8d787..bc0158f75 100644 --- a/ui/app/clinical/app.js +++ b/ui/app/clinical/app.js @@ -165,6 +165,14 @@ angular.module('consultation') 'print-lab-tests': { templateUrl: 'dashboard/views/printLabTestsReport.html', controller: 'PrintLabTestsReportController' + }, + 'print-hospitalization-certificate': { + templateUrl: 'dashboard/views/printHospitalizationCertificate.html', + controller: 'PrintHospitalizationCertificate' + }, + 'print-replacement-certificate': { + templateUrl: 'dashboard/views/printMedicalReplacementCertificate.html', + controller: 'replacementCertificateController' } } }) diff --git a/ui/app/clinical/consultation/controllers/consultationController.js b/ui/app/clinical/consultation/controllers/consultationController.js index 685db4a26..b084bc273 100644 --- a/ui/app/clinical/consultation/controllers/consultationController.js +++ b/ui/app/clinical/consultation/controllers/consultationController.js @@ -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', 'printLabTestsReportService', + 'ngDialog', '$filter', 'configurations', 'visitConfig', 'conditionsService', 'configurationService', 'auditLogService', 'printer', 'printPrescriptionReportService', 'printLabTestsReportService', 'printHospitalizationCertificateService', 'printReplacementCertificateService', 'printPregnancyCertificateService', 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, printLabTestsReportService) { + ngDialog, $filter, configurations, visitConfig, conditionsService, configurationService, auditLogService, printer, printPrescriptionReportService, printLabTestsReportService, printHospitalizationCertificateService, printReplacementCertificateService, printPregnancyCertificateService) { var DateUtil = Bahmni.Common.Util.DateUtil; var getPreviousActiveCondition = Bahmni.Common.Domain.Conditions.getPreviousActiveCondition; $scope.togglePrintList = false; @@ -74,12 +74,17 @@ angular.module('bahmni.clinical').controller('ConsultationController', var prescriptionReportUuid = '2c6c27b0-3eef-4010-bfbb-9133d0016d25'; var tarvPrescriptionReportUuid = '31f15798-9983-4066-9b06-6868e1ba7210'; var labTestsReportUuid = 'ce9eb283-1852-47eb-8902-11c6dadf220e'; - + var hospitalizationCertificateUuid = '23c9b86c-893a-4941-86ca-d17fdbe4c10f'; + var replacementCertificateUuid = '5576eef4-5922-4f7d-9b8c-b61f2648b7c2'; + var pregnancyCertificateUuid = 'e6a80189-1a9c-4470-95c5-e8b214a64544'; $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('PRINT_LAB_TESTS_LABEL'), uuid: labTestsReportUuid} ]; + {name: $translate.instant('PRINT_LAB_TESTS_LABEL'), uuid: labTestsReportUuid}, + {name: $translate.instant('PRINT_HOSPITALIZATION_CERTIFICATE_LABEL'), uuid: hospitalizationCertificateUuid}, + {name: $translate.instant('PRINT_MEDICAL_REPLACEMENT_CERTIFICATE_LABEL'), uuid: replacementCertificateUuid}, + {name: $translate.instant('PREGNANCY_CERTIFICATE_TITLE'), uuid: pregnancyCertificateUuid}]; $scope.optionText = function (value) { return value.name; @@ -92,12 +97,40 @@ angular.module('bahmni.clinical').controller('ConsultationController', if (option.uuid === prescriptionReportUuid) { $rootScope.isTarvReport = false; $rootScope.isLabTestsReport = false; + $rootScope.isHospitalizationCertificate = false; + $rootScope.isReplacementCertificate = false; + $rootScope.isPregnantCertificate = false; } else if (option.uuid === tarvPrescriptionReportUuid) { $rootScope.isTarvReport = true; $rootScope.isLabTestsReport = false; + $rootScope.isReplacementCertificate = false; + $rootScope.isHospitalizationCertificate = false; + $rootScope.isReplacementCertificate = false; + $rootScope.isPregnantCertificate = false; } else if (option.uuid === labTestsReportUuid) { $rootScope.isTarvReport = false; + $rootScope.isHospitalizationCertificate = false; $rootScope.isLabTestsReport = true; + $rootScope.isReplacementCertificate = false; + $rootScope.isPregnantCertificate = false; + } else if (option.uuid === hospitalizationCertificateUuid) { + $rootScope.isTarvReport = false; + $rootScope.isHospitalizationCertificate = true; + $rootScope.isLabTestsReport = false; + $rootScope.isReplacementCertificate = false; + $rootScope.isPregnantCertificate = false; + } else if (option.uuid === replacementCertificateUuid) { + $rootScope.isTarvReport = false; + $rootScope.isHospitalizationCertificate = false; + $rootScope.isLabTestsReport = false; + $rootScope.isReplacementCertificate = true; + $rootScope.isPregnantCertificate = false; + } else if (option.uuid === pregnancyCertificateUuid) { + $rootScope.isTarvReport = false; + $rootScope.isHospitalizationCertificate = false; + $rootScope.isLabTestsReport = false; + $rootScope.isReplacementCertificate = false; + $rootScope.isPregnantCertificate = true; } if ($rootScope.isLabTestsReport) { printLabTestsReportService.getReportModel($stateParams.patientUuid) @@ -105,8 +138,26 @@ angular.module('bahmni.clinical').controller('ConsultationController', $rootScope.labTestsReportData = reportData; printer.printFromScope("dashboard/views/printLabTestsReport.html", $scope, function () { }); }); - } - else { + } else if ($rootScope.isHospitalizationCertificate) { + printHospitalizationCertificateService.getReportModel($stateParams.patientUuid) + .then(function (reportData) { + $rootScope.certificateData = reportData; + printer.printFromScope("dashboard/views/printHospitalizationCertificate.html", $scope, function () { }); + }); + } else if ($rootScope.isReplacementCertificate) { + printReplacementCertificateService.getReportModel($stateParams.patientUuid) + .then(function (reportData) { + $rootScope.data = reportData; + printer.printFromScope("dashboard/views/printMedicalReplacementCertificate.html", $scope, function () { }); + }); + } else if ($rootScope.isPregnantCertificate) { + printPregnancyCertificateService.getReportModel($stateParams.patientUuid) + .then(function (reportData) { + $rootScope.data = reportData; + console.log($rootScope.data); + printer.printFromScope("dashboard/views/printPregnancyCertificate.html", $scope, function () { }); + }); + } else { printPrescriptionReportService.getReportModel($stateParams.patientUuid) .then(function (reportData) { $rootScope.prescriptionReportData = reportData; diff --git a/ui/app/clinical/consultation/controllers/drugOrderHistoryController.js b/ui/app/clinical/consultation/controllers/drugOrderHistoryController.js index 9a782efc9..fef91ce9f 100644 --- a/ui/app/clinical/consultation/controllers/drugOrderHistoryController.js +++ b/ui/app/clinical/consultation/controllers/drugOrderHistoryController.js @@ -2,9 +2,9 @@ angular.module('bahmni.clinical') .controller('DrugOrderHistoryController', ['$scope', '$filter', '$stateParams', 'activeDrugOrders', - 'treatmentConfig', 'treatmentService', 'spinner', 'drugOrderHistoryHelper', 'visitHistory', '$translate', '$rootScope', + 'treatmentConfig', 'treatmentService', 'spinner', 'drugOrderHistoryHelper', 'visitHistory', '$translate', '$rootScope', '$http', 'messagingService', function ($scope, $filter, $stateParams, activeDrugOrders, treatmentConfig, treatmentService, spinner, - drugOrderHistoryHelper, visitHistory, $translate, $rootScope) { + drugOrderHistoryHelper, visitHistory, $translate, $rootScope, $http, messagingService) { var DrugOrderViewModel = Bahmni.Clinical.DrugOrderViewModel; var DateUtil = Bahmni.Common.Util.DateUtil; var currentVisit = visitHistory.activeVisit; @@ -17,6 +17,17 @@ angular.module('bahmni.clinical') $scope.consultation.drugOrderGroups = []; createPrescribedDrugOrderGroups(); createRecentDrugOrderGroup(activeAndScheduledDrugOrders); + + // Added exsiting Dispense date to orders + $scope.consultation.drugOrderGroups.forEach(function (item) { + if (item.hasOwnProperty('drugOrders')) { + item.drugOrders.forEach(function (order) { + if (order.hasOwnProperty('uuid')) { + setDispenseDate(order); + } + }); + } + }); }; var getPreviousVisitDrugOrders = function () { @@ -152,6 +163,13 @@ angular.module('bahmni.clinical') drugOrder.orderReasonNotesEnabled = false; }; + $scope.start = function (drugOrder) { + if (drugOrder.isDiscontinuedAllowed) { + $rootScope.$broadcast("event:discontinueDrugOrder", drugOrder); + $scope.updateFormConditions(drugOrder); + } + }; + $scope.discontinue = function (drugOrder) { if (drugOrder.isDiscontinuedAllowed) { $rootScope.$broadcast("event:discontinueDrugOrder", drugOrder); @@ -176,6 +194,84 @@ angular.module('bahmni.clinical') $scope.consultation.drugOrdersWithUpdatedOrderAttributes[drugOrder.uuid] = drugOrder; } }; + $scope.discontinue = function (drugOrder) { + if (drugOrder.isDiscontinuedAllowed) { + $rootScope.$broadcast("event:discontinueDrugOrder", drugOrder); + $scope.updateFormConditions(drugOrder); + } + }; + $scope.undoUpdateDispenseDateView = function (drugOrder) { + drugOrder.isMarkedForDispenseDate = false; + }; + var getDispenseDate = function (order) { + return new Promise(function (resolve, reject) { + $http.get(Bahmni.Common.Constants.DispenseDate + '/' + order.uuid) + .then(function (response) { + var data = response.data; + var date = DateUtil.getDateWithoutTime(data.dispenseDate); + if (date != null) { + resolve(new Date(date)); + } else { + resolve(null); + } + }) + .catch(function (error) { + // Handle error + console.error('Error making GET request:', error); + reject(error); + }); + }); + }; + var setDispenseDate = function (order) { + getDispenseDate(order) + .then(function (dispenseDate) { + order.dispenseDate = dispenseDate; + }) + .catch(function (error) { + // Handle error + console.error("Error:", error); + }); + }; + $scope.showUpdateDispenseDateView = function (drugOrder) { + getDispenseDate(drugOrder) + .then(function (dispenseDate) { + console.log("Dispense Date:", dispenseDate); + if (dispenseDate != null) { + drugOrder.isDispenseDatePresent = true; + drugOrder.dispenseDate = new Date(dispenseDate); + } else { + console.log("The Dispense Date:", dispenseDate); + } + }) + .catch(function (error) { + // Handle error + console.error("Error:", error); + }); + drugOrder.isMarkedForDispenseDate = true; + }; + $scope.updateDispenseDate = function (drugOrder) { + if (drugOrder.dispenseDate !== null) { + var data = { + dispenseDate: drugOrder.dispenseDate, + orderUuid: drugOrder.uuid + // Add more key-value pairs as needed + }; + var url = Bahmni.Common.Constants.DispenseDate; + $http.post(url, data) + .then(function (response) { + // Handle success + console.log('POST request successful:', response.data); + messagingService.showMessage('info', 'MEDICATION_DISPENSE_DATE_SUCCESSFULLY_SAVED'); + }) + .catch(function (error) { + // Handle error + console.error('Error making POST request:', error); + messagingService.showMessage('error', 'MEDICATION_DISPENSE_DATE_ERROR_MESSAGE'); + }); + } else { + messagingService.showMessage('error', 'MEDICATION_DISPENSE_DATE_EMPTY'); + } + }; $scope.toggleDrugOrderAttribute = function (orderAttribute, valueToSet) { orderAttribute.value = valueToSet !== undefined ? valueToSet : !orderAttribute.value; @@ -227,7 +323,7 @@ angular.module('bahmni.clinical') }; var getAttribute = function (drugOrder, attributeName) { - return _.find(drugOrder.orderAttributes, {name: attributeName}); + return _.find(drugOrder.orderAttributes, { name: attributeName }); }; init(); diff --git a/ui/app/clinical/consultation/views/treatmentSections/drugOrderHistory.html b/ui/app/clinical/consultation/views/treatmentSections/drugOrderHistory.html index 32f511400..718631403 100644 --- a/ui/app/clinical/consultation/views/treatmentSections/drugOrderHistory.html +++ b/ui/app/clinical/consultation/views/treatmentSections/drugOrderHistory.html @@ -24,7 +24,7 @@ {{drugOrder.getDisplayName()}} {{drugOrder.getDescriptionWithQuantity()}} -
+
+ + + @@ -50,8 +57,11 @@
+
{{ ::'MEDICATION_STARTED_ON' | translate }} {{drugOrder.effectiveStartDate | bahmniDate}} + {{ ::'MEDICATION_DISPENSED_ON' | translate }} {{drugOrder.dispenseDate | bahmniDate}} + {{ ::'MEDICATION_DISPENSED_ON' | translate }} : Empty
{{ ::'MEDICATION_STOPPED_ON' | translate }} {{drugOrder.dateStopped | bahmniDate}}
{{ ::'MEDICATION_DUE_TO' | translate }} {{drugOrder.orderReasonText}}
@@ -66,7 +76,7 @@
- +
@@ -92,6 +102,28 @@
+ + +
+
+
+
+ +
+
+ +
+ + +
+
+
diff --git a/ui/app/clinical/dashboard/controllers/pregnancyCertificateController.js b/ui/app/clinical/dashboard/controllers/pregnancyCertificateController.js new file mode 100644 index 000000000..c3e3ae095 --- /dev/null +++ b/ui/app/clinical/dashboard/controllers/pregnancyCertificateController.js @@ -0,0 +1,7 @@ +'use strict'; +angular.module('bahmni.clinical') + .controller('pregnancyCertificateController', ['$scope', '$rootScope', + function ($scope, $rootScope) { + $scope.ispregnantCertificate = $rootScope.ispregnantCertificate; + $scope.data = $rootScope.data; + }]); diff --git a/ui/app/clinical/dashboard/controllers/printHospitalizationCertificateController.js b/ui/app/clinical/dashboard/controllers/printHospitalizationCertificateController.js new file mode 100644 index 000000000..91d83b255 --- /dev/null +++ b/ui/app/clinical/dashboard/controllers/printHospitalizationCertificateController.js @@ -0,0 +1,7 @@ +'use strict'; +angular.module('bahmni.clinical') + .controller('printHospitalizationCertificateController', ['$scope', '$rootScope', + function ($scope, $rootScope) { + $scope.isHospitalizationCertificate = $rootScope.isHospitalizationCertificate; + $scope.certificateData = $rootScope.certificateData; + }]); diff --git a/ui/app/clinical/dashboard/controllers/replacementCertificateController.js b/ui/app/clinical/dashboard/controllers/replacementCertificateController.js new file mode 100644 index 000000000..1155bdab0 --- /dev/null +++ b/ui/app/clinical/dashboard/controllers/replacementCertificateController.js @@ -0,0 +1,7 @@ +'use strict'; +angular.module('bahmni.clinical') + .controller('replacementCertificateController', ['$scope', '$rootScope', + function ($scope, $rootScope) { + $scope.isReplacementCertificate = $rootScope.isReplacementCertificate; + $scope.data = $rootScope.data; + }]); diff --git a/ui/app/clinical/dashboard/directives/hospitaliizationCertificate.js b/ui/app/clinical/dashboard/directives/hospitaliizationCertificate.js new file mode 100644 index 000000000..a342b01d9 --- /dev/null +++ b/ui/app/clinical/dashboard/directives/hospitaliizationCertificate.js @@ -0,0 +1,24 @@ +'use strict'; + +angular.module('bahmni.clinical') + .directive('hospitalizationCertificate', function () { + var controller = function ($scope) { + $scope.getCurrentDate = function () { + return moment().format('DD/MM/YYYY'); + }; + + $scope.getFullname = function () { + return $scope.certificateData.patientInfo.lastName + ' ' + $scope.certificateData.patientInfo.firstName; + }; + }; + + return { + restrict: 'E', + controller: controller, + scope: { + certificateData: "=", + isHospitalizationCertificate: "=" + }, + templateUrl: "dashboard/views/hospitalizationCertificate.html" + }; + }); diff --git a/ui/app/clinical/dashboard/directives/medicalReplacementCertificate.js b/ui/app/clinical/dashboard/directives/medicalReplacementCertificate.js new file mode 100644 index 000000000..6e127a57c --- /dev/null +++ b/ui/app/clinical/dashboard/directives/medicalReplacementCertificate.js @@ -0,0 +1,24 @@ +'use strict'; + +angular.module('bahmni.clinical') + .directive('replacementCertificate', 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: "=", + isReplacementCertificate: "=" + }, + templateUrl: "dashboard/views/medicalReplacementCertificate.html" + }; + }); diff --git a/ui/app/clinical/dashboard/directives/pregnancyCertificate.js b/ui/app/clinical/dashboard/directives/pregnancyCertificate.js new file mode 100644 index 000000000..b81f1df2e --- /dev/null +++ b/ui/app/clinical/dashboard/directives/pregnancyCertificate.js @@ -0,0 +1,24 @@ +'use strict'; + +angular.module('bahmni.clinical') + .directive('pregnancyCertificate', 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: "=", + ispregnantCertificate: "=" + }, + templateUrl: "dashboard/views/pregnancyCertificate.html" + }; + }); diff --git a/ui/app/clinical/dashboard/services/printHospitalizationCertificateService.js b/ui/app/clinical/dashboard/services/printHospitalizationCertificateService.js new file mode 100644 index 000000000..1426e10d7 --- /dev/null +++ b/ui/app/clinical/dashboard/services/printHospitalizationCertificateService.js @@ -0,0 +1,104 @@ +'use strict'; + +angular.module('bahmni.clinical') + .service('printHospitalizationCertificateService', ['$rootScope', '$translate', 'patientService', 'observationsService', 'programService', 'treatmentService', 'localeService', 'patientVisitHistoryService', 'conceptSetService', 'locationService', + function ($rootScope, $translate, patientService, observationsService, programService, treatmentService, localeService, patientVisitHistoryService, conceptSetService, locationService) { + var reportModel = { + username: $rootScope.currentUser.username, + hospitalLogo: '', + hospitalName: '', + hospitalVillage: '', + patientInfo: { + firstName: '', + lastName: '', + age: '', + sex: '', + patientId: '', + phoneNumber: '', + occupation: '' + } + }; + + var patientUuid = ''; + + this.getReportModel = function (_patientUuid) { + patientUuid = _patientUuid; + + return new Promise(function (resolve, reject) { + var p1 = populatePatientDemographics(); + var p2 = populateHospitalNameAndLogo(); + var p3 = populateHospitalVillage(); + var p4 = populatePatientOccupation(); + + Promise.all([p1, p2, p3, p4]).then(function () { + resolve(reportModel); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateHospitalVillage = function () { + locationService.getAllByTag('Visit Location') + .then(function (response) { + reportModel.hospitalVillage = response.data.results[0].cityVillage; + }) + .catch(function (error) { + reject(error); + }); + }; + + var populatePatientOccupation = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + var patientData = response.data; + patientData.person.attributes.forEach(function (attribute) { + if (attribute.attributeType.display === "occupation") { + var occupation = attribute.value.display; + reportModel.patientInfo.occupation = occupation; + return; + } + }); + + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populatePatientDemographics = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + response.data.person.attributes.forEach(function (attribute) { + if (attribute.display.includes("PERSON_ATTRIBUTE_TYPE_PHONE_NUMBER")) { + var phoneNumber = attribute.display.split('=')[1].trim(); + reportModel.patientInfo.phoneNumber = phoneNumber; + return; + } + }); + + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + reportModel.patientInfo.sex = patient.gender; + reportModel.patientInfo.age = patient.age; + reportModel.patientInfo.patientId = patient.identifier; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateHospitalNameAndLogo = function () { + return new Promise(function (resolve, reject) { + localeService.getLoginText().then(function (response) { + reportModel.hospitalName = response.data.loginPage.hospitalName; + reportModel.hospitalLogo = response.data.loginPage.logo; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + }]); diff --git a/ui/app/clinical/dashboard/services/printLabTestsReportService.js b/ui/app/clinical/dashboard/services/printLabTestsReportService.js index daa585d02..b41fef232 100644 --- a/ui/app/clinical/dashboard/services/printLabTestsReportService.js +++ b/ui/app/clinical/dashboard/services/printLabTestsReportService.js @@ -13,29 +13,41 @@ angular.module('bahmni.clinical') age: '', sex: '', weight: '', - patientId: '' + patientId: '', + phoneNumber: '' }, tbComorbidity: '', tarvNumber: '', prescriber: '', prescriptionDate: '', - location: '', orders: [], labTestsInfo: { protocol: '', - theurapeuticLine: '', + therapeuticLine: '', value_vl: '', value_vl_log10: '', resultsDate: '', collectionDate: '', natureOfCollection: '', sampleCode: '', + technique: '', + machineUsed: '', viralLoadResult: '', - viralLoadResultComment: '' - + viralLoadResultComment: '', + dateOne: '', + dateTwo: '', + dateThree: '', + vlResultsOne: '', + vlResultsTwo: '', + vlResultsThree: '', + CodePLVT: '' }, analyzer: '', - validator: '' + validator: '', + facility: '', + receptionDate: '', + verifier: '', + testType: 'Generic HIV CV (Biocentric)' }; var patientUuid = ''; @@ -46,16 +58,18 @@ angular.module('bahmni.clinical') return new Promise(function (resolve, reject) { var p1 = populatePatientDemographics(); var p2 = populatePatientWeight(); - var p3 = populateTARVAndTBComorbidity(); - var p4 = populateLocationAndDrugOrders(); + var p4 = populatePrescriber(); var p5 = populateHospitalNameAndLogo(); var p6 = populateVirologyResults(); var p7 = populateVLReults(); var p8 = populateVLReultsComment(); var p9 = populateResultsAnalyzer(); var p10 = populateResultsValidator(); + var p11 = populateFacilityName(); + var p12 = populateResultsReceptionDate(); + var p13 = populateResultsverifier(); - Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]).then(function () { + Promise.all([p1, p2, p4, p5, p6, p7, p8, p9, p10, p12, p13]).then(function () { resolve(reportModel); }).catch(function (error) { reject(error); @@ -88,22 +102,6 @@ angular.module('bahmni.clinical') }); }); }; - var populatePatientDemographics = function () { - return new Promise(function (resolve, reject) { - patientService.getPatient(patientUuid).then(function (response) { - var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); - var patient = patientMapper.map(response.data); - reportModel.patientInfo.firstName = patient.givenName; - reportModel.patientInfo.lastName = patient.familyName; - reportModel.patientInfo.sex = patient.gender; - reportModel.patientInfo.age = patient.age; - reportModel.patientInfo.patientId = patient.identifier; - resolve(); - }).catch(function (error) { - reject(error); - }); - }); - }; var populatePatientWeight = function () { return new Promise(function (resolve, reject) { @@ -134,9 +132,24 @@ angular.module('bahmni.clinical') }); }); }; + + var populateFacilityName = function () { + return new Promise(function (resolve, reject) { + var conceptName = 'Health Facility'; + + observationsService.fetch(patientUuid, [conceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.facility = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; var populateResultsValidator = function () { return new Promise(function (resolve, reject) { - var conceptName = 'Verified by'; + var conceptName = 'Approved by'; observationsService.fetch(patientUuid, [conceptName]).then(function (response) { if (response.data && response.data.length > 0) { @@ -149,77 +162,27 @@ angular.module('bahmni.clinical') }); }; - var populateVirologyResults = function () { + var populateResultsReceptionDate = function () { return new Promise(function (resolve, reject) { - const conceptNamesToExtract = ['Protocol', 'Therapeutic line', 'Value VL (cp/mL)', 'Value VL (log10 cp/mL)', 'Date of Results', 'Sample collection date', 'Nature of collection', 'Sample Code']; - observationsService.fetch(patientUuid, conceptNamesToExtract) - .then(function (response) { - const concepts = response.data || []; - conceptNamesToExtract.forEach(function (conceptName) { - const foundConcept = concepts.find(function (obs) { - return obs.concept.name === conceptName; - }); - if (foundConcept) { - if (conceptName === 'Protocol') { - reportModel.labTestsInfo.protocol = foundConcept.valueAsString; - } else if (conceptName === 'Therapeutic line') { - reportModel.labTestsInfo.theurapeuticLine = foundConcept.valueAsString; - } else if (conceptName === 'Value VL (cp/mL)') { - reportModel.labTestsInfo.value_vl = foundConcept.valueAsString; - } else if (conceptName === 'Value VL (log10 cp/mL)') { - reportModel.labTestsInfo.value_vl_log10 = foundConcept.valueAsString; - } else if (conceptName === 'Date of Results') { - reportModel.labTestsInfo.resultsDate = foundConcept.valueAsString; - } else if (conceptName === 'Sample collection date') { - reportModel.labTestsInfo.collectionDate = foundConcept.valueAsString; - } else if (conceptName === 'Nature of collection') { - reportModel.labTestsInfo.natureOfCollection = foundConcept.valueAsString; - } else if (conceptName === 'Sample Code') { - reportModel.labTestsInfo.sampleCode = foundConcept.valueAsString; - } - } - }); - resolve(); - }) - .catch(function (error) { - reject(error); - }); + var conceptName = 'Reception date'; + + observationsService.fetch(patientUuid, [conceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.receptionDate = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); }); }; - - var populateTARVAndTBComorbidity = function () { + var populateResultsverifier = function () { return new Promise(function (resolve, reject) { - programService.getPatientPrograms(patientUuid).then(function (response) { - if (response.activePrograms && response.activePrograms.length > 0) { - var tarvNumber = response.activePrograms[0].attributes.map(function (item) { - if (item.name === 'PROGRAM_MANAGEMENT_ART_NUMBER') { - return item.value; - } - }).filter(function (item) { - return item; - }); - - if (tarvNumber.length > 0) { - reportModel.tarvNumber = tarvNumber[0]; - } - - var tbComorbidity = response.activePrograms[0].attributes.map(function (item) { - if (item.name === 'PROGRAM_MANAGEMENT_PATIENT_COMORBIDITES') { - return item.value.display === 'TB'; - } - }).filter(function (item) { - return item; - }); + var conceptName = 'Verified by'; - if (tbComorbidity.length > 0) { - if (tbComorbidity[0]) { - reportModel.tbComorbidity = 'OBS_BOOLEAN_YES_KEY'; - } else { - reportModel.tbComorbidity = 'OBS_BOOLEAN_NO_KEY'; - } - } else { - reportModel.tbComorbidity = 'OBS_BOOLEAN_NO_KEY'; - } + observationsService.fetch(patientUuid, [conceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.verifier = response.data[0].value; } resolve(); }).catch(function (error) { @@ -228,63 +191,137 @@ angular.module('bahmni.clinical') }); }; - var populateDrugOrders = function (visitUuid) { + var populatePrescriber = function () { return new Promise(function (resolve, reject) { - treatmentService.getPrescribedDrugOrders(patientUuid, true).then(function (response) { - var currentVisitOrders = response.filter(function (order) { - return order.visit.uuid === visitUuid; - }); - - reportModel.orders = []; - currentVisitOrders.forEach(function (order) { - var drug = order.drugNonCoded; - if (order.drug) { - drug = order.drug.name; - } - var instructions = ''; - if (order.dosingInstructions.administrationInstructions) { - instructions = JSON.parse(order.dosingInstructions.administrationInstructions).instructions; - if (JSON.parse(order.dosingInstructions.administrationInstructions).additionalInstructions) { - instructions += '. ' + JSON.parse(order.dosingInstructions.administrationInstructions).additionalInstructions; - } - } - var newOrder = { - drugName: drug, - dosage: order.dosingInstructions.dose, - drugUnit: order.dosingInstructions.doseUnits, - frequency: order.dosingInstructions.frequency, - duration: order.duration, - route: order.dosingInstructions.route, - durationUnit: order.durationUnits, - startDate: moment(order.scheduledDate).format('DD/MM/YYYY'), - instructions: instructions - }; + var conceptName = 'Prescriber'; - reportModel.orders.push(newOrder); - reportModel.prescriber = order.provider.name; - reportModel.prescriptionDate = moment(order.dateActivated).format('DD/MM/YYYY'); - }); + observationsService.fetch(patientUuid, [conceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.prescriber = response.data[0].value; + } resolve(); }).catch(function (error) { reject(error); }); }); }; - - var populateLocationAndDrugOrders = function () { + var populatePatientDemographics = function () { return new Promise(function (resolve, reject) { - patientVisitHistoryService.getVisitHistory(patientUuid, null).then(function (response) { - if (response.visits && response.visits.length > 0) { - reportModel.location = response.visits[0].location.display; - populateDrugOrders(response.visits[0].uuid); - } + patientService.getPatient(patientUuid).then(function (response) { + response.data.person.attributes.forEach(function (attribute) { + if (attribute.display.includes("PERSON_ATTRIBUTE_TYPE_PHONE_NUMBER")) { + var phoneNumber = attribute.display.split('=')[1].trim(); + reportModel.patientInfo.phoneNumber = phoneNumber; + return; + } + }); + + response.data.identifiers.forEach(function (attribute) { + if (attribute.display.includes("REGISTRATION_IDTYPE_3_ART_KEY")) { + var tarvNumber = attribute.display.split('=')[1].trim(); + reportModel.tarvNumber = tarvNumber; + } + }); + + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + reportModel.patientInfo.sex = patient.gender; + reportModel.patientInfo.age = patient.age; + reportModel.patientInfo.patientId = patient.identifier; resolve(); }).catch(function (error) { reject(error); }); }); }; + function populateVirologyResults () { + const conceptNamesToExtract = [ + 'Protocol', 'Therapeutic line', 'Value VL (cp/mL)', 'Value VL (log10 cp/mL)', + 'Date of Results', 'Sample collection date', 'Nature of collection', + 'Ext Lab Sample Code', 'Technique', 'Machine used', 'Date of Results 1', + 'Date of Results 2', 'Date of Results 3', 'Value VL (cp/mL) 1', + 'Value VL (cp/mL) 2', 'Value VL (cp/mL) 3', 'Code PLVT' + ]; + try { + observationsService.fetch(patientUuid, conceptNamesToExtract) + .then(function (response) { + const concepts = response.data || []; + concepts.sort(function (a, b) { + return new Date(b.obsDatetime) - new Date(a.obsDatetime); + }); + const processedConcepts = new Set(); + concepts.forEach(function (item) { + const conceptName = item.concept.name; + const valueAsString = item.valueAsString; + if (processedConcepts.has(conceptName) || !valueAsString) return; + processedConcepts.add(conceptName); + switch (conceptName) { + case 'Protocol': + reportModel.labTestsInfo.protocol = valueAsString; + break; + case 'Therapeutic line': + reportModel.labTestsInfo.therapeuticLine = valueAsString; + break; + case 'Value VL (cp/mL)': + reportModel.labTestsInfo.value_vl = valueAsString; + reportModel.labTestsInfo.value_vl_log10 = Math.log10(Number(valueAsString)).toFixed(2); + break; + case 'Date of Results': + reportModel.labTestsInfo.resultsDate = valueAsString; + break; + case 'Sample collection date': + reportModel.labTestsInfo.collectionDate = valueAsString; + break; + case 'Nature of collection': + reportModel.labTestsInfo.natureOfCollection = valueAsString; + break; + case 'Ext Lab Sample Code': + reportModel.labTestsInfo.sampleCode = valueAsString; + break; + case 'Code PLVT': + reportModel.labTestsInfo.CodePLVT = valueAsString; + break; + case 'Technique': + reportModel.labTestsInfo.technique = valueAsString; + reportModel.testType = reportModel.labTestsInfo.technique; + break; + case 'Machine used': + reportModel.labTestsInfo.machineUsed = valueAsString; + break; + case 'Date of Results 1': + reportModel.labTestsInfo.dateOne = valueAsString; + break; + case 'Date of Results 2': + reportModel.labTestsInfo.dateTwo = valueAsString; + break; + case 'Date of Results 3': + reportModel.labTestsInfo.dateThree = valueAsString; + break; + case 'Value VL (cp/mL) 1': + reportModel.labTestsInfo.vlResultsOne = valueAsString; + break; + case 'Value VL (cp/mL) 2': + reportModel.labTestsInfo.vlResultsTwo = valueAsString; + break; + case 'Value VL (cp/mL) 3': + reportModel.labTestsInfo.vlResultsThree = valueAsString; + break; + default: + break; + } + }); + return Promise.resolve(); + }) + .catch(function (error) { + return Promise.reject(error); + }); + } catch (error) { + return Promise.reject(error); + } + } var populateHospitalNameAndLogo = function () { return new Promise(function (resolve, reject) { localeService.getLoginText().then(function (response) { diff --git a/ui/app/clinical/dashboard/services/printPregnancyCertificateService.js b/ui/app/clinical/dashboard/services/printPregnancyCertificateService.js new file mode 100644 index 000000000..577bae89f --- /dev/null +++ b/ui/app/clinical/dashboard/services/printPregnancyCertificateService.js @@ -0,0 +1,179 @@ +'use strict'; + +angular.module('bahmni.clinical') + .service('printPregnancyCertificateService', ['$rootScope', '$translate', 'patientService', 'observationsService', 'programService', 'treatmentService', 'localeService', 'patientVisitHistoryService', 'conceptSetService', 'locationService', + function ($rootScope, $translate, patientService, observationsService, programService, treatmentService, localeService, patientVisitHistoryService, conceptSetService, locationService) { + var reportModel = { + username: $rootScope.currentUser.username, + hospitalLogo: '', + hospitalName: '', + hospitalVillage: '', + leaveDays: '', + dateOfExam: '', + doctor: '', + startDate: '', + gestationalAge: '', + deliveryDate: '', + patientInfo: { + firstName: '', + lastName: '', + age: '', + sex: '', + patientId: '', + phoneNumber: '' + } + }; + + var patientUuid = ''; + + this.getReportModel = function (_patientUuid) { + patientUuid = _patientUuid; + + return new Promise(function (resolve, reject) { + var p1 = populateStartDate(); + var p2 = populateHospitalNameAndLogo(); + var p3 = populateDoctor(); + var p5 = populateNumberOfDays(); + var p6 = populatePatientNames(); + var p7 = populateDateOfExam(); + var p8 = populateGestationalAge(); + var p9 = populateDeliveryDate(); + + Promise.all([p1, p2, p3, p5, p6, p7, p8, p9]).then(function () { + resolve(reportModel); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populatePatientNames = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateNumberOfDays = function () { + return new Promise(function (resolve, reject) { + var leaveDaysConceptName = 'Number of Days'; + observationsService.fetch(patientUuid, [leaveDaysConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.leaveDays = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateDeliveryDate = function () { + return new Promise(function (resolve, reject) { + var deliveryDateConceptName = 'Date of delivery'; + observationsService.fetch(patientUuid, [deliveryDateConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.deliveryDate = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateDateOfExam = function () { + return new Promise(function (resolve, reject) { + var examDateConceptName = 'Date of Examination'; + observationsService.fetch(patientUuid, [examDateConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.dateOfExam = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateGestationalAge = function () { + return new Promise(function (resolve, reject) { + var GestationalAgeConceptName = 'Gestational Age'; + observationsService.fetch(patientUuid, [GestationalAgeConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.gestationalAge = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateDoctor = function () { + return new Promise(function (resolve, reject) { + var leaveDaysConceptName = 'Physician’s name'; + observationsService.fetch(patientUuid, [leaveDaysConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.doctor = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateStartDate = function () { + return new Promise(function (resolve, reject) { + var startDayConceptName = 'Sick Leave Start'; + observationsService.fetch(patientUuid, [startDayConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.startDate = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populatePatientDemographics = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + response.data.person.attributes.forEach(function (attribute) { + if (attribute.display.includes("PERSON_ATTRIBUTE_TYPE_PHONE_NUMBER")) { + var phoneNumber = attribute.display.split('=')[1].trim(); + reportModel.patientInfo.phoneNumber = phoneNumber; + return; + } + }); + + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + reportModel.patientInfo.sex = patient.gender; + reportModel.patientInfo.age = patient.age; + reportModel.patientInfo.patientId = patient.identifier; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateHospitalNameAndLogo = function () { + return new Promise(function (resolve, reject) { + localeService.getLoginText().then(function (response) { + reportModel.hospitalName = response.data.loginPage.hospitalName; + reportModel.hospitalLogo = response.data.loginPage.logo; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + }]); diff --git a/ui/app/clinical/dashboard/services/printReplacementCertificateService.js b/ui/app/clinical/dashboard/services/printReplacementCertificateService.js new file mode 100644 index 000000000..47ccdee58 --- /dev/null +++ b/ui/app/clinical/dashboard/services/printReplacementCertificateService.js @@ -0,0 +1,133 @@ +'use strict'; + +angular.module('bahmni.clinical') + .service('printReplacementCertificateService', ['$rootScope', '$translate', 'patientService', 'observationsService', 'programService', 'treatmentService', 'localeService', 'patientVisitHistoryService', 'conceptSetService', 'locationService', + function ($rootScope, $translate, patientService, observationsService, programService, treatmentService, localeService, patientVisitHistoryService, conceptSetService, locationService) { + var reportModel = { + username: $rootScope.currentUser.username, + hospitalLogo: '', + hospitalName: '', + hospitalVillage: '', + leaveDays: '', + doctor: '', + startDate: '', + patientInfo: { + firstName: '', + lastName: '', + age: '', + sex: '', + patientId: '', + phoneNumber: '' + } + }; + + var patientUuid = ''; + + this.getReportModel = function (_patientUuid) { + patientUuid = _patientUuid; + + return new Promise(function (resolve, reject) { + var p1 = populateStartDate(); + var p2 = populateHospitalNameAndLogo(); + var p3 = populateDoctor(); + var p5 = populateNumberOfDays(); + var p6 = populatePatientNames(); + + Promise.all([p1, p2, p3, p5, p6]).then(function () { + resolve(reportModel); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populatePatientNames = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateNumberOfDays = function () { + return new Promise(function (resolve, reject) { + var leaveDaysConceptName = 'Number of Days'; + observationsService.fetch(patientUuid, [leaveDaysConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.leaveDays = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populateDoctor = function () { + return new Promise(function (resolve, reject) { + var leaveDaysConceptName = 'Physician’s name'; + observationsService.fetch(patientUuid, [leaveDaysConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.doctor = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateStartDate = function () { + return new Promise(function (resolve, reject) { + var startDayConceptName = 'Sick Leave Start'; + observationsService.fetch(patientUuid, [startDayConceptName]).then(function (response) { + if (response.data && response.data.length > 0) { + reportModel.startDate = response.data[0].value; + } + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + + var populatePatientDemographics = function () { + return new Promise(function (resolve, reject) { + patientService.getPatient(patientUuid).then(function (response) { + response.data.person.attributes.forEach(function (attribute) { + if (attribute.display.includes("PERSON_ATTRIBUTE_TYPE_PHONE_NUMBER")) { + var phoneNumber = attribute.display.split('=')[1].trim(); + reportModel.patientInfo.phoneNumber = phoneNumber; + return; + } + }); + + var patientMapper = new Bahmni.PatientMapper($rootScope.patientConfig, $rootScope, $translate); + var patient = patientMapper.map(response.data); + reportModel.patientInfo.firstName = patient.givenName; + reportModel.patientInfo.lastName = patient.familyName; + reportModel.patientInfo.sex = patient.gender; + reportModel.patientInfo.age = patient.age; + reportModel.patientInfo.patientId = patient.identifier; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + var populateHospitalNameAndLogo = function () { + return new Promise(function (resolve, reject) { + localeService.getLoginText().then(function (response) { + reportModel.hospitalName = response.data.loginPage.hospitalName; + reportModel.hospitalLogo = response.data.loginPage.logo; + resolve(); + }).catch(function (error) { + reject(error); + }); + }); + }; + }]); diff --git a/ui/app/clinical/dashboard/views/hospitalizationCertificate.html b/ui/app/clinical/dashboard/views/hospitalizationCertificate.html new file mode 100644 index 000000000..f4b570acb --- /dev/null +++ b/ui/app/clinical/dashboard/views/hospitalizationCertificate.html @@ -0,0 +1,33 @@ +
+
+
{{ 'PRINT_HOSPITALIZATION_CERTIFICATE_LABEL' | translate }}
+
+
+ {{ 'HOSPITALIZATION_CERTIFICATE_UNDERSIGNED' | translate }} + {{certificateData.username}} +
+
+ {{ 'HOSPITALIZATION_CERTIFICATE_CERTIFIED_THAT' | translate }} + {{ getFullname() }} +
+
+ {{ 'HOSPITALIZATION_CERTIFICATE_AGE' | translate }} + {{ certificateData.patientInfo.age }} +
+
+ {{ 'HOSPITALIZATION_CERTIFICATE_PROFESSION' | translate }} + {{ certificateData.patientInfo.occupation }} +
+
+ {{ 'HOSPITALIZATION_CERTIFICATE_ADMITTED_AT' | translate }} + {{ certificateData.hospitalName }} +
+
+ {{ certificateData.hospitalVillage }} +
+
Signature
+ +
+
{{ 'HOSPITALIZATION_CERTIFICATE_WITNESS' | translate }}
+
+ diff --git a/ui/app/clinical/dashboard/views/labTestsReport.html b/ui/app/clinical/dashboard/views/labTestsReport.html index 53f1fa130..a32ea39b2 100644 --- a/ui/app/clinical/dashboard/views/labTestsReport.html +++ b/ui/app/clinical/dashboard/views/labTestsReport.html @@ -1,7 +1,7 @@
+ {{ 'PRESCRIPTION_REPORT_USERNAME' | translate }} : {{data.username}}
{{ data.hospitalName }}
-
@@ -11,18 +11,29 @@ {{ 'PRESCRIPTION_REPORT_PATIENT_ID' | translate }}: {{ data.patientInfo.patientId }}
{{ 'LAB_TESTS_SAMPLE_CODE' | translate }}: {{ data.labTestsInfo.sampleCode}}
{{ 'PRESCRIPTION_REPORT_TARV_NUMBER' | translate }}: {{ data.tarvNumber }}
+ {{ 'CONTACT ' | translate}}: {{data.patientInfo.phoneNumber}}
- {{ 'LAB_TESTS_TECHNICIAN' | translate }}: {{ data.prescriber }}
{{ 'LAB_TESTS_SAMPLE_COLLECTION_DATE' | translate }}: {{data.labTestsInfo.collectionDate}}
- {{ 'PRESCRIPTION_REPORT_LOCATION' | translate }}: {{ data.location | translate}}
+ {{ 'RECEPTION_DATE' | translate }}: {{data.receptionDate}}
+ {{ 'PRESCRIPTION_REPORT_LOCATION' | translate }}: {{ data.facility}}
+ {{ 'PRESCRIBER' | translate }}: {{ data.prescriber }}
-

{{ 'LAB_TESTS_REPORT' | translate }}

-
{{ 'LAB_TESTS_BIOCENTRIC' | translate }}
-
{{ 'LAB_TESTS_THRESHOLD' | translate }}
+

{{ 'LAB_TESTS_REPORT' | translate }}

+
{{data.labTestsInfo.technique}} - {{data.labTestsInfo.machineUsed}}
+
+ + Detection threshold: 390 copies/mL + Detection threshold: 40 copies/mL + Detection threshold: 20 copies/mL + Detection threshold: 20 copies/mL + {{ 'LAB_TESTS_THRESHOLD' | translate }} + +
+
@@ -47,16 +58,32 @@

{{data.labTestsInfo.viralLoadResultComment}}

{{ 'LAB_TESTS_RESULTS_DATE' | translate }} - {{ data.labTestsInfo.sampleCode}} + {{ data.labTestsInfo.CodePLVT}} {{data.labTestsInfo.collectionDate}} {{data.labTestsInfo.protocol}} - {{data.labTestsInfo.theurapeuticLine}} + {{data.labTestsInfo.therapeuticLine}} {{data.labTestsInfo.natureOfCollection}} {{data.labTestsInfo.value_vl}} {{data.labTestsInfo.value_vl_log10}} {{data.labTestsInfo.resultsDate}} +
+
{{ 'LAB_TESTS_VIRAL_LOAD_HISTORY' | translate }}
+ + + + + + + + + + + + + +
Dates{{data.labTestsInfo.dateOne}}{{data.labTestsInfo.dateTwo}}{{data.labTestsInfo.dateThree}}
Value (cp/mL){{ data.labTestsInfo.vlResultsOne}}{{ data.labTestsInfo.vlResultsTwo}}{{ data.labTestsInfo.vlResultsThree}}
@@ -64,12 +91,13 @@

{{data.labTestsInfo.viralLoadResultComment}}

- {{'LAB_TESTS_ANALYZER' | translate}}: {{ data.analyzer}}
- {{'LAB_TESTS_VALIDATOR' | translate}}: {{ data.validator}}
+ {{'LAB_TESTS_ANALYZER' | translate}} {{ data.analyzer}}
+ {{'LAB_TESTS_VERIFIER' | translate}} {{ data.verifier}}
+ {{'LAB_TESTS_VALIDATOR' | translate}} {{ data.validator}}
- {{'LAB_TESTS_CURRENT_DATE' | translate}} : {{getCurrentDate()}}
- {{'LAB_TESTS_SIGNATURE' | translate}} : _______________________
+ {{'LAB_TESTS_CURRENT_DATE' | translate}} {{getCurrentDate()}}
+ {{'LAB_TESTS_SIGNATURE' | translate}} _______________________
diff --git a/ui/app/clinical/dashboard/views/medicalReplacementCertificate.html b/ui/app/clinical/dashboard/views/medicalReplacementCertificate.html new file mode 100644 index 000000000..8797b28ba --- /dev/null +++ b/ui/app/clinical/dashboard/views/medicalReplacementCertificate.html @@ -0,0 +1,33 @@ +
+
+
{{ 'PRINT_MEDICAL_REPLACEMENT_CERTIFICATE_LABEL' | translate }}
+
+
+ {{ 'MEDICAL_REPLACEMENT_UNDERSIGNED_DOCTOR' | translate }} + Docteur {{ data.doctor }} +
+
+ {{ 'MEDICAL_REPLACEMENT_CERTIFY_EXAMINED' | translate }} + {{ getFullname() }} +
+
+ {{ 'MEDICAL_REPLACEMENT_HEALTH_STATUS' | translate }} + {{ data.leaveDays }} {{ 'MEDICAL_REPLACEMENT_DAYS' | translate }} +
+
+ {{ 'MEDICAL_REPLACEMENT_START_DATE' | translate }} + {{ data.startDate }} +
+
+ +
+ {{ 'MEDICAL_REPLACEMENT_BARRING_COMPLICATIONS' | translate }} +
+
+
+ {{ 'MEDICAL_REPLACEMENT_ATTENDING_DOCTOR' | translate }} +
+

+ +
+ diff --git a/ui/app/clinical/dashboard/views/pregnancyCertificate.html b/ui/app/clinical/dashboard/views/pregnancyCertificate.html new file mode 100644 index 000000000..f2e4fe050 --- /dev/null +++ b/ui/app/clinical/dashboard/views/pregnancyCertificate.html @@ -0,0 +1,34 @@ +
+
+
{{ 'PREGNANCY_CERTIFICATE_TITLE' | translate }}
+
+
+ {{ 'PREGNANCY_CERTIFICATE_UNDERSIGNED' | translate }} + {{ data.doctor }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_CERTIFY' | translate }} + {{ data.dateOfExam }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_TO_MRS' | translate }} + {{ getFullname() }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_GENERAL_EXAM' | translate }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_PREGNANT_WITH' | translate }} + {{ data.gestationalAge }} {{ 'PREGNANCY_CERTIFICATE_WEEKS' | translate }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_DELIVERY_DATE' | translate }} + {{ data.deliveryDate }} +
+
+ {{ 'PREGNANCY_CERTIFICATE_LEGAL_PURPOSE' | translate }} +
+
+
{{ 'PREGNANCY_CERTIFICATE_PRACTITIONER' | translate }}
+
+ diff --git a/ui/app/clinical/dashboard/views/printHospitalizationCertificate.html b/ui/app/clinical/dashboard/views/printHospitalizationCertificate.html new file mode 100644 index 000000000..3bc6aa333 --- /dev/null +++ b/ui/app/clinical/dashboard/views/printHospitalizationCertificate.html @@ -0,0 +1,75 @@ + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/ui/app/clinical/dashboard/views/printMedicalReplacementCertificate.html b/ui/app/clinical/dashboard/views/printMedicalReplacementCertificate.html new file mode 100644 index 000000000..dda977e8e --- /dev/null +++ b/ui/app/clinical/dashboard/views/printMedicalReplacementCertificate.html @@ -0,0 +1,75 @@ + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/ui/app/clinical/dashboard/views/printPregnancyCertificate.html b/ui/app/clinical/dashboard/views/printPregnancyCertificate.html new file mode 100644 index 000000000..3ded2009f --- /dev/null +++ b/ui/app/clinical/dashboard/views/printPregnancyCertificate.html @@ -0,0 +1,75 @@ + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/ui/app/clinical/index.html b/ui/app/clinical/index.html index 829ee402a..58ee6ae02 100644 --- a/ui/app/clinical/index.html +++ b/ui/app/clinical/index.html @@ -346,6 +346,10 @@ + + + + @@ -359,6 +363,13 @@ + + + + + + + @@ -514,6 +525,7 @@ + diff --git a/ui/app/common/constants.js b/ui/app/common/constants.js index 14e3bbd26..36f3686cf 100644 --- a/ui/app/common/constants.js +++ b/ui/app/common/constants.js @@ -254,7 +254,8 @@ Bahmni.Common = Bahmni.Common || {}; localeLangs: "/bahmni_config/openmrs/apps/home/locale_languages.json", privilegeRequiredErrorMessage: "PRIVILEGE_REQUIRED", patientFormsUrl: BAHMNI_CORE + "/patient/{patientUuid}/forms", - defaultPossibleRelativeSearchLimit: 10 + defaultPossibleRelativeSearchLimit: 10, + DispenseDate: RESTWS_V1 + "/cameroonbahmni/drugDispensedate" }; })(); diff --git a/ui/app/i18n/clinical/locale_en.json b/ui/app/i18n/clinical/locale_en.json index 1d354850e..9a3d68322 100644 --- a/ui/app/i18n/clinical/locale_en.json +++ b/ui/app/i18n/clinical/locale_en.json @@ -97,6 +97,7 @@ "PROGRAM_MANAGEMENT_End_PROGRAM_KEY": "End Program", "PROGRAM_MANAGEMENT_DETAILS_KEY": "Details", "PROGRAM_MANAGEMENT_GENERAL_CONSULTATION_KEY": "General Consultation", + "PROGRAM_MANAGEMENT_COUNTRY_TRANSFERRED_TO": "Country Transferred To", "PROGRAM_DISPLAY_CONTROL_TREATMENT_STATES_KEY": " Treatment States", "PROGRAM_DISPLAY_CONTROL_TREATMENT_START_DATE_KEY":"Treatment Start Date", "PROGRAM_DISPLAY_CONTROL_TREATMENT_STOP_DATE_KEY" : "Treatment Stop Date", @@ -217,6 +218,13 @@ "MEDICATION_STARTED_ON": "Started on", "MEDICATION_STOPPED_ON": "Stopped on", "MEDICATION_DUE_TO": "due to", + "MEDICATION_LABEL_DISPENSE_DATE": "Dispense Date", + "MEDICATION_DISPENSED_ON": "Dispensed on", + "MEDICATION_DISPENSE_DATE_SUCCESSFULLY_SAVED": "Dispense date Saved Successfully", + "MEDICATION_DISPENSE_DATE_ERROR_MESSAGE": "Failed to Save Dispense Date", + "MEDICATION_DISPENSE_DATE_EMPTY": "Dispense Date Field Is Empty", + + "REMOVE_CONFIRMATION_KEY": "Are you sure you want to remove?", "CLEAR_CONFIRMATION_KEY": "Are you sure you want to clear?", @@ -385,6 +393,7 @@ "INVESTIGATIONS_SELECTIONS_HEADER_LABEL": "Selection", "CLINICAL_GO_TO_DASHBOARD_LABEL": "Go to IPD dashboard", "PRESCRIPTION_REPORT_PATIENT_NAME": "Patient Name", + "PRESCRIPTION_REPORT_USERNAME": "Edited By", "PRESCRIPTION_REPORT_PATIENT_AGE_AND_SEX": "Age / Sex", "PRESCRIPTION_REPORT_PATIENT_WEIGHT": "Weight (Kg)", "PRESCRIPTION_REPORT_PATIENT_ID": "Patient ID", @@ -427,12 +436,46 @@ "LAB_TESTS_CURRENT_DATE": "Date: ", "LAB_TESTS_ANALYZER": "Analyzed By: ", "LAB_TESTS_VALIDATOR": "Validated By: ", - "LAB_TESTS_SIGNATURE": "Signature: " - - - + "LAB_TESTS_SIGNATURE": "Signature: ", + "PROGRAM_MANAGEMENT_OUTCOME_DATE": "Outcome Date: ", + "PROGRAM_MANAGEMENT_REASON_FOR_OUTCOME": "Reason For Outcome ", + "PROGRAM_MANAGEMENT_FACILITY_TRANSFERED_TO": "Facility Transfered To ", + "RECEPTION_DATE": "Reception date", + "PRESCRIBER": "Prescriber", + "CONTACT": "Contact", + "LAB_TESTS_VERIFIER": "Verified By", + "LAB_TESTS_VIRAL_LOAD_HISTORY": "History of Viral Loads", + "PREGNANCY_CERTIFICATE_TITLE": "Pregnancy Certificate", + "PREGNANCY_CERTIFICATE_UNDERSIGNED": "I, the undersigned :", + "PREGNANCY_CERTIFICATE_CERTIFY": "hereby certify that on ", + "PREGNANCY_CERTIFICATE_TO_MRS": "to Mrs ", + "PREGNANCY_CERTIFICATE_GENERAL_EXAM": "the general and obstetrical examination required by law.", + "PREGNANCY_CERTIFICATE_PREGNANT_WITH": "I certify that she is pregnant with", + "PREGNANCY_CERTIFICATE_WEEKS": "Weeks", + "PREGNANCY_CERTIFICATE_DELIVERY_DATE": "and that she will give birth around", + "PREGNANCY_CERTIFICATE_LEGAL_PURPOSE": "In witness whereof this certificate is issued to her for all legal purposes", + "PREGNANCY_CERTIFICATE_PRACTITIONER": "Practitioner", + "PREGNANCY_CERTIFICATE_DATE": "Date", + "PRINT_MEDICAL_REPLACEMENT_CERTIFICATE_LABEL": "Medical Replacement", + "MEDICAL_REPLACEMENT_UNDERSIGNED_DOCTOR": "I, the undersigned Doctor:", + "MEDICAL_REPLACEMENT_CERTIFY_EXAMINED": "hereby certify that I have on this day examined the named", + "MEDICAL_REPLACEMENT_REST_REQUIRED": "Certifies that his or her state of health requires a medical rest of", + "MEDICAL_REPLACEMENT_DAYS": "days", + "MEDICAL_REPLACEMENT_STARTING_FROM": "starting from", + "MEDICAL_REPLACEMENT_BARRING_COMPLICATIONS": "Barring unforeseeable complications.", + "MEDICAL_REPLACEMENT_DATE": "Date", + "MEDICAL_REPLACEMENT_ATTENDING_DOCTOR": "The Attending Doctor", + "PRINT_HOSPITALIZATION_CERTIFICATE_LABEL": "Hospitalization Certificate", + "HOSPITALIZATION_CERTIFICATE_UNDERSIGNED": "I, the undersigned", + "HOSPITALIZATION_CERTIFICATE_CERTIFIED_THAT": "Certified that", + "HOSPITALIZATION_CERTIFICATE_AGE": "Age", + "HOSPITALIZATION_CERTIFICATE_PROFESSION": "Profession", + "HOSPITALIZATION_CERTIFICATE_ADMITTED_AT": "Is admitted at", + "HOSPITALIZATION_CERTIFICATE_VILLAGE": "Village", + "HOSPITALIZATION_CERTIFICATE_WITNESS": "In witness whereof this certificate is issued for all legal purposes.", + "HOSPITALIZATION_CERTIFICATE_DATE": "Date" } diff --git a/ui/app/i18n/clinical/locale_fr.json b/ui/app/i18n/clinical/locale_fr.json index a185e145f..5d281b335 100644 --- a/ui/app/i18n/clinical/locale_fr.json +++ b/ui/app/i18n/clinical/locale_fr.json @@ -98,6 +98,7 @@ "PROGRAM_MANAGEMENT_START_DATE_KEY": "Date d'enrôlement (pour ce programme)", "PROGRAM_MANAGEMENT_STOP_DATE_KEY": "Date de fin", "PROGRAM_MANAGEMENT_STARTED_ON_KEY": "Commencé le", + "PROGRAM_MANAGEMENT_COUNTRY_TRANSFERRED_TO": "Pays transféré", "PROGRAM_MANAGEMENT_SELECT_PROGRAM_MESSAGE_KEY": "Please select a Program to Enroll the patient", "PROGRAM_MANAGEMENT_ALREADY_ENROLLED_PROGRAM_MESSAGE_KEY": "Patient already enrolled to the Program", "PROGRAM_MANAGEMENT_STATE_CANT_START_BEFORE_KEY": "State cannot be started earlier than current state", @@ -218,6 +219,11 @@ "MEDICATION_AS_NEEDED_BUTTON_PLACEHOLDER": "SOS", "MEDICATION_STARTED_ON": "Débuté le", "MEDICATION_STOP": "Arrêter", + "MEDICATION_DISPENSED_ON": "Dispensé le", + "MEDICATION_LABEL_DISPENSE_DATE": "Date de dispensation", + "MEDICATION_DISPENSE_DATE_SUCCESSFULLY_SAVED": "Date de dispensation Sauvegardée avec succès", + "MEDICATION_DISPENSE_DATE_ERROR_MESSAGE": "La date de dispensation n'a pas été enregistrée", + "MEDICATION_DISPENSE_DATE_EMPTY": "Le champ Date de dispensation est vide", "MEDICATION_AS_NEEDED_ACCESS_KEY": "o", "MEDICATION_LABEL_DOSING_INSTRUCTIONS": "Instructions", "MEDICATION_DOSING_INSTRUCTIONS_PLACEHOLDER": "Choisir l’instruction ", @@ -361,8 +367,8 @@ "LAB_TESTS_VALUE_VL_(cp/mL)": "CV (Copies/mL)", "LAB_TESTS_VALUE_VL_(log10 cp/mL)": "CV (log10)", "LAB_TESTS_RESULTS_DATE": "Date résultats", - "LAB_TESTS_SAMPLE_COLLECTION_DATE": "Sample Collection Date", - "LAB_TESTS_SAMPLE_CODE": "Sample Code", + "LAB_TESTS_SAMPLE_COLLECTION_DATE": "Date collecte échantillon", + "LAB_TESTS_SAMPLE_CODE": "Code échantillon", "LAB_TESTS_TECHNICIAN": "Lab Tech", "LAB_TESTS_BIOCENTRIC": "Generic HIV CV (Biocentric) – Arrow-Lightcycler96", "LAB_TESTS_COPIES/ML": "Copies/mL", @@ -372,5 +378,46 @@ "LAB_TESTS_CURRENT_DATE": "Date: ", "LAB_TESTS_ANALYZER": "Analysé par: ", "LAB_TESTS_VALIDATOR": "Validé par: ", - "LAB_TESTS_SIGNATURE": "Signature: " + "LAB_TESTS_SIGNATURE": "Signature: ", + "PROGRAM_MANAGEMENT_OUTCOME_DATE": "Date de résultat: ", + "PROGRAM_MANAGEMENT_REASON_FOR_OUTCOME": "Raison de la conclusion ", + "PROGRAM_MANAGEMENT_FACILITY_TRANSFERED_TO": "Établissement transféré à ", + "PRESCRIPTION_REPORT_USERNAME": "Modifié par", + "LAB_TESTS_VERIFIER": "Modifié par", + "RECEPTION_DATE": "Date réception", + "PRESCRIBER": "Prescripteur", + "LAB_TESTS_VIRAL_LOAD_HISTORY": "Historique Charges Virales", + "CONTACT": "Contact", + + "PREGNANCY_CERTIFICATE_TITLE": "Certificat de Grossesse", + "PREGNANCY_CERTIFICATE_UNDERSIGNED": "Je soussigné :", + "PREGNANCY_CERTIFICATE_CERTIFY": "certifie avoir fait subir le", + "PREGNANCY_CERTIFICATE_TO_MRS": "à Madame", + "PREGNANCY_CERTIFICATE_GENERAL_EXAM": "l'examen général et obstétrical prévue par la loi.", + "PREGNANCY_CERTIFICATE_PREGNANT_WITH": "Je certifie qu'elle est enceinte de", + "PREGNANCY_CERTIFICATE_WEEKS": "semaines", + "PREGNANCY_CERTIFICATE_DELIVERY_DATE": "et qu'elle accouche vers le", + "PREGNANCY_CERTIFICATE_LEGAL_PURPOSE": "En foi de quoi ce certificat lui est délivré pour servir et faire valoir ce que de droit.", + "PREGNANCY_CERTIFICATE_PRACTITIONER": "Le praticien", + "PREGNANCY_CERTIFICATE_DATE": "Date", + + "PRINT_MEDICAL_REPLACEMENT_CERTIFICATE_LABEL": "Remplacement Médical", + "MEDICAL_REPLACEMENT_UNDERSIGNED_DOCTOR": "Je soussigné Docteur", + "MEDICAL_REPLACEMENT_CERTIFY_EXAMINED": "Certifie avoir examiné ce jour le (la) nommé(e)", + "MEDICAL_REPLACEMENT_HEALTH_STATUS": "Atteste que son état de santé nécessite un repos médical de", + "MEDICAL_REPLACEMENT_DAYS": "jours à compter", + "MEDICAL_REPLACEMENT_START_DATE": "Du", + "MEDICAL_REPLACEMENT_BARRING_COMPLICATIONS": "Sauf complication imprévisible.", + "MEDICAL_REPLACEMENT_ATTENDING_DOCTOR": "Le Praticien", + "MEDICAL_REPLACEMENT_DATE": "Date", + + "PRINT_HOSPITALIZATION_CERTIFICATE_LABEL": "Certificat d'Hospitalisation", + "HOSPITALIZATION_CERTIFICATE_UNDERSIGNED": "Je soussigné", + "HOSPITALIZATION_CERTIFICATE_CERTIFIED_THAT": "Certifie que", + "HOSPITALIZATION_CERTIFICATE_AGE": "Âge", + "HOSPITALIZATION_CERTIFICATE_PROFESSION": "Profession", + "HOSPITALIZATION_CERTIFICATE_ADMITTED_AT": "Est hospitalisé(e)", + "HOSPITALIZATION_CERTIFICATE_VILLAGE": "Village", + "HOSPITALIZATION_CERTIFICATE_WITNESS": "En foi de quoi ce certificat est délivré pour servir et valoir ce que de droit.", + "HOSPITALIZATION_CERTIFICATE_DATE": "Date" } diff --git a/ui/app/styles/clinical/_common.scss b/ui/app/styles/clinical/_common.scss index dd9613d55..300f8fe4b 100644 --- a/ui/app/styles/clinical/_common.scss +++ b/ui/app/styles/clinical/_common.scss @@ -113,13 +113,13 @@ button.save-consultation { .prescribe-report-title { color: black; - font-size: 30px; - padding-top: 30px; - padding-bottom: 30px; + font-size: 20px; + padding-top: 20px; + padding-bottom: 20px; background-color: #EEEEEE; border-radius: 15px; - margin-top: 20px; - margin-bottom: 20px; + margin-top: 10px; + margin-bottom: 10px; } .prescribe-report-drug-name { diff --git a/ui/app/styles/clinical/treatment/_treatment.scss b/ui/app/styles/clinical/treatment/_treatment.scss index 5d08f4954..a76b8a018 100644 --- a/ui/app/styles/clinical/treatment/_treatment.scss +++ b/ui/app/styles/clinical/treatment/_treatment.scss @@ -7,7 +7,7 @@ line-height: 1.5em; padding-left: 10px; margin-top: 5px; - width: 58%; + width: 46%; float: left; @media screen and (max-width: 1024px) { width:46%; @@ -27,6 +27,9 @@ text-align: left; &.stop-date{ padding-bottom: 7px; + }; + &.red-text{ + color: red; } } .table-mimic{ @@ -38,7 +41,7 @@ } .button-group-wrapper { float: right; - width: 215px; + min-width: 276px; padding: 3px 0; button.toggle.has-notes{ background: none !important;