Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

OPD UX Changes #1001

Merged
merged 138 commits into from
Mar 23, 2017
Merged

OPD UX Changes #1001

merged 138 commits into from
Mar 23, 2017

Conversation

adeolabadmus
Copy link
Contributor

Fixes #996

Changes proposed in this pull request:

  • Changed Edit report to View
  • Added Print Button to visit page

cc @HospitalRun/core-maintainers

Chima1707 and others added 30 commits January 26, 2017 16:23
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adeolabadmus I commented below on how the print functionality can be done in a cleaner way.

As far as the update button is concerned, the abstract-edit-controller has a computed property. showUpdateButton that is used to determine if the update button should display. You can override that in your controller to not show the update button on an opd report when isNew is false. You still need to run the logic in abstract-edit-controller because it checks user permissions, so in your override you should do something like this:

showUpdateButton: computed('updateCapability', 'model.{isNew,reportType}', function() {
 let showUpdate = this._super();
 ...
additional logic to determine if update button should display.
}) 

@@ -516,6 +522,22 @@ export default AbstractEditController.extend(AddNewPatient, ChargeActions, Diagn
this.send('update', true);
},

printReport(report) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too keen on how this was implemented. I think a better approach would be when clicking on the Print button, you are directed to the report page and print automatically fires from that page. You can use the {{print-this}} component to automatically print the page on render, so if you pass in a queryParam, in the template you can add the following to auto print:

{{#if printQueryParam}} 
  {{print-this}}
{{/if}}

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a small change needed here before this can be merged.

export default Ember.Component.extend({
print: null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print should default to true; otherwise invoice printing won't work unless you change that template. I would prefer to change the default to true.

@jkleinsc jkleinsc merged commit be8201c into HospitalRun:master Mar 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants