General Information
- Dependencies are created using JavaScript. Â Dependencies within a variable group/form are entered on the Dependencies tab of the Variable Group Update page
- Dependencies across encounter variable groups are entered on the Interval Expression tab of the Interval Update page
- Dependencies across project variable groups are entered on the Update Project Expression page accessed from the Edit Expression toolbar button on the Project Overview page
- Universal and Project variables can be directly referenced in an encounter variable group's dependency
- Universal variables can be directly referenced in a project variable group's dependency
- Variables are referenced by prefacing the variable's code with a #
- Methods available in StudyTRAX:
- .enable()
- .disable()
- .show()
- .hide()
- age(#birth)
- ageAsOf(#birth, #diagnosis_date)
- calculateBmi(true, #height_cm, #weight_kg)
- calculateBMI(false, #height_in, #weight_lbs)
- roundValue(value, numberOfDecimalPlaces)
- Additional methods that can be used in an Interval Expression or Project Expression:
- .showVariableGroup()
- .hideVariableGroup()
 Examples:
Syntax |
Meaning |
---|---|
#var2.enable(#var1 >= 5); |
Enable data entry into "var2"Â if the value of "var1" is greater than or equal to 5 |
#var4.show(#var3 < 5); |
Show "var4" if the value of "var3" is less than 5 |
#myVar.showVariableGroup(#sex==1); |
Show the variable group that contains variable code "myVar" is the subject's sex is a female (where female is a value of 1) |
Add a dependency into a variable group
- From the Project Overview page, select the Variable Groups tab
- Click on the name of a variable group to navigate to the Variable Group Update page
- Select the Dependencies tab
- Enter JavaScript in the User Defined Functions section
- The JavaScript can be directly typed in the User Defined Functions section
- Select the Expression Tool in the toolbar
Project Variables can be directly referenced in an Encounter Variable Group's Dependency
Add a dependency across encounter variable groups or specific to an interval
- From the Project Overview page, select the Intervals tab
- Click on the name of the interval into which the dependency is to be added
- Select the Interval Expression tab
- Enter JavaScript in the User Defined Functions section
Add a dependency across project variable groups
- From the Project Overview page, select Edit Expression in the toolbar
- Enter JavaScript in the User Defined Functions section