getCurrentVisitPropertyValue( )

Control rule behavior on different visits. For instance, if a rule is created on a question in a form, and that form is associated with multiple visits, you can raise a query only on certain visits in a study, not all visits.

By default, a rule is executed against every visit in the study that contains the form. When declaring variables, for the visit field:
  • If you leave -All Visits- in the visits field, the variable data will be retrieved from the form in current visit where rule is being run.
  • If you select a specific visit, for example the Screening visit, the variable data will be retrieved from the form in the specified visit, in this case the Screening visit, for every visit where the rule is executed.
You use this helper function for a rule to apply and be executed only against a specific visit.

Syntax

getCurrentVisitPropertyValue('propertyName')

Parameters

propertyName

propertyName in single quotes. propertyName could be any of the following:

  • title
  • visit ID
  • event type

eventtype values can be one of following based on visit Design time: ScreeningVisit, ScheduleAbleVisit, SubjectWithdrawalVisit, SubjectCompletionVisit, UnScheduleAbleVisit, Event, AdverseEvent.

Return value

Returns the current visit property.

Example 3-80 Fetch the property value of the provided property of the current visit

// Returns (short-name) the current visit property 'visitid':
return getCurrentVisitPropertyValue('visitid')
  
// Returns (name) the current visit property 'title':
return getCurrentVisitPropertyValue('title')
 
// Returns event-type of the visit - will be one of the following "ScreeningVisit","ScheduleAbleVisit","SubjectWithdrawalVisit","SubjectCompletionVisit","UnScheduleAbleVisit","Event","AdverseEvent"
return getCurrentVisitPropertyValue('eventtype')
 
 
// Example to demonstrate functionality based on current visit
if(getCurrentVisitPropertyValue ("visitid")==='visit1'){
    //add visit1 functionality here
}
else if(getCurrentVisitPropertyValue ("visitid")==='visit2'){
    //add visit2 functionality here
}
else{
    //else functionality
}