Adding a tab to the patient dashboard
The register module allows you to add a register view to the patient dashboard in its own tag. This tab is a complete 'application', in that you can create, edit and delete rows from the table, where each row represents an encounter (or htmlformentry submission). Unlike the regular operation of the register module, the register table in the patient dashboard tab will only display encounters for that patient. The significance of this new feature is that you can add clinically-meaningful, implementation-specific tabs to the patient dashboard just by making an htmlform and changing the value of a single global property.
Here's a screen-shot. You'll recognize the Overview, Regimens, Encounters, etc... tabs. The rest are tabs driven by htmlforms. In this example, you're looking at the previous two primary care visits for the patient Dave Test.
Setup is really easy: all you have to do to add a tab to the patient dashboard is:
- download and install the register module, version 1.2 or greater.
- create an htmlform
- find the formId for the htmlform (not the htmlformId). This is the id of the form under Administration/Manage Forms.
- add the formId (or the uuid of the form) to the global property register.showDashboardTabForHtmlForm. If you want to add more than 1 tab to the patient dashboard, this global property takes a comma-delimited list of formIds (or form uuids).
- stop and start the register module, and wait 30 seconds. The reason for this is that the patient dashboard extensions are added at module startup. So, once you've change the global property, you MUST restart the register module to have openmrs re-load extension points.
- And that's it. You can check the openmrs log to verify that the register module successfully loaded the patient dashboard extension points.
//wrapped around all the RegisterService methods for retrieving Encounters to display in a register;
View Register Entries
//wrapped around API call to delete an Encounter, Required to activate 'add/edit/delete' functionality in rendering of register
Manage Register Entries
//needed to have tab render on patient dashboard for form specified in global property register.showDashboardTabForHtmlForm
View Register Module Patient Dashboard Tabs