Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: patient registration report #481

Merged

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Jun 10, 2016

This pull request implements the patient registration report as a PDF report on the client. It is opened by default via a "print" button on the patient registry page. The report is available as JSON, HTML, and PDF using the renderers implemented by @sfount.

Screenshots
html
[Fig 1]: HTML Report
pdf
[Fig 2]: PDF Report

This is a very rough PR, and should not be considered final. Here are some TODOs:

  1. Filtering on the client should be additive, and use a key:value model, so that each filter takes in one parameter. For example, name:jniles would be stored in the JSON { name : 'jniles' }, and be sent to the server as ?name=jniles.
  2. The Receipt Service is now overloaded with reports. We need to cleanly separate Receipts as a subset of reports, and ensure that the modal and controllers are appropriately named.

These should be tackled in a subsequent PR.

Closes #470.


Thank you for contributing!

Before submitting this pull request, please verify that you have:

  • Run your code through JSHint. Check out our styleguide.
  • Run integration tests.
  • Run end-to-end tests.
  • Accurately described the changes your are making in this pull request.

For a more detailed checklist, see the official review checklist that this PR will be evaluated against.

Ensuring that the above checkboxes are completed will help speed the review process and help build a stronger application. Thanks!

@jniles jniles added the design label Jun 10, 2016
@jniles jniles force-pushed the feature-patient-registration-report branch from 4fee710 to 6faf8e2 Compare June 10, 2016 12:57
@jniles
Copy link
Collaborator Author

jniles commented Jun 10, 2016

@sfount, in the spirit of living in the moment, this PR was made a moment ago, and the review should only take a moment. Could I get one?

@@ -44,7 +45,7 @@ function ReceiptModal(Modal, Receipts) {
notifyCreated : notifyCreated
};

var invoiceRequest = Receipts.invoice(uuid, { render : options.renderer });
var invoiceRequest = Receipts.invoice(uuid, { renderer : options.renderer });
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@sfount
Copy link
Contributor

sfount commented Jun 13, 2016

@jniles This has been reviewed.

If you could remove any code re-introducing logVisit/ visiit on the server patient controller this can be merged anytime!

@jniles
Copy link
Collaborator Author

jniles commented Jun 13, 2016

@sfount changes have landed.

This commit refactors the patients search functionality in the following
ways:
 1. Expose a programmatic API via `find()` to the query engine.
 2. Make `patients/search/?` use `find()` internally.
 3. Rename `detail` to `detailed`.
 4. Remove `fields` support.  Now any query parameter will be used to
 filter the columns from the database.

This provides a much richer API for searching for patients on both the
client and the server.
This commit refactors the server side to complete the PDF report
implementation.  Some notable improvements:
 1. Automatically template in the filters. This should be improved with
 varied colorschemes (IMA colors, for example).
 2. Adds `timestamp` helper to handlebars for more detailed time
 templates.
 3. Adds initial bare-bones clients structure for PDF printing modal.
This commit implements the client PDF report using the Receipt service
created by @sfount.  Because the client-side filters do not have a good
data model, printing with filtering has been left for later.

There are several prominent TODOs in this commit:
 1. Filtering on the client should be additive, and use a key:value
   model, so that each filter takes in one parameter.  For example,
   `name:jniles` would be stored in the JSON `{ name : 'jniles' }`, and
   be sent to the server as `?name=jniles`.
 2. The Receipt Service is now overloaded with reports.  We need to
 cleanly separate Receipts as a subset of reports, and ensure that the
 modal and controllers are appropriately named.
This commit removes the logVisit functionality accidentally re-introduced
in a failed rebase.  The `logVisit` functionality has been superseded
by patient checkins.
@jniles jniles force-pushed the feature-patient-registration-report branch from a72265f to ef077b4 Compare June 13, 2016 23:46
@jniles
Copy link
Collaborator Author

jniles commented Jun 14, 2016

@sfount, rebased.

@sfount sfount merged commit 847e807 into IMA-WorldHealth:master Jun 14, 2016
@jniles jniles deleted the feature-patient-registration-report branch June 14, 2016 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants