- If you have selected formula as your question type, you will enter your formula in the "Formula" field, located in the Scripting and More tab of the eForm Editor.
- Formulas are especially useful in scored forms, where the final score for the form is the sum, average, etc. of the points accrued while the patient is completing the form.
Generating a total score:
For example, if you were using the PHQ-9 questionnaire, you could put all of your questions into a section called "phq9q" and then use the following formula to calculate the sum of all of the scores in that section:
ScriptUtil.sum(phq9Q)
Copy RuleDisplay a formula result:
If you would like to display the value calculated by your formula you can do so by adding "$$" to the "Caption" field (in the General tab). You can also use the "$$" in the "Custom Note" field (in the Note Formatting tab) if you don't want to display the value to the patient but would like to capture it in the patient chart.
More resources:
To learn how to round your formula answers to the nearest digit, please refer to: "Limiting the Number of Decimal Places in Formula Calculations".
For more examples of possible score calculations and more advanced scripting articles, please refer to: