Issue
I would like to set up my form template to auto-calculate the age of the patient based on the date of birth we document on the form. This would eliminate the possibility of inaccurate documentation of the client's age in our assessment forms.
Environment
Kipu CRM, Roles: Combined +, Combined (Admissions and B.D.), Super User, VOB Worker, Restricted Admissions Worker | Template Designer
Resolution
- Navigate to CRM > Admissions Management > Template Designer.
- Using the Select an Assessment to Edit field, choose your desired form template.
Important
The form template you will be using must contain a Date of Birth field in order to facilitate the auto-calculation of age for the patient. For guidance on how to create a form template in the CRM, please click here.
- Select the ellipsis icon to view all available field types that can be added to the form.
- Select the Expression (read-only) field to add it to your form template.
- Locate and select the expression field you just added.
- In the General Settings on the right-side panel, update the Name & Title fields accordingly.
Important
Please note, the name field cannot contain any spaces or special characters.
- Next, using the Expression field, input the following expression containing the name assigned to the date of birth field you have present on the form. "age({date of birth field name})"
- In this example, I have to input "age({DOB})"
- In this example, I have to input "age({DOB})"
- Your expression field has been configured to auto-calculate age based on the date of birth documented on the form. For good measure, we recommend testing this expression prior to saving your changes.
- To test your changes, select the preview tab.
- Input a date into the date of birth field.
- Next, click away from the field to trigger the age to calculate.
- Lastly, select Save Changes to preserve your updates to the form.
Cause
Reference this article if you are interested in utilizing the age expression that is available in the Template Designer application.