From dc3058d810ed9439651708534dbb32f0472c1779 Mon Sep 17 00:00:00 2001 From: SreelekhaDarsi Date: Wed, 12 Jun 2024 11:01:10 +0530 Subject: [PATCH 1/2] Sreelekha|MOBN-2347| Fix. update conditions for config and its sections --- .../consultation/controllers/addTreatmentController.js | 4 ++-- .../common/displaycontrols/dashboard/directives/dashboard.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/clinical/consultation/controllers/addTreatmentController.js b/ui/app/clinical/consultation/controllers/addTreatmentController.js index ee5406ef96..729f0677b6 100644 --- a/ui/app/clinical/consultation/controllers/addTreatmentController.js +++ b/ui/app/clinical/consultation/controllers/addTreatmentController.js @@ -822,8 +822,8 @@ angular.module('bahmni.clinical') var showRulesInMedication = function (medicationConfig) { $scope.showRulesInMedication = false; - if (medicationConfig !== 'undefined' && medicationConfig.tabConfig !== 'undefined' && medicationConfig.tabConfig.allMedicationTabConfig - !== 'undefined' && medicationConfig.tabConfig.allMedicationTabConfig.orderSet !== 'undefined') { + if (medicationConfig && medicationConfig.tabConfig && medicationConfig.tabConfig.allMedicationTabConfig + && medicationConfig.tabConfig.allMedicationTabConfig.orderSet ) { if (medicationConfig.tabConfig.allMedicationTabConfig.orderSet.showRulesInMedication) { $scope.showRulesInMedication = true; } diff --git a/ui/app/common/displaycontrols/dashboard/directives/dashboard.js b/ui/app/common/displaycontrols/dashboard/directives/dashboard.js index 81d8848e4a..f77c794a07 100644 --- a/ui/app/common/displaycontrols/dashboard/directives/dashboard.js +++ b/ui/app/common/displaycontrols/dashboard/directives/dashboard.js @@ -9,7 +9,7 @@ angular.module('bahmni.common.displaycontrol.dashboard') }; if ($scope.patient !== undefined && $state.current.name.includes('patient.dashboard.show')) { - var dashboardConfig = $scope.config.sections['forms-v2-react'] ? $scope.config.sections['forms-v2-react'].dashboardConfig : null; + var dashboardConfig = $scope.config.sections && $scope.config.sections['forms-v2-react'] ?$scope.config.sections['forms-v2-react'].dashboardConfig : null; $scope.formData = { patientUuid: $scope.patient.uuid, patient: $scope.patient, From 28d6839322376d0f2f20970e3c1bab70f81b9e00 Mon Sep 17 00:00:00 2001 From: SreelekhaDarsi Date: Wed, 12 Jun 2024 14:11:58 +0530 Subject: [PATCH 2/2] Sreelekha | MOBN-2347 | Fix. Lint issues --- .../clinical/consultation/controllers/addTreatmentController.js | 2 +- ui/app/common/displaycontrols/dashboard/directives/dashboard.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/clinical/consultation/controllers/addTreatmentController.js b/ui/app/clinical/consultation/controllers/addTreatmentController.js index 729f0677b6..e922e75013 100644 --- a/ui/app/clinical/consultation/controllers/addTreatmentController.js +++ b/ui/app/clinical/consultation/controllers/addTreatmentController.js @@ -823,7 +823,7 @@ angular.module('bahmni.clinical') var showRulesInMedication = function (medicationConfig) { $scope.showRulesInMedication = false; if (medicationConfig && medicationConfig.tabConfig && medicationConfig.tabConfig.allMedicationTabConfig - && medicationConfig.tabConfig.allMedicationTabConfig.orderSet ) { + && medicationConfig.tabConfig.allMedicationTabConfig.orderSet) { if (medicationConfig.tabConfig.allMedicationTabConfig.orderSet.showRulesInMedication) { $scope.showRulesInMedication = true; } diff --git a/ui/app/common/displaycontrols/dashboard/directives/dashboard.js b/ui/app/common/displaycontrols/dashboard/directives/dashboard.js index f77c794a07..5099d802cb 100644 --- a/ui/app/common/displaycontrols/dashboard/directives/dashboard.js +++ b/ui/app/common/displaycontrols/dashboard/directives/dashboard.js @@ -9,7 +9,7 @@ angular.module('bahmni.common.displaycontrol.dashboard') }; if ($scope.patient !== undefined && $state.current.name.includes('patient.dashboard.show')) { - var dashboardConfig = $scope.config.sections && $scope.config.sections['forms-v2-react'] ?$scope.config.sections['forms-v2-react'].dashboardConfig : null; + var dashboardConfig = $scope.config.sections && $scope.config.sections['forms-v2-react'] ? $scope.config.sections['forms-v2-react'].dashboardConfig : null; $scope.formData = { patientUuid: $scope.patient.uuid, patient: $scope.patient,