Openmrs best practices for creating a widget in coreapps

Hi All,

I would like to know what are the best practices when creating a new widget in coreapps.

For example, we are developing a widget that displays 2 graphs for vitals vs lab results. Part of the config is a vitals concepts set and a lab results concepts set that will populate 2 dropdowns.

{
 "id": "coreapps.resultstrendview",
 "instanceOf": "coreapps.template.dashboardWidget",
 "description": "coreapps.resultstrendview.app.description",
 "order": 10,
 "config": {
     "widget": "resultstrendview",
     "icon": "",
     "label": "RESULTS TREND VIEW",
     "maxResults": "100",
     "maxAge": "1y",
     "vitalsListUuid":"106411d9-f354-4160-8603-4dec659d1bb6",
     "labResultsUuid":"23281464-74d8-47d9-9a39-7a1f1d7caa4f",
     "links":{
     "Go to Page":"/openmrs/coreapps/patientdashboard/resultsTrendView.page?patientId={{patientUuid}}&app=coreapps.resultstrendview"
     }
 },
 "extensions": [
 		{
         "id": "${project.parent.groupId}.${project.parent.artifactId}.mostRecentVitals.clinicianDashboardFirstColumn",
         "appId": "coreapps.resultstrendview",
         "extensionPointId": "patientDashboard.firstColumnFragments",
         "extensionParams": {
             "provider": "${project.parent.artifactId}",
             "fragment": "dashboardwidgets/customLinksWidget"
         }
     }
 ]
}

My questions are:

1- Is it ok to expect sets instead of comma delimited concepts

2- Should we add the app json as a template?

3- Should we write documentation in this wiki page: https://wiki.openmrs.org/display/docs/Patient+Summary+Widget+Documentation

4- Can we add the template with concept uuids that don’t exist in reference application?

Thanks you!

Laura

@maimoonak @minoneves @ssmusoke @imranarif @tmvumbi @dkayiwa

@lauravignoli we are please sorry for the delay in getting back to you on this!

  1. Fine as a starting point to use sets. Though comma delimited concepts, or a mixture of both, looks like a more flexible approach.
  2. Yes go ahead and add the app json as a template.
  3. Adding to that documentation would be awesome! :slight_smile:
  4. Could you be knowing why these concepts are not part of the CIEL dictionary?

Hi Daniel,

We are still adding concepts, so for now, we haven’t added them to CIEL. We plan to do it later on.

Thanks :slight_smile: Laura