Customizing the OpenMRS Patient Dashboard with Access Location Information

Week 3[May 28, 2018 — June 04, 2018]

This is the third week of the Google Summer of Code 2018, I mostly completed the design phase of the initial module implementation. This week, I totally played with Customizing Patient Dashboard with Access Location Information field.

Actually, I need a field to assign the patients to locations while they are registering the patients in the system. So the only preferred way is, create a design to customize the OpenMRS Patient Dashboard with Access Location Information field.

Custom Sections and Fields on the Registration App

The OpenMRS Reference Application includes a built-in Registration app that is configured for a common usage. However it is possible to disable the built-in app, and set up our own customized version of a patient registration app definition.

I can simply add a person attribute to the App Definition by providing the UUID of that required person attribute. Then It will add a simple text box to the patient registration form and pass that value as a person attribute.

{
“type”: “personAttribute”,
“label”: “Mother’s Name”,
“formFieldName”: “mothersName”,
“uuid”: “8d871d18-c2cc-11de-8d13–0010c6dffd0f”,
“widget”: {
“providerName”: “uicommons”,
“fragmentId”: “field/text”
}
}

But I need to add a drop down with active locations in that respected system for the selection while they registering the patients. So I can’t simply use the uicommons-field/text method. I need to create a separate fragment inside my module, And that fragment should be linked with this app definition.

{
“type”: “personAttribute”,
“label”: “Mother’s Name”,
“formFieldName”: “mothersName”,
“uuid”: “8d871d18-c2cc-11de-8d13–0010c6dffd0f”,
“widget”: {
“providerName”: “locationbasedaccess”,
“fragmentId”: “field/locations”
}
}

The app definition mentioned above will add the locations fragment to the patient registration dashboard with all active locations information. The view page of the patient registration dashboard will be like this following,

Yes!!!!…. I have configured the new fragment with OpenMRS Patient Registration Dashboard. Now I am working to finalize this implementation and planning to move to the next objective soon.

References :

  1. https://wiki.openmrs.org/display/docs/Registration+App+Configuration
  2. https://talk.openmrs.org/t/how-to-customise-the-patient-registration-page/2537/5