What is the Best Way to Modify the Patient Dashboard?

My use case is relatively simple. I want to collect additional phone numbers when registering new patients. I followed Registration App Configuration instructions which thanks to @arbaughj & @mseaton and whoever else contributed are very easy to follow. I succeeded in adding those field to form as person attributes. The problem is, I don’t seem to be able to view this information, also I don’t see anyway of editing the collected details.

I understand one way (may be the only way right now) to accomplish this is to override the patient dashboard as described on Overriding requests for pages and fragment page. However I feel like this might be too much work for what I need to accomplish. So before I embark on that journey can anyone suggest an easier way of doing this?

@dkayiwa @ssmusoke @darius I hope you guys specifically might have something to say here given the history of talk threads related to this subject I have seen.

OpenMRS Reference Application Version: 2.6.1

1 Like

When you say that, “I don’t seem to be able to view this information”, what do you mean?

I mean when I go to the patient dashboard I can’t find any way of viewing the collected data on the person attribute types. Basically the patient header is static and it doesn’t include detailed information about the patient. On a second thought, how do I view the relationships as well?

@willa Apologies for the delay you can add a Patient Summary dashboard widget to display the sections that you want for example:

{
"id": "test.registrationSummary",
"label": "Registration Summary",
"icon": "icon-user",
"extensions": [
  {
    "id": "org.openmrs.module.yourmodule.registrationSummary.demographics",
    "extensionPointId": "patientDashboard.firstColumnFragments",
    "extensionParams": {
      "provider": "registrationapp",
      "fragment": "summary/section",
      "fragmentConfig": {
        "sectionId": "demographics",
        "appId": "yourmodule.registrationapp.registerPatient"
      }
    }
  },
  {
    "id": "org.openmrs.module.yourmodule.registrationSummary.contactInfo",
    "extensionPointId": "patientDashboard.firstColumnFragments",
    "extensionParams": {
      "provider": "registrationapp",
      "fragment": "summary/section",
      "fragmentConfig": {
        "sectionId": "contactInfo",
        "appId": "yourmodule.registrationapp.registerPatient"
      }
    }
  },
  {
    "id": "org.openmrs.module.yourmodule.registrationSummary.otherDemographics",
    "extensionPointId": "patientDashboard.firstColumnFragments",
    "extensionParams": {
      "provider": "registrationapp",
      "fragment": "summary/section",
      "fragmentConfig": {
        "sectionId": "otherDemographic",
        "appId": "yourmodule.registrationapp.registerPatient"
      }
    }
  }
],
"config": {
  "appId": "yourmodule.registrationapp.registerPatient",
  "patientId": "{{patient.id}}"
}

}

3 Likes

Just in case: https://wiki.openmrs.org/display/docs/Patient+Summary+Widget+Documentation

1 Like

Thanks @ssmusoke & @dkayiwa however I am still not clear on one thing. Where do I define these configurations? Are they supposed to be apps added independently? Unfortunately the linked documentation does not address this issue.

@willa yes this code would be an app usually in patient_dashboard_app.json (basically XXX_app.json) in omod/src/main/resources/apps folder.

Would adding using the administration UI (see attachment) work? I guess what I am asking is, isn’t that UI intended for things like these?

Again, thanks.

@willa yes you can test using that ui - that is the best place to start. Later you can move it to the location that I suggested to commit it to version control for your configuration module which I recommend for any customizations

1 Like

This code works perfect, thanks!

however, when I save the changes, the URL does not return me to the patient dashboard, instead I get an error, what can I add to return to the patient dashboard?

could you drop here the pr having the code you added?

Any updates on this issue? Thanks