Configuring form builder clinical forms and enable to change patient visit type from registration page.

Is there a native way to configure the following two things.

  1. I’ve created a form using Bahmni implementer’s interface. And i’m able to register observations from consultation tab. But as opposed to adding a concept set to All observation template and adding allowAddMore: true from the default config i’m able to register multiple entry of the same from. How do i do the same for forms created using form builder?
  2. After a patient has started a visit and Start Visit Type button changes to Enter visit detail button on registration page and no way to change visit type without closing the current visit. How should i configure being able to change visit?

Thanks

For Point2: You want to change the VISIT TYPE without closing the current visit? I believe that isn’t possible, once a visit has been started. You will need to close that visit, and open a new one.

cc: @angshuonline @akhilmalhotra @gokul - Any idea if this is possible?

For Point1: I didn’t fully understand. You want to be able to fill the same form (created using FormBuilder) more than once, during the same encounter?

Hi @gsluthra, point 2 is only possible if the user has changed the location.

  • The registered user logs into Bahmni with the OPD location and starts a visit.
  • Now, the user should change the location to the General Ward on the Bahmni homepage, located in the top right corner.
  • If we open the same patient in the registration module, we can start a new visit while keeping the previous visit active.

However, I would like to understand the actual use case for having two visits open simultaneously so that we can provide the right solution.

For this to be possible as Gokul described, there has to be more than one location tagged as ‘visit location’, which is recommended if a hospital has 2 separate buildings operating relatively independently of each other. Also, please elaborate on the use case so we can understand it better.

Hey @gsluthra , For point 1 for any form created using implementer’s interface its not possible to add configuration like allowAddMore: true. Or even make it a default observation form in clinical/extension.json to make it be opened by default in consultation tab

Is there another way to achieve this (Preferably without making code changes to the web)?

PIN the form

If you Pin the form, it should come by default as open in Consultation (Observations) tab. See this screenshot:

Once a form is pinned, this form will always show up in the left list of the Observation (Forms) tab, without having to search for it every time.

Add More option for a section (group)

You can enable the “Add More” Checkbox for a section, so you can repeat the whole section again. For example see the “Immunization Incident Record” Form that comes out-of-the-box with Bahmni LITE (clinic-config). See in demo here: https://demo-lite.mybahmni.in/

Form in Clinical UI:

‘Add More’ Enabled in Form Builder for this Form

I hope this helps.

I tried that solution which worked but has a weird relationship with display control. Let’s say i have an immunization form which has display controls of its own. When i add the section once again it wont have its own display control

Example: I have an immunization dropdown which users will select an immunization type (BCG, Polio, etc) and based on that a field gets displayed where users will select number of immunizations. Every immunization type has its own doses. When a user adds that section again has different immunization type the display control form.get('BCG Number of Immunization').setHidden(false) will hide all fields on every section or finds the first field with that concept name and shows it.

Can i have a display control specific to a section?

Thanks

I guess I have understood the problem that you’re facing with the AddMore section along with ControlEvents.

When you’re working with AddMore, use form.getFromParent instead of form.get.

Please see the sample code snippet for your use case.

function(form) {
  if (form.getFromParent('immunization').getValue() === 'BCG') {
    form.getFromParent('BCG Number of Immunization').setHidden(false);
  } else {
    form.getFromParent('BCG Number of Immunization').hideAndClear();
  }
}

Related talk thread - Rendering of addmore section or obsgroup is not working as expected when there are form conditions inside it - #3 by angshuonline

Will try it out. Just to be clear do i add this Control Event to the concept set section or to the immunization type dropdown?

Immunization type dropdown.

  1. Open the ‘Form Conditions’ popup.
  2. Select the immunization control from the dropdown menu located in the top right corner.
  3. Write the code in Control Events box for immunization control.
  4. Click ‘Save.’
  5. Click ‘Preview’ and validate the form.

1 Like

Alright. Thanks!