redcap design 2
TRANSCRIPT
REDCap Design 2
© May 2020 – Heather Lansky. This work is licensed under a Creative Commons Attribution 3.0 Unported License.
REDCap version 9.1.18
Agenda
Piping
Branching Logic
Calculated Fields
Action Tags
Automated Survey Invitations + Survey Queue
Longitudinal Data Collection (events + assigning instruments)
Repeating Instruments
Arms
Randomization
Importing Data
Building a form in Excel
Production Changes
Insert (or “pipe”) previously collected data into text on a data collection form or survey
Can customize survey invitations (e.g., include respondent's name in the email) or survey completion text (e.g., thank respondent by name after completing a survey)
Data can be piped from any field type except File Upload
Piping
Syntax is variable name surrounded by square brackets [variable]
Piping in Survey Invitation Piping in Question Text
“Branches” a question from another question based on logic
Click the “branch” icon on the question you want to controlYou are “branching” this question from something else
Branching Logic
Default is Advanced Suggest to use Drag-n-Drop
until you are familiar with syntax
Find the variable you want to branch from
Drag it to the Show window If adding more than one
condition, set the ALL or ANY
Branching logic will appear beside variable name
REDCap has the ability to make real-time calculations on data entry forms.However, this field type should NOT be extensively utilized:
• Calculations can only return numeric values• Don’t use [today] because equation is re-calculated each time the form is saved• If changes are made to the equation, all data must be refreshed for each record
TIP: Use Data Quality Rule H to fix broken calculations
Should only be used when necessary to know the calculated value while on that page or the following pages, or when the result of the calculation affects data entry workflow.
Calculations should be considered a tool not dataResults always should be re-calculated during analysis
Calculated Fields
Field Label
Variable Name (incl. units)
Calculation equation
Noteuppercase M = monthslowercase m = minutes
11
22
3
3
"y" years 1 year = 365.2425 days
"M" months 1 month = 30.44 days
"d" days
"h" hours
"m" minutes
"s" seconds
"ymd" Y-M-D (default)
"mdy" M-D-Y
"dmy" D-M-Y
Type of calculation Function
round(number,decimal places) Round
roundup(number,decimal places) Round Up
rounddown(number,decimal places) Round Down
sqrt(number) Square Root
(number)^(exponent) Exponents
abs(number) Absolute Value
min(number,number,...) Minimum
max(number,number,...) Maximum
mean(number,number,...) Mean
median(number,number,...) Median
sum(number,number,...) Sum
stdev(number,number,...) Standard Deviation
datediff([date1], [date2], "units", "dateformat", returnSignedValue)
datediff([dob],[date_enrolled],"d")
datediff([dob],"05-31-2007","h","mdy",true)
Units
Date Formats
Difference Between Dates
Tips for Calculated Fields• Unless you are calculating from a required field, use the syntax:
sum([answer1],[answer2], ... [answerN])[answer1] + [answer_2] will not calculate if one of the fields is empty/blank/null
• If you have multiple calculations on a formOrder of execution determined by alphabetical order of its associated variable/field name:• Calculation 1 [weight_met] =[weight]*.45359237• Calculation 2 [BMI]=[weight_met]/([height]^2)
Calculation 2 will occur before calculation 1!
3 possible solutions1. Calculate BMI outside of REDCap and enter value into text field (Best Solution)
• TIP: Use a Project Bookmark to a BMI Calculator2. Calculate BMI in one step3. Rename variable to change order
Customize data entry on surveys and forms Always begins with @ symbol Entered in the Action Tag/Field Annotation section of Edit Variable May use more than one type at a time, separate by a space or line break
Action Tags
ACTION TAG PURPOSE@DEFAULT@DEFAULT=“0”
Sets a field's initial value. This allows a field to have a specified default value when viewing the field on a survey or data entry form that has not yet had any data saved for it
@TODAY Loads the current user's date into a blank Text field
@NOW Loads the current user's date+time into a blank Text field -similar to @TODAY tag but also includes the time
@HIDECHOICE@HIDECHOICE=“1”
Hides one or more choices of a multiple choice field
@HIDDEN-FORM Hides the field on a data entry form (but visible in survey mode)
@HIDDEN-SURVEY Hides the field on a survey (but visible in data entry mode)
A few examples …
ACTION TAG PURPOSE
@MAXCHOICE@MAXCHOICE(1=50)For longitudinal projects, when counting the number of choices saved for records, it will treat all events as separate, meaning that in the example above, choice '0' can have a max number of 50 selections in EACH event in the project.
Disables one or more specified choices (i.e., displayed but not usable) for checkbox, radio button, or drop-down field after a specified amount of records have been saved with that choice
@MAXCHECKED@MAXCHECKED=3
Sets a max number of boxes that can be checked
@NONEOFTHEABOVE@NONEOFTHEABOVE=98NOTE: This action tag can only be used with Checkbox fields.
Designates a checkbox choice as 'none of the above', ensuring no other choices are checked when selected
@CHARLIMIT@CHARLIMIT=280NOTE: Not applied in data imports
Sets max number of characters for a Text/Notes field, and displays the number of characters remaining
@WORDLIMIT@WORDLIMIT=250Cannot be used at the same time as CHARLIMIT
Sets max number of words for a Text/Notes field, and also displays the number of words remaining
Typically used when survey is not the first instrument (generally that is public link)
Can be set up for each event in a longitudinal project
Can contain logic/conditions and condition check
Can enable reminders
Can send from email other than your own, if a secondary email is set up in your profile
Automated Survey Invitations
From Online Designer Tab Automated Invitations Choose Event (if applicable)
1. Select From2. Enter Subject3. Enter email body
(with optional piping)
4. Set Condition(s)(optional evaluate logic)
5. Choose time6. Optional enable reminders
7. Activate
8. Save
Then TEST to make sure it works
1
2
3
4
5
6
7
8
Lines up several surveys in a “to do” list for participants
Can optionally auto start one after the next
Can contain logic/conditions
Be careful of conflicts with Survey Set Up Auto-continue
From Online Designer Click Survey Queue
Survey Queue
1. Click Activate for each2. Set Logic
3. Optional Auto Start
1. Enable Longitudinal data collection
2. Define My Events
3. Edit Events
Event 1 is set up by default
Longitudinal Data Collection – Define Events
Pencil icon to editChange nameClick Save
Enter another Event NameClick Add new event to add more
If there is a temporal relationship between visits, consider using Scheduling Module
Use Days Offset for scheduleAlways counted from first event
Once Events are Defined, Select which Instruments at which Events
Disregard what is checked by defaultClick Begin Editing
Check boxes corresponding to Event(s)Click Save
If you add instruments after setting this up, be sure to go back and select event(s) for the new instruments – it is not done by default
Longitudinal Data Collection – Assign Instruments
Allows an instrument to be repeated multiple times Can be done in both classic and longitudinal projects Can repeat just the instrument, or the entire event
Enable repeatable instruments and events
Repeating Instruments
Repeating in a Longitudinal ProjectSelect Event and instrument you want to repeatChoose Entire Event or Independent
If Independent, choose form(s)
Repeating in a Classic ProjectSelect instrument you want to repeat
Setting a Custom Label for Repeating InstrumentsInsert variable(s) to be used as a label on each instance of the form
Separate multiples by comma and space
In Record Status DashboardClick on the group of formsPreview of each repeating form with label(s) you set up
Creates separate participant groups (e.g., treatment vs. control) Can be used in multi-site studies to separate sites Screening Arm plus Enrollment Arm Use of arms requires a longitudinal project type (even if data aren’t longitudinal)
Click on Define My Events*not* intuitive!!
Arms
Each project has one arm by default
Click Rename Arm 1Enter a nameClick Save
Click +Add New Arm to create anotherEnter a nameClick Save
If you set up your Events before you created Arms, you will have to define Events again for the additional arm(s)
Go back through the processCreate the Event(s)Designate Instrument(s) for each event
All events don’t have to be the sameBUT first event should be and have the same first form (recall that Record ID is created there)
• The randomization module allows participants to be randomized based on one or more strata
• Randomization enabled at project set up, should not be done once a project is in production
• Best practice to have randomization field(s) in a single, separate form • Should have an allocation table for development and one for production• It is HIGHLY recommended to use the development table and TEST it
thoroughly before randomizing real participants• Allocation tables cannot be changed once a project is in production
You should work with a statistician to generate the allocation tables
Randomization
Enable the Randomization module
Set up randomization
Select strataRandomize by site (if needed)Choose randomization field
This is a good time to consult with a statistician
Download a template for ideas
It is NOT recommended to use the templates “as-is” -- they are just examples
A statistician or someone with previous experience with randomization should build the allocation tables
Upload a development table
TEST! TEST! TEST!
Erase and re-do the randomization model as necessary until you get it right BEFORE moving to production
• Make a separate Randomization form to house the randomization variable(s)
• Add a field to capture the date of randomization
• Add branching logic so that randomization cannot occur until consent is documented and inclusion/exclusion criteria are satisfied
• Include more assignments in your allocation table than you think you will need (to accommodate possible drop-out and drop-in of subjects)
• Record names (e.g., study ID) should NOT be included as a column in the allocation table
Tips for Randomization
Existing data can be imported using the Import Tool
Data must be formatted as CSV file type
The import file must match the template of the REDCap forms
Accessed from the left-hand menu
Importing Data
Download the Data Import TemplateImporting with records in rows is most common
Enter/copy data into a copy of the template (keep a “clean” copy of template)
Required fields: record_id, redcap_event_name
If repeatable, need redcap_repeat_instrument and redcap_repeat_instanceInstrument names can be found in Codebook
Return to REDCap, Data Import
Navigate to fileThen upload
Data will be overwritten
Tips for Importing Data Create a codebook, you will need the instrument names and field values
Make a copy of original source data, work in the copy
Work in XLS format, save to CSV when ready
Beware of UTF-8 encoding for non-Latin characters
When importing data for multiple visits, try uploading one visit at a time
Break large imports into smaller pieces, form-by-form if necessary
For ongoing imports, may be helpful to make a template with color-coding
Required fields 1st Instrument 2nd Instrument
Building a Form in Excel (Data Dictionary)
REDCap exports the Data Dictionary in CSV formatSuggest to Save As in Excel (XLS) format before you begin
From Excel 1. Select File Menu2. Save As
Choose the folder where you will save the file (make same as where CSV file is saved)
Give the file a new name, e.g., “projectname_changes”Set Save As Type to Excel Workbook (*.xls)
Data Dictionary Looks Like This
Once done with making changes/designing, save and then Save As again in CSV
Testing
Test Automated Survey Invitations, send it to yourself Test branching logic, every possible scenario If longitudinal – ensure all forms are assigned to ≥ one event Data entered during testing are deleted when project is
moved into production
• Click Enter Draft Mode• Select form• Make changes• Changes are saved “as
you go” but do not take effect until approved
Making Changes After Production
Submit Changes for Approval
• Once finished making changes, click Submit Changes for Review• Changes must be approved before they become active
Some changes are automatically approved:• Typos or wording changes to field labels• Adding choices to multiple-choice variables• Changes that don’t result in data loss or corruption
If not aren’t automatically approved, you’ll need to wait for admin review.
What the REDCap Administrator Sees
Help and FAQHelp & FAQ and Video Tutorials are available from the bottom left menu and also on many of the individual pages
https://u.osu.edu/redcap/
Getting an account – New User Request / Background Check
Request a new REDCap project (http://go.osu.edu/newprojectrequest
REDCap URLS (PHI and NonPHI)
View training schedule and registration links
IRB Boilerplate, Citing REDCap in publications
Schedule a consultation
FAQ, Troubleshooting, “How do I?”
REDCap Blog
Thank You