getCurrentVisitPropertyValue( )

Obtain the property value of a given property name for the current visit. A visit property may be its title, ID or event type.

You use this helper function for a rule to apply and be executed only against a specific visit and so 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.
For more information see Define rule variables.

Syntax

getCurrentVisitPropertyValue('propertyName')

Parameters

Parameter Required/Optional Description
propertyName Required Name of the visit property you want to retrieve. May be any of the following (including quotes is required):
  • 'title'
  • 'visitid'
  • 'eventtype'

Return value

Returns the current visit's given property.

Event type property values can be one of following based on visit design:
  • ScreeningVisit
  • ScheduleAbleVisit
  • SubjectWithdrawalVisit
  • SubjectCompletionVisit
  • UnScheduleAbleVisit
  • Event
  • AdverseEvent

Examples

Example 3-82 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
}