diff --git a/ui/app/clinical/consultation/controllers/addTreatmentController.js b/ui/app/clinical/consultation/controllers/addTreatmentController.js index ee5406ef96..e922e75013 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..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['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,