Skip to content

Commit

Permalink
Merge pull request #671 from Bahmni/drug-chart-schedule-tasks
Browse files Browse the repository at this point in the history
[Sowmya|Tanya] | Adds logic to fetch drug chart data | A-1204950368410820
  • Loading branch information
tanyaa-tw authored Aug 18, 2023
2 parents f3db896 + dfb9d2d commit a5f3524
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
11 changes: 3 additions & 8 deletions micro-frontends/src/ipd/IpdDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function IpdDashboard(props) {
<Suspense fallback={<p>Loading...</p>}>
<LazyApp
hostData={props.hostData}
hostApi={props.hostApi}
/>
</Suspense>
</>
Expand All @@ -19,11 +18,7 @@ export function IpdDashboard(props) {
// Without propTypes, react2angular won't render the component
IpdDashboard.propTypes = {
hostData: PropTypes.shape({
patient: PropTypes.shape({
uuid: PropTypes.string.isRequired,
}).isRequired,
}),
hostApi: PropTypes.shape({
onConfirm: PropTypes.func,
}),
patientId: PropTypes.string,
forDate: PropTypes.instanceOf(Date),
}).isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

angular.module('bahmni.clinical')
.controller('PatientDashboardController', ['$scope', 'clinicalAppConfigService', 'clinicalDashboardConfig', 'printer',
'$state', 'spinner', 'visitSummary', 'appService', '$stateParams', 'diseaseTemplateService', 'patientContext', '$location', '$filter', 'confirmBox',
'$state', 'spinner', 'visitSummary', 'appService', '$stateParams', 'diseaseTemplateService', 'patientContext', '$location', '$filter',
function ($scope, clinicalAppConfigService, clinicalDashboardConfig, printer,
$state, spinner, visitSummary, appService, $stateParams, diseaseTemplateService, patientContext, $location, $filter, confirmBox) {
$state, spinner, visitSummary, appService, $stateParams, diseaseTemplateService, patientContext, $location, $filter) {
$scope.patient = patientContext.patient;
$scope.activeVisit = $scope.visitHistory.activeVisit;
$scope.activeVisitData = {};
Expand All @@ -25,29 +25,10 @@ angular.module('bahmni.clinical')
alert("We have a full fledged problem");
}
};

$scope.ipdDashboard = {
hostData: {
patient: {
uuid: "--- DUMMY UUID FOR TESTING FROM HOST ---"
}
},
hostApi: {
onConfirm: function () {
const dialogScope = {
message:
"This is a dialog triggered on the host in response to an event from IPD ",
okay: function (close) {
close();
}
};

confirmBox({
scope: dialogScope,
actions: [{ name: "okay", display: "Okay" }],
className: "ngdialog-theme-default"
});
}
patientId: $stateParams.patientUuid,
forDate: new Date().toUTCString()
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("patient dashboard controller", function () {
beforeEach(module('bahmni.clinical'));

var scope, spinner, _clinicalDashboardConfig, _clinicalAppConfigService, _state, _appService, _diseaseTemplateService,
_stateParams, _controller, _appConfig, location, filter, confirmBox;
_stateParams, _controller, _appConfig, location, filter;
var diseaseTemplates;
location = {
path: function () {
Expand Down Expand Up @@ -43,7 +43,6 @@ describe("patient dashboard controller", function () {

_appService = jasmine.createSpyObj('appService', ['getAppDescriptor']);
_appConfig = jasmine.createSpyObj('appConfig', ['getConfigValue']);
confirmBox = jasmine.createSpyObj('confirmBox', ['show']);

_appService.getAppDescriptor.and.returnValue(_appConfig);
_diseaseTemplateService = jasmine.createSpyObj('diseaseTemplateService', ['getLatestDiseaseTemplates']);
Expand Down Expand Up @@ -118,7 +117,6 @@ describe("patient dashboard controller", function () {
diseaseTemplateService: _diseaseTemplateService,
patientContext: {patient: {}},
$filter: filter,
confirmBox: confirmBox

});
});
Expand Down Expand Up @@ -156,7 +154,6 @@ describe("patient dashboard controller", function () {
$stateParams: _stateParams,
diseaseTemplateService: _diseaseTemplateService,
patientContext: {patient: {}},
confirmBox: confirmBox

});
});
Expand Down Expand Up @@ -201,7 +198,6 @@ describe("patient dashboard controller", function () {
diseaseTemplateService: _diseaseTemplateService,
patientContext: {patient: {}},
$location: location,
confirmBox: confirmBox

});
expect(_clinicalDashboardConfig.currentTab.translationKey).toBe("DASHBOARD_TAB_PATIENT_SUMMARY_KEY");
Expand Down

0 comments on commit a5f3524

Please sign in to comment.