If you have repeating eForms and visits, you can refer to the different cycles in your Arezzo expressions. You will find the cycling keyword buttons on the Cycling tab in the Expression Builder. See image
Help with cycle numbers of repeating questions...
To specify an absolute cycle number, give the number in brackets after the eForm or visit code.
For example the expression
Treatment(3):Medication(2):MedTime
refers to the MedTime question on the second repeat of the Medication eForm in the third repeat of the Treatment visit.
You can use the keyword first to mean repeat number 1, e.g.
Treatment(first):Medication(2):MedTime
refers to the MedTime question on the second repeat of the Medication eForm in the first repeat of the Treatment visit.
You can also use a numeric expression as a cycle number.
You can also use relative cycle numbers, using the keywords
this
next
previous
last
The cycle number will then depend on where the Arezzo expression is being evaluated.
For example, there could be a validation condition on the MedTime question as follows.
me:value isbefore Treatment(previous):Medication(this):MedTime
This condition is true if the current value is before the MedTime value on the corresponding Medication eForm in the previous Treatment visit.
You can also add or subtract a number from any of the above keywords, for example Treatment(last-1) refers to the last but 1 cycle of the Treatment visit.
You can use the terms
form:cycle
and
visit:cycle
to refer to the cycle number of the current eForm or visit.
For example, you may want to collect certain values only on the second or subsequent repeats of an eForm. To disable a question on the first repeat of an eForm, use a Collect if condition of
form:cycle > 1
If a visit repeats every week, you can use the term visit:cycle as a question derivation to display the number of the week of the current visit.
Note that if you are referring to the current cycle of an eForm within a question specification, it is shorter to use the keyword this, e.g.
Treatment(previous):Medication(form:cycle):MedTime
is the same as
Treatment(previous):Medication(this):MedTime
If using an expression that references a cycling visit, eForm or question, you should always include a cycle specifier (absolute or relative). If you do not, a cycle number of 1 will automatically be used.
For example, if Treatment is a cycling visit, the expression
Treatment:ConMeds:ConMedsYN
will always refer to the ConMedsYN question on the ConMeds eForm in the first Treatment visit.
Using a cycle specifier enables you to specify which cycle is to be used. For example, the expression
Treatment(this):ConMeds:ConMedsYN
will always refer to the ConMedsYN question on the ConMeds eForm in the current Treatment visit.
The terms 'visit' and 'form' can also be used to refer to the current visit or eForm, whatever its code or cycle number. For example, the expression
visit:ConMeds:ConMedsYN
will always refer to the ConMedsYN question on the ConMeds eForm in the current visit, whatever its code and cycle.
To specify a fixed number of cycles for an eForm, first make the eForm a repeating eForm in the schedule, then click on the eForm Plan in the Arezzo Composer and set the 'Number of cycles' task attribute. It is important to set the eForm to be repeating on the visit schedule before setting the number of cycles, otherwise an error will occur when the data entry user attempts to save the eForm.