Writing Tablet Rules Based on Form Memory

In order to actually make use of Form Memory, you'll need to refer to it in some manner, usually via the scripting in tablet rules, eForm Actions, eForm item visibility calculations, or formulas. Form Memory is most commonly used by Tablet Rules, for which the following variables are available:

firstTime:
This variable is true when there is no Form Memory of a prior form completion for the current patient (i.e. it's the first time they're completing a form).
daysSinceLastCompleted:
This variable will return the number of days since the form was last completed for the current patient.
For example, you may want to show an Email Consent form every 6 months by using the rule: daysSinceLastCompleted > 180.
If it's the first time the form is shown (i.e. no prior completions), the value is infinity.
lastCompletedTag:
This variable will use the string value stored by the "Remember Tag Expression" in the eForm Editor during the previous form's usage (used for storing of arbitrarily complex sets of values), as described below.
For example, based on the example given in the Remember Tag Expression above, lastCompletedTag.split("|") would return a string array containing the previous form's values stored by Form Memory.

 

Tip: You may find it useful during your testing to add a formula item with caption "lastCompletedTag: $$" and formula "lastCompletedTag". This formula will allow you to see the value of the lastCompletedTag in your test eForm in real time.

 

Retrieving Information from the Same Form Retrieving Information from Other Forms

Suppose you have a form: Form 1.

You want to be able to access a value entered in Form 1 during a previous tablet session. In this situation, you would need to set the various Form Memory fields, as follows:

In Form A, set the "Remember If Expression" to:

true
Copy Rule

Then set the "Remember Tag Expression" to:

theItemRefToRemember.r
Copy Rule

Then, use the following tablet rule to pull up this form again, based on this stored value:

lastCompletedTag == 'N'
Copy Rule
Have more questions? Submit a request