# Context-specific Dashboards via Core Apps

**URL:** https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409
**Category:** Development
**Created:** [May 9, 2017, 7:51pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409 "2017-05-09T19:51:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)
#### Post date: [May 9, 2017, 7:51pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409/1 "2017-05-09T19:51:01Z")

</div>

Hello all–

As part of adding support for programs to the reference app, we’ve started thinking about the idea of “context-specific” dashboards. Specifically, for some of our programs, like HIV, we’d like to have a special dashboard that displays HIV-related functionality.

At it’s simplest level, this a “context-specific” dashboard could just be an instance of the clinician-facing dashboard, but with a different set of display elements in the two columns, and a different set of actions and visit actions (or no actions at all).

I was starting to think today about a way to implement this, and I realized there’s a rather simple way to provide the basic underlying functionality. All one really needs to do is make the extension points on the patient dashboard parameterizable. For instance, currently in PatientPageController we set up the extensions as follows:

```
List<Extension> firstColumnFragments = appFrameworkService.getExtensionsForCurrentUser("patientDashboard.firstColumnFragments");
Collections.sort(firstColumnFragments);
model.addAttribute("firstColumnFragments", firstColumnFragments);

```

We could simply make this parameterizable via a request parameter called “dashboard”, ie:

```
List<Extension> firstColumnFragments = appFrameworkService.getExtensionsForCurrentUser(dashboard + ".firstColumnFragments");
Collections.sort(firstColumnFragments);
model.addAttribute("firstColumnFragments", firstColumnFragments);

```

Of course, there would be further complexities on top of this: we’d need to make sure we can configure breadcrumbs correctly, we’d need to make sure returnUrls are properly configured, we’d probably want to add some sort of header so that the end user realizes what context they are is, and, of course, we’d have to build some widgets that provide entry points to different contexts (my thought is that in our case the program lists widget would provide this).

But it would be easy to set up the above functionality as a first step, and then start to add other functionality in as needed. And it should be completely backwards compatible by using the default extension points if no custom context is passed in.

Any thoughts or objections to this approach? I will continue to do some exploration…

Take care, Mark

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [May 9, 2017, 8:13pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409/2 "2017-05-09T20:13:17Z")

</div>

I seem to like this. Looking forward to see more results from your exploration! 🙂

---

<div class="post-metadata">

### Author: ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)
#### Post date: [July 16, 2017, 6:58pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409/3 "2017-07-16T18:58:28Z")

</div>

@mogoodrich Do you have any progress updates to share on this - very interested as this has come up for UgandaEMR too

---

<div class="post-metadata">

### Author: ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)
#### Post date: [July 17, 2017, 1:35pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409/4 "2017-07-17T13:35:40Z")

</div>

Thanks for the reminder @ssmusoke, I never followed up here, but it was implemented as part of this ticket:

> <https://issues.openmrs.org/browse/RA-1361>

And, no, it hasn’t been documented yet (though it isn’t super complex if you want to look at the code and see what it does). Suggestions of where documentation for this should live?

Take care, Mark

---

<div class="post-metadata">

### Author: ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)
#### Post date: [July 17, 2017, 1:58pm UTC](https://talk.openmrs.org/t/context-specific-dashboards-via-core-apps/11409/5 "2017-07-17T13:58:27Z")

</div>

@mogoodrich Where can I see an example usage as that would compliment the code?

I am still in a dilemma over where the documentation would belong see [Best Practice for location of module documentation](https://talk.openmrs.org/t/best-practice-for-location-of-module-documentation/12419) - this is a good example that would not find a good place on the WIKI but would need to be at a module level
