After having successfully gotten an already-filled-out HTML Form to display in the new UI Framework we're using, I still needed to allow you to fill out a form. In the end it was a lot easier than I expected, though I still want to review what I did with Mark Goodrich (current owner of the HTML Form Entry module) so we can decide whether this is really the right approach, and how best to package it up for others to use as well.
The commit is here (and more dev-related details are after the jump).
But first, here's a screenshot-based walkthrough of the whole process of filling out an HTML Form and then viewing it:
|First we find a patient and open a visit for them|
|Clicking the "Vitals" button opens the relevant HTML Form|
|Voilà! The visit now contains a vitals encounter, and the "Vitals" button is gone.|
|Clicking on the Vitals encounter in the previous screenshot displays it in a popup|
For our project, the two main reasons to use HTML Forms rather than just the UI Framework are that:
- the technology is well-tested, and behaves consistently. You don't really need to worry about a developer doing something wrong and losing form data.
- we can build fancy ajax-y workflows with the UI Framework where they'll provide value, but we can implement arbitrarily large forms for typical data entry tasks without too much effort, and without requiring training on the UI Framework.
More dev details:
One thing I noticed when looking at the existing htmlFormEntry.jsp page is that we've got a lot of code there, that could stand to be cleaned up from a stylistic perspective. (Though if it ain't broke...) But it was very easy to copy some snippets of the code, replace some trivial DWR with plain jQuery.getJSON, and get the submission working.
I think we'll want to incorporate some parts of this back into the mainline HTML Form Entry module.