Versions Compared
Version | Old Version 5 | New Version 6 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Description
FormConditions.js is located under bahmni_config/openmrs/apps/clinical. https://github.com/Bahmni/default-config/blob/master/openmrs/apps/clinical/formConditions.js
This configuration will allow enable/disable sections of a form based on some inputs on the form. Some sections of the form that are only filled when a particular set of information is needed. Thus if we disable such fields, this can simplify data entry into the form and make the form much less confusing.
Example
Code Block | ||||
---|---|---|---|---|
| ||||
'DiastolicSystolic Data' : function (formName, formFieldValues) { var systolic = formFieldValues['Systolic']; var diastolic = formFieldValues['Diastolic']; if (systolic || diastolic) { return { enable: ["Posture"] } } else { return { disable: ["Posture"] } } } |
This code snippet will make "Posture" option disable on rendering. Once data is entered for "Systolic" field it will enable "Posture" field.
Note :- '<Concept Full Name>' : function (formName, formFieldValues) { } . This signature is mandatory to implement this functionality.
It will only work with Concept Full Name ex. "Systolic Data", "Systolic" and "Posture".
Tip | ||
---|---|---|
| ||
|