Use case: User needed a tally of how many ER visits a patient has had. See Image A. Solution: Use conditional logic (i.e. an IF/THEN/ELSE statement) by using the function if (CONDITION, value if CONDITION is TRUE, value if CONDITION is FALSE).
5 fields were added for users to enter emergency visit dates. See image A.
- For fields edvisit2 to edvisit5, branching logic was added to show field only if preceding field is not null. For example, show edvisit2 if edvisit1<>"".
- To count how many visits have been recorded, a calculated field was added and an equation using if then statement was written to count how many fields had a visit date. See image B.
- Equation uses the function if([edvisit1]<>'', 1, 0) which reads if the field edvisit1 is not null, then the value is 1, if null, then the value is 0.
- An if then statement is added for each field and then added together to provide a count of how many fields have data. See image C.