Adding more sections & Customizable Widgets to the Clinician Dashboard

Great!

Do you mean widgets mentioned in this thread will be built as part of GSoC?

@raff I was hoping that the widgets in this thread would get built before providing a foundation of additional widgets for GSoC.

Perfect! Let’s get them done then! I can setup a sprint tomorrow to work on them. You didn’t create issues yet, did you? I can handle that… Let me know!

@raff you can go ahead and create the issues, I am working on a Wiki page for the documentation that I think will provide some insight into what I am thinking which will be done in the next 2 hours.

@raff Here is a first cut - will add more as they come to mind https://wiki.openmrs.org/display/docs/Patient+Summary+Widget+Documentation

@darius A question on the App Framework:

  1. Can the app templates be inherited, which means that authors do not have to add all fields to all templates

  2. Can application definitions be inherited so that instead of copying all the contents of an appId, I can extend it overwriting the parameters that I need.

1 Like

FYI, I’ve created an epic at https://issues.openmrs.org/browse/RA-1299

Soon we’ll do estimates and create a sprint.

Sprint announced here: Patient Summary Widgets Sprint

1 Like

I don’t think so. Are you sure “app template” is right for this, though? A widget isn’t an app…

We have a disconnect here. I would not expect each widget to be an app or an app template. My current thinking is somewhere in this post.

Can anyone help with the reference registrationapp. i added the attributes: Empresa, grupo sanguíneo, profissão. it shows in the new patient registration process but does not show in patient dashboard. here is the code below:

{ “id”: “referenceapplication.registrationapp.myRegisterPat”, “instanceOf”: “registrationapp.registerPatient”, “label”: “Cadastrar Paciente”, “description”: “Criar uma ficha para paciente”, “extensions”: [ { “id”: “referenceapplication.registrationapp.registerPatient.homepageLink”, “extensionPointId”: “org.openmrs.referenceapplication.homepageLink”, “type”: “link”, “label”: “referenceapplication.app.registerPatient.label”, “url”: “registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegisterPat”, “icon”: “icon-user”, “order”: 1, “requiredPrivilege”: “App: registrationapp.registerPatient” } ], “config”: { “afterCreatedUrl”: “/coreapps/clinicianfacing/patient.page?patientId={{patientId}}”, “sections”: [ { “id”: “contactInfo”, “label”: “Informação”, “questions”: [

                      {
                        "legend": "Person.address",
                        "fields": [
                            {
                                "type": "personAddress",
                                "label": "registrationapp.patient.address.question",
                                "widget": {
                                    "providerName": "uicommons",
                                    "fragmentId": "field/personAddress"
                                    }
                                }
                            ]
                         },

{ “legend”: “Grupo sanguineo”, “id”: “myPersonAttributeLabel”, “fields”: [ { “type”: “personAttribute”, “label”: “Grupo sanguineo do paciente”, “formFieldName”: “GrupoSanguineo”, “uuid”: “c29cbfbf-3a89-457c-8908-2b8274fa06af”, “widget”: { “providerName”: “uicommons”, “fragmentId”: “field/text” }, “cssClasses”: [“GrupoSanguineo”,“required”] } ] },

                    {
                        "legend": "registrationapp.patient.phone.label",
                        "id": "phoneNumberLabel",
                        "fields": [
                            {
                                "type": "personAttribute",
                                "label": "registrationapp.patient.phone.question",
                                "formFieldName": "phoneNumber",
                                "uuid": "14d4f066-15f5-102d-96e4-000c29c2a5d7",
                                "widget": {
                                    "providerName": "uicommons",
                                    "fragmentId": "field/text"
                                },
                                "cssClasses": ["phone"]
                            }
                        ]
                    }
                ]
            },


            {
                "id": "relationships-info",
                "label": "registrationapp.person.relationship",
                "questions": [
                    {
                        "legend": "registrationapp.person.relationship.label",
                        "header": "registrationapp.person.relationship.question",
                        "fields": [
                            {
                                "type": "personRelationships",
                                "widget": {
                                    "providerName": "registrationapp",
                                    "fragmentId": "field/personRelationship"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Do you mind creating a new post for this?

@ssmusoke I see there is a new graph that overlays height and weight in the patient summary widget wiki. (see below)


I added the code that was provided and modified it to show height and weight concepts:

{

“id”: “custom.obsgraph.weightheight”, “instanceOf”: “coreapps.template.dashboardWidget”, “description”: “coreapps.obsGraph.app.description”, “order”: 10, “config”: { “widget”: “obsgraph”, “icon”: “icon-bar-chart”, “label”: “Obs Graph Height/Weight”, “conceptId”: “5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “maxResults”: “6”, “maxAge”: “1w” }, “extensions”: [ { “id”: “org.openmrs.module.coreapps.mostRecentVitals.clinicianDashboardFirstColumn”, “appId”: “custom.obsgraph.weightheight”, “extensionPointId”: “patientDashboard.firstColumnFragments”, “extensionParams”: { “provider”: “coreapps”, “fragment”: “dashboardwidgets/dashboardWidget” } } ] } same code here: Hastebin: Send and Save Text or Code Snippets for Free | Toptal®

When I saved that code, I get a blank widget with the two concepts but I get the graphs if I only put one or the other concept uuid.

Please advise.

Thank you,

John

@cioan Made nice improvements for dashboard widget graphs and also allowing for logarithm graphs (used for viral load). Appreciation to Cosmin.

1 Like

Sorry @jesplana for the late reply.

I just re-tested this widget in our environment here at PIH and it works fine for us. How many results the following REST calls return? One is for the Height obs and the other for the Weight obs. Please replace the PATIENT_UUID below with your test patient.

http://YOUR_SERVER_URL/openmrs/ws/rest/v1/obs?concept=5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&patient=PATIENT_UUID&v=custom:(uuid,display,obsDatetime,value,concept:(uuid,display,name:(display),datatype:(uuid,display)))

http://YOUR_SERVER_URL/openmrs/ws/rest/v1/obs?concept=5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&patient=PATIENT_UUID&v=custom:(uuid,display,obsDatetime,value,concept:(uuid,display,name:(display),datatype:(uuid,display)))

If the REST calls above return results, then just set the maxResults to 20 or higher number and remove the maxAge parameter.

Thank you @ball for tagging @cioan

@cioan, I tried your suggestion and received the following:

http://YOUR_SERVER_URL/openmrs/ws/rest/v1/obs?concept=5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&patient=PATIENT_UUID&v=custom:(uuid,display,obsDatetime,value,concept:(uuid,display,name:(display),datatype:(uuid,display)))

I received the following results:

http://YOUR_SERVER_URL/openmrs/ws/rest/v1/obs?concept=5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&patient=PATIENT_UUID&v=custom:(uuid,display,obsDatetime,value,concept:(uuid,display,name:(display),datatype:(uuid,display)))

I changed the maxResults to 20 but unfortunately it didn’t work. I also changed it to 100 and it also didn’t work. I removed the maxAge parameter. See below: image

I am running OpenMRS 2.1.3 and Refapp 2.9.0-snapshot

Thank you,

John

@jesplana: Can you please use Postman or some other tool that formats the json response? It looks like you have no weight and height obs for this patient?

@cioan Here’s the json I used for the widget: Hastebin: Send and Save Text or Code Snippets for Free | Toptal® And yes, the rest call looks like I have no weight and height obs but I have several obs captured in different date/time: image

and if I do just the weight, I get this:

image

And for the height, I get this:

image

And if I include both the weight and height, I get this: image

Thanks!

John

Hi @jesplana, do you have this code deployed to a test server I could access via the browser? I could use the browser debugger to try to understand why this widget does not work in your environment.
Are there any errors in the Javascript DevTools console?

Hi @cioan, I loaded the code in the QA server (the demo is not working at the moment).

I added the widget in the patient dashboard called (Height/Weight). https://qa-refapp.openmrs.org/openmrs/coreapps/clinicianfacing/patient.page?patientId=90f7f0b4-06a8-4a97-9678-e7a977f4b518

Here’s the link to the app: https://qa-refapp.openmrs.org/openmrs/referenceapplication/userApp.page?appId=test.weightHeight&action=edit&

The QA server is also not rendering the widget:

As you can see, there is the weight and height data.

Thank you,

John

Mystery solved. The QA server does not have the latest coreapps SNAPSHOT that contains the changes I made to the obsgraph widget to support multiple concepts.

https://qa-refapp.openmrs.org/openmrs/admin/modules/module.list

@jesplana: You need to test your Height&Weight graph widget with the lastest coreapps SNAPSHOT.

@cioan ah perfect. Let me update to the latest coreapps module and re-test. I will restart this conversation in case I run into any more issues. Thanks a lot for all your help.

John