Skip to content

Commit

Permalink
"Sreelekha | MOBN-2437 | Rebase IPD master and add config for CURE "
Browse files Browse the repository at this point in the history
  • Loading branch information
SreelekhaDarsi committed Jul 24, 2024
1 parent c82d272 commit 7b3efca
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,9 @@ 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.tabConfig.allMedicationTabConfig.orderSet.showRulesInMedication) {
if (medicationConfig !== 'undefined' && medicationConfig.tabConfig !== 'undefined' && medicationConfig.tabConfig.medicationTabConfig
!== 'undefined' && medicationConfig.tabConfig.medicationTabConfig.orderSet !== undefined) {
if (medicationConfig.tabConfig.medicationTabConfig.orderSet.showRulesInMedication) {
$scope.showRulesInMedication = true;
}
}
Expand All @@ -848,9 +848,9 @@ angular.module('bahmni.clinical')

var setContinuousMedicationRoutes = function (medicationConfig) {
$scope.continuousMedicationRoutes = [];
if (medicationConfig && medicationConfig.tabConfig && medicationConfig.tabConfig.allMedicationTabConfig
&& medicationConfig.tabConfig.allMedicationTabConfig.inputOptionsConfig) {
$scope.continuousMedicationRoutes = medicationConfig.tabConfig.allMedicationTabConfig.inputOptionsConfig.continuousMedicationRoutes || [];
if (medicationConfig && medicationConfig.tabConfig && medicationConfig.tabConfig.medicationTabConfig
&& medicationConfig.tabConfig.medicationTabConfig.inputOptionsConfig) {
$scope.continuousMedicationRoutes = medicationConfig.tabConfig.medicationTabConfig.inputOptionsConfig.continuousMedicationRoutes || [];
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="section-title has-toggle" toggle="addTreatment">
</div>
</article>
<div class="unit-wrap clearfix">
<article class="form-field" ng-show="showRulesInMedication" >
<article class="form-field" ng-show=false >
<div class="field-attribute">
<label class="dose-label">{{ ::treatmentConfig.translate('rule', 'MEDICATION_LABEL_RULE') }} </label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = null;
$scope.formData = {
patientUuid: $scope.patient.uuid,
patient: $scope.patient,
Expand Down
4 changes: 2 additions & 2 deletions ui/app/common/displaycontrols/dashboard/views/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<article ng-class="tabConfigName === 'allMedicationTabConfig' ? '' :'patient-dashboard visit'">
<div ng-class="tabConfigName === 'allMedicationTabConfig' ? '' :'pgContainer'">
<article ng-class="tabConfigName === 'medicationTabConfig' ? '' :'patient-dashboard visit'">
<div ng-class="tabConfigName === 'medicationTabConfig' ? '' :'pgContainer'">
<article>
<div ng-repeat="sections in sectionGroups" class="dashboard-sections-wrapper">
<div ng-if="::isFullPageSection(sections)" ng-repeat="section in sections" class="dashboard-sections fullpage-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('visitHeaderController', function () {
var boards = [{
url: "bacteriology",
extensionParams: {
"tabConfigName": "allMedicationTabConfig",
"tabConfigName": "medicationTabConfig",
"priority": "high"
}
}, {
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('visitHeaderController', function () {

expect(rootScope.hasVisitedConsultation).toBeTruthy();
expect(scope.collapseControlPanel).toHaveBeenCalled();
expect(mockLocation.url).toHaveBeenCalledWith('/default/patient/somePatientUuid/dashboard/bacteriology?tabConfigName=allMedicationTabConfig&priority=high');
expect(mockLocation.url).toHaveBeenCalledWith('/default/patient/somePatientUuid/dashboard/bacteriology?tabConfigName=medicationTabConfig&priority=high');
});

it("should goto consultation from Visit page with given stateParams", function () {
Expand All @@ -169,7 +169,7 @@ describe('visitHeaderController', function () {
scope.openConsultation();
expect(rootScope.hasVisitedConsultation).toBeTruthy();
expect(scope.collapseControlPanel).toHaveBeenCalled();
expect(mockLocation.url).toHaveBeenCalledWith('/program/patient/somePatientUuid/dashboard/bacteriology?programUuid=programUuid&enrollment=patientProgramUuid&tabConfigName=allMedicationTabConfig&priority=high');
expect(mockLocation.url).toHaveBeenCalledWith('/program/patient/somePatientUuid/dashboard/bacteriology?programUuid=programUuid&enrollment=patientProgramUuid&tabConfigName=medicationTabConfig&priority=high');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ describe('TreatmentController', function () {
var controller = $controller('TreatmentController', {
$scope: $scope,
treatmentConfig: {drugOrderHistoryConfig: {view: 'default'}},
$stateParams: {tabConfigName: 'allMedicationTabConfig'},
$stateParams: {tabConfigName: 'medicationTabConfig'},
appService: appService,
clinicalAppConfigService: clinicalAppConfigService,
$filter: filter
});
controller.initializeTreatments = jasmine.createSpy('initializeTreatments');
$scope.consultation = {
newlyAddedTabTreatments: {
allMedicationTabConfig: {
medicationTabConfig: {
treatments: [],
orderSetTreatments: [],
newOrderSet: "new order"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("AddTreatmentController", function () {
var medicationConfig = {
"commonConfig": {},
"tabConfig": {
"allMedicationTabConfig": {
"medicationTabConfig": {
"orderSet": {
"calculateDoseOnlyOnCurrentVisitValues": false,
"showRulesInMedication": true
Expand Down

0 comments on commit 7b3efca

Please sign in to comment.