Configure clinical visit page

How do you go about configuring the clinical visit page? Is this definition accurate? https://bahmni.atlassian.net/wiki/display/BAH/visit.json

We would like to not display all the default sections in the visit page, but it looks like this defaultSections parameter has to be always be present and set to true? Otherwise the page crashes with this error:

angular.min.9324788c.js:2 TypeError: Cannot read property 'sections' of undefined at https://192.168.33.21/bahmni/clinical/clinical.min.128620e4.js:15:30627 at https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:2:25727 at r.$eval (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:3:1034) at r.$digest (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:2:31638) at r.$apply (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:3:1325) at g (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:2:9738) at R (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:2:11873) at XMLHttpRequest.v.onload (https://192.168.33.21/bahmni/components/angular/angular.min.9324788c.js:2:12418) undefined

Here is our visit.json configuration:

Thanks for your help.

Hello Cosmin Ioan,

It is mandatory to have at least one tab/dashboard that has “defaultSections”: true Sorry for not mentioning that point in wiki. Thanks for pointing out. Updated the wiki https://bahmni.atlassian.net/wiki/display/BAH/visit.json

Thanks

Thank you @sravanthi17! So, there is no way to overwrite the default visit dashboard sections? Is it possible for us to only display a subset of those default sections? Thanks!

You can’t override the default visit dashboard but you can add a set of sections to the default page as documented in the wiki. If you want to see a set of sections (not all by default), then you can create a new visit dashboard with required sections configured. Is this what you are looking for?

Hi @sravanthi17, Thank you for your help. Sorry for not being clear with our requirements. We would like to remove Admission Details, Treatments, Radiology and Patient Files sections from the Visit dashboard. How should we do this? How should we go about creating a new visit dashboard that does not automatically load all the default sections? Thanks.

General dashboard will have pre defined sections of display controls. One can only append to that tab/dashboard and no option to delete from that dashboard.

However create another section in visit.json. The template is as below :slight_smile:

  "Another Tab": {
    "title": "Title of the Tab",
    "sections": {
      //add the sections you want to see in this dashboard
     }
  }

Thanks @sravanthi17. Has making this fully configurable been considered? I can definitely see scenarios where one might want to have more control over this view - either in excluding certain sections (eg. if radiology or inpatient care is not available at a facility, or has not been implemented yet), or in re-ordering the sections (eg. adding new sections to the top or middle, rather than the bottom of the view).

I’m interested to know if there are particular technical or functional reasons not to do this, or if it just would need prioritization.

Thanks! Mike

Hello @mseaton,

Previously it was fully configurable similar to patient dashboard. Because we identified that visit page should show all the information specific to that visit, we introduced pre defined sections.

Raised a defect to allow defaultSections: false https://bahmni.mingle.thoughtworks.com/projects/bahmni_emr/cards/1636

Thanks, Sravanthi

There is a configuration “displayOrder” to control the order of sections displayed on the page. However, it doesn’t work with predefined sections. Once the defect on defaultSections is fixed, reordering the sections should work as you suggested.

I’m not an expert on this, but is the workaround to get rid of those sections, to avoid granting a certain privilege to any users?

Good question - we had also wondered that.

@sravanthi17 thanks for the quick response to our questions and linking to the mingle issue - it’s great to see!

Cheers, Mike

@sravanthi17 is the defect on defaultSections fixed? I am still getting the section undefined error when setting defaultSections: false

Is anyone aware if this got fixed ever? When i put the defaultSections to false in the configuration it gives an error “TypeError: Cannot read property ‘sections’ of undefined”

I couldn’t trace it on Bahmni JIRA (we did import all mingle cards back in 2016). @arjun just create another card.

This feature is available (a few steps needed):

If you see this wiki page it says the following: https://bahmni.atlassian.net/wiki/spaces/BAH/pages/37945563/visit.json

> There should be at least one tab / dashboard that has “defaultSections”: true

What this means is that in “visit.json” file under “clinical” folder, duplicate the “general” attribute and rename it to something different like: “general1:” and give it an appropriate KEY_NAME as you wish to see on screen. Then in this first section, you can set defaultSections to false and put only the sections you want.

Here is a sample config file and screenshot that I tired on V0.92:

Here is my visit.json file: Bahmni Visit Dashboard configuration with additional section default sections false - Pastebin.com

Code background: It seems there is some code written which specifically looks for the first tab that has defaultSection true and manipulates some Treatment config. See code here: openmrs-module-bahmniapps/visitTabConfig.js at ea3e81a2c5e1c7450aa16674ea349475d20e8b42 · Bahmni/openmrs-module-bahmniapps · GitHub

The comment says:
// TODO: Patch for #1461 lokbiradari-config: It's bad. But to err is Human, to forgive is Divine!

What do you feel is going on here? :slight_smile: