A visit may have a date and/or time associated with it known as its visit date. You can set up the visit date to be entered by the user or derived. A visit date may have its own format and validation conditions.
In Data Entry, once a visit date has been entered, it appears on the schedule underneath the visit name. If a visit has a user-entered date defined, no eForm within the visit can be saved without a valid visit date.
A visit date is specified as being the eForm date of a special eForm in the visit, known as the 'visit eForm'.
To create or edit a visit date, you need the 'Maintain visit' permission
Create a new eForm.
Create an eForm date question and place it on the new eForm.
In the study schedule, click to add the eForm to the visit.
Right click on the eForm icon and select Set as Visit eForm from the popup menu.
The visit eForm is displayed with a calendar icon. See image This eForm will not be displayed in the schedule in Data Entry, but its eForm date will be represented by an edit field in the header of every eForm in the visit.
![]()
If a user-entered visit date has been defined (i.e. the date question is not derived), no eForm in the visit can be saved without a valid visit date; if no date has been entered and the user tries to save the eForm, a message will be displayed saying that the visit date is missing.
Only one eForm in a visit may be set as the visit eForm.
A visit eForm does not appear in the visit in the Data Entry schedule.
Visit eForms may contain questions other than the eForm date question, but these questions will never be displayed to the data entry user. However, if the visit eForm contains derived questions, these will be calculated as normal, and can be viewed in the Data Browser.
The value of a visit date (and any other questions on the visit eForm) may be viewed in the Data Browser.
You can use the same eForm as a visit eForm in one visit, and as a”normal” eForm in another visit. In the Data Entry schedule this eForm will not appear in the visit for which it is a visit eForm, but it will appear in other visits.
You should not place any Arezzo preconditions, internal triggers or scheduling constraints on a Visit eForm. The data is used in the background so it needs to be available at all times.
If a visit is frozen, the visit eForm will also be frozen and can only be unfrozen by unfreezing the entire visit and not by unfreezing the eForm itself. If an individual eForm in a frozen visit is unfrozen, the visit will become unfrozen but the visit eForm will remain frozen. To unfreeze the visit eForm, the visit must be frozen and then unfrozen.
If more than one user is editing the same subject, only one of them can edit the visit date. If another user opens an eForm within the same visit, the visit date will be displayed in a read-only field for the second user.
If you have a visit eForm that is used in all visits, you can fire a warning on the visit date if it's before the previous visit (or within a certain time interval). If you have visits V1, V2, V3 and V4 (which are not repeating), and one visit date question q_vdate on eForm f_vdate which is used in all visits, the warning condition to check for a later visit date would be as follows:
(visit = 'V2' and me:value isbefore V1:f_vdate:q_vdate) or (visit = 'V3' and me:value isbefore V2:f_vdate:q_vdate) or (visit = 'V4' and me:value isbefore V3:f_vdate:q_vdate)
If, for example, you want there to be at least 10 days between visits 1 and 2, 12 days between visits 2 and 3, and 15 days between visits 3 and 4, the warning condition would be:
(visit = 'V2' and me:value isbefore V1:f_vdate:q_vdate + 10 days) or (visit = 'V3' and me:value isbefore V2:f_vdate:q_vdate+ 12 days)) or (visit = 'V4' and me:value isbefore V3:f_vdate:q_vdate + 15 days))
If, for example, visit V3 is a repeating visit, you can replace the condition for V3 with:
(visit = 'V3' and ( (visit:cycle = 1 and me:value isbefore V2:f_vdate:q_vdate) or (me:value isbefore visit(previous):f_vdate:q_vdate) ) )
Note that visit(previous) can only be used for repeating visits.
You may wish to set up a comparison between visit dates, for example to check that a visit is ocurring at a certain interval after the previous one. The approach to this differs depending on whether the visits are repeating or non-repeating.
In this example, assume that the study definition has 4 visits (Screening, Baseline, Treatment and Followup) with a visit eForm in each visit called VEF and a visit date question called VDate.
To check that each visit date is after the previous one, add the following three validations to the VDate question. Each uses the Arezzo "visit" keyword which represents the current visit.
|
Validation |
Validation Message |
|
visit = 'Baseline' and me:value isbefore Screening:VEF:VDate |
Visit date must be later than the Screening visit date |
|
visit = 'Treatment' and me:value isbefore Baseline:VEF:VDate |
Visit date must be later than the Baseline visit date |
|
visit = 'Followup' and me:value isbefore Treatment:VEF:VDate |
Visit date must be later than the Treatment visit date |
You could also add a validation for the first visit date, e.g. to check that it is after a fixed date:
visit = 'Screening' and me:value isbefore date(2012,1,1) 'Screening visit date must not be earlier than 1st January 2012'
Alternatively, the three validations can be merged into a single validation:
(visit = 'Baseline' and me:value isbefore Screening:VEF:VDate) OR (visit = 'Treatment' and me:value isbefore Baseline:VEF:VDate) OR (visit = 'Followup' and me:value isbefore Treatment:VEF:VDate)
with a validation message of:
'Visit date must be after previous visit date'
If you want to include the actual value of the previous visit date in the validation message, it could be done using the Arezzo format_date function:
'Visit date must be after previous visit date: ' & format_date(case((visit = 'Baseline', Screening:VEF:VDate), (visit = 'Treatment', Baseline:VEF:VDate), (visit = 'Followup', Treatment:VEF:VDate)), 'dd/mm/yyyy')
You can also create a validation to check that a visit is within a certain time interval from the previous visit. For example, to fire a warning if the Baseline visit is not within 5 days of the Screening visit, use the following validation:
visit = 'Baseline' AND (me:value isbefore Screening:VEF:VDate OR me:value isafter Screening:VEF:VDate + 5 days)
with a validation message of:
'Visit date must be within 5 days after Screening date: ' & format_date(Screening:VEF:VDate, 'dd/mm/yyyy')
Again, this can be created as a separate validation or combined with other validations using OR.
If a visit is repeating (cycling), the Arezzo terms previous and visit:cycle can be used.
On the first cycle, you need to check that the visit date is after the Baseline visit date. On subsequent cycles, you need to check that the visit date is after the previous Treatment visit date. For the first cycle, the Arezzo term visit:cycle is 1. The validation condition would be as follows:
visit = 'Treatment' AND ((visit:cycle = 1 and me:value isbefore Baseline:VEF:VDate) OR (me:value isbefore visit(previous):VEF:VDate))
Note once again the use of the "visit" keyword, which denotes "the current visit".
To check that the Followup visit is after the last Treatment visit, the validation would be as follows:
visit = 'Followup' and me:value isbefore Treatment(last):VEF:VDate
However, if the Treatment visit is infinitely cycling, there may be an "empty" visit as the "last" visit, so a check can be made to see if the "last" visit has a known date. If not, the next-to-last visit date can be referred to (using the relative cycle specifier expression last – 1).
visit = 'Followup' and me:value isbefore if(isknown(Treatment(last):VEF:VDate), Treatment(last):VEF:VDate, Treatment(last-1):VEF:VDate )