Openmrs best practices for creating a widget in coreapps

coreapps
Tags: #<Tag:0x00007efd179245a8>

(Laura Vignoli) #1

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