How to make a form input data required in Vitals

I am trying to convert the Systolic field to be a mandatory field. The purpose is that if the user inserts Diastolic data, he/she must insert also the Systolic data (I want to prevent sending only one entry). I managed to disable the Systolic field as per the code below. But now I want to follow one of the two scenarios:

Bahmni.ConceptSet.FormConditions.rules = {
    'Diastolic Data' : function (formName, formFieldValues) {
        var systolic = formFieldValues['Systolic'];
        var diastolic = formFieldValues['Diastolic'];
        if (diastolic) {
            return {
                enable: ["Systolic Data"]  
            }
        } else {
            return {
                disable: ["Systolic Data"]
            }
        }
    }
  1. Make Systolic field mandatory field (I don’t know where I can do that) or

  2. Once I enable Systolic Data I want to automatically make it mandatory (I also don’t know how to achieve this even though I’ve tried)

Any idea where or how I can do any of the two options?

Hi @aidjali ,

To make Systolic field mandatory field follow the below steps. Go to the path /bahmni-config/openmrs/apps/clinical/app.json In app.json file add the below code in “conceptSetUI”

“Systolic Data”:{ “required”: true },

Then save the changes and refresh the clinical dashboard to check the Systolic field set to mandatory.

1 Like