This topic describes how you can use the any, every, oneof and includes set operators in Arezzo.
The any and every operators can be used to test a set of responses to a many-valued question, such as a question in a repeating question group, or a question on a repeating eForm or a question on an eForm in a repeating visit.
For example, the condition
any( MedName ) = 'Aspirin'
is true if any of the responses for the MedName question on the current eForm is 'Aspirin'.
The condition
every( Baseline:Lesions:LesionX ) < 1.0
is true if every response for the question LesionX on the specified Lesions eForm is less than 1.0.
The oneof and includes operators can be used to test set membership.
For example, the condition
me:value oneof [9,15,20]
is true if the current question value is either 9, 15 or 20, and is equivalent to
me:value = 9 or me:value = 15 or me:value = 20
The condition
RelSite includes 'Lung'
is true if any of the responses to RelSite is 'Lung', and is equivalent to
any( RelSite ) = 'Lung'
and is similarly equivalent to
'Lung' oneof RelSite
Here is the list of the ways in which you can use any and every in Arezzo conditions.
any( Question ) = Expr |
every( Question ) = Expr |
any( Question ) > Expr |
every( Question ) > Expr |
any( Question ) < Expr |
every( Question ) < Expr |
any( Question ) >= Expr |
every( Question ) >= Expr |
any( Question ) =< Expr |
every( Question ) =< Expr |
any( Question ) isafter Expr |
every( Question ) isafter Expr |
any( Question ) isbefore Expr |
every( Question ) isbefore Expr |
The Question name may be either a local question name, or a compound name of the form V:F:Q, representing the set of all values for that question. For this to be useful, the question should have multiple values, i.e. it is a repeating question, or it is a question on a repeating eForm.
The Expr is an Arezzo expression which does not use any or every.
The arithmetic comparisons are only appropriate for numeric questions and expressions, and the isbefore and isafter comparisons are only appropriate for date/time questions and expressions.
If you use any and every on non-repeating questions, the set of responses referred to will contain just one value.
When using any and every, they must always appear to the left of the operator.
For example, any(V1:F1:Q1) = me:value works but me:value = any(V1:F1:Q1) does not.
It is not possible to use any or every to check for duplicate values in a repeating question. For example, the following validation for question Q1 in a repeating question group will fire if the currently entered value is the same as any other entered value for Q1:
any(Q1) = me:value
However, although the validation may not fire the first time a unique value for Q1 is entered, as soon as that value is saved, the validation will always fire (e.g. on saving or re-opening the eForm) because the set of values of Q1 now contains that value. Unfortunately Arezzo does not provide a way to check for duplicates in repeating questions.
Here is the list of the ways in which you can use oneof and includes.
Question includes Expr |
Set includes Expr |
Expr oneof Question |
Expr oneof Set |
The Question name may be either a local question name, or a compound name of the form V:F:Q, representing the set of all values for that question. As before, this question should be a repeating question, or a question on a repeating eForm.
The Set should be a list of values or Arezzo expressions, enclosed in square brackets and separated by commas.
The Expr is an Arezzo expression which does not use any or every.
Note that the following three conditions are all equivalent to each other:
Value oneof Question
any(Question) = Value
Question includes Value
Condition |
Meaning |
any( TreatCont ) = 1 |
If TreatCont is a repeating question on the current eForm, this condition is true if any of its values is 1. |
any( Treat:Vital:Pulse ) > 90 |
If Pulse is a repeating question on the Vital eForm, or if Vital is a repeating eForm in the Treat visit, this condition is true if any of the Pulse values is greater than 90. |
AE:AEEvent:AECode includes 'ae005' |
If AEEvent is a cycling eForm, this condition is true if any of the AECode responses is ae005. |
any( AE:AEEvent:AECode ) = 'ae005' |
Equivalent to the previous example. |
'ae005' oneof AE:AEEvent:AECode |
Equivalent to the previous two examples. |
every( Pulse ) =< max( V1:F1:Pulse ) |
If Pulse is a repeating question on the current eForm, this condition is true if every Pulse value is less than or equal to the maximum value of the Pulse questions on the F1 eForm in the V1 visit. |
every( BPS ) >= visit:form(previous):MinBPS |
If BPS is a repeating question on the current repeating eForm, this condition is true if every BPS value is greater than or equal to the MinBPS value on the previous cycle of this form. |
me:value oneof MedName |
If MedName is a repeating question on the current eForm, this condition is true if the current question value is equal to one of the values of MedName. |
me:value oneof [2,4,7] |
This condition is true if the current question has the value 2 or 4 or 7. |
me:value oneof Personal:Family:SibName |
This condition is true if the current question value is equal to one of the values of the question SibName on the Family eForm in the Personal visit. |
person:trialsite oneof ['rome', 'paris', 'athens', 'lisbon'] |
This condition is true if the site code of the current subject is one of the listed values. |
any( Treat:ConMeds:StartDate ) isbefore Reg:RegForm:RegDate |
This condition is true if any of the StartDate values on the ConMeds eForm is earlier than the RegDate value on the RegForm eForm. |
Be aware that if you refer to a set of question values within a condition, and one or more of the question values is unknown, the condition will always be false. For example, the condition
q4 oneof [ q1, q2, q3 ]
will only be true if all the questions q1, q2 and q3 have values and q4 matches one of them. If any of q1, q2 or q3 are unknown, the condition will always be false.