Adding optional Encounter Type Parameter to ObsGraph Widget

Hi All,

We need a new feature in ObsGraph widget in coreapps. Please find the required details below.


In one of our requirement, we are showing multiple graphs based on observations. For that we are using ObsGraph.

In our scenario, we have same concept used in multiple encounter types (for example custom concept ‘Total Score’ is used in multiple encounter types). Due to this, we are seeing Total Score observations from different encounter types are shown in same graph.

So want to have filter based on EncounterType for ObsGraph.

Expected Change

We wish to implement optional filter parameter for encounterType in ObsGraph Widget.

ObsGraph should work as expected even encounterType is not configured.

  "id": "coreapps.obsGraph",
  "instanceOf": "coreapps.template.dashboardWidget",
  "description": "",
  "order": 10,
  "config": {
    "widget": "obsgraph",
    "icon": "icon-bar-chart",
    "label": "Obs Graph",
    "conceptId": "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,3ce93cf2-26fe-102b-80cb-0017a47871b2",
    "maxResults": "6",
    "maxAge": "1w",
    "encounterType": "45693cf2-22ge-102b-80cb-0017a47812d2"
  "extensions": [
      "id": "org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn",
      "appId": "coreapps.obsGraph",
      "extensionPointId": "patientDashboard.firstColumnFragments",
      "extensionParams": {
        "provider": "coreapps",
        "fragment": "dashboardwidgets/dashboardWidget"

I have also created a card for this request RA-1725.

Please provide your thoughts on the same.

CC: @mksd, @ruhanga, @mddubey, @vasanth2019


Created a PR for this improvement request.

Thanks @rrameshbtech. I’ve added a comment on the PR.

I have added support for more than one encounter types.

Assuming this is backward compatible (and it looks like it is), I’m good with it. @mogoodrich could you have a look at the ticket/PR?

Yes @mksd. It is backward compatible.