*! version 1.0 2026-04-21 Mark Chatfield

Title

redcapsetup -- perform some checks on the setup of a REDCap database

Example

Change the working directory to where you have stored the setup csv files, then run redcapsetup

. cd "H:/ProjectX/REDCap setup csv files"

. `"redcapsetup"'

Description

redcapsetup performs some checks on the setup of a REDCap database (checks which REDCap does not perform).

The following csv files are required in the working directory:

i) *DataDictionary*.csv

ii) *InstrumentDesignations*.csv ...within the "Project Setup" section, download from "Designate Instruments for My Events"

The following csv files are optional:

iii) fdl_*.csv ...within "Online Designer", download from "Form Display Logic"

iv) asi_*.csv ...within "Online Designer", download all Automated Survey Invitations settings from "Auto Invitation options"

v) *Alerts_*.csv ...download from the "Alerts & Notifications" Application

redcapsetup checks for:

* instances of [obviously-wrong-eventname][variablename]

* instances of [variablename] which might need to be [eventname][variablename]

* references to [non-existent variablename]

* invalid names/correspondence between the key form column & event column in: Form Display Logic, Automated Survey Invitations, Alerts

Detail

redcapsetup extracts contents inside square brackets from the columns of each csv file.
Often this will be a variablename that appears in the Data Dictionary (DD). Sometimes it will be an eventname.
Sometimes it will be a "smart variable".
Note, smart variables (and other contents with a hyphen) are ignored.
Sometimes it may be other things such as units if text like "[kg]" appears in the DD.
The user is told about rows which may be a problem, making it easy for the user to find any problem cell(s) on those rows.

Checks that are not performed

There are many checks on the setup of a REDCap database that redcapsetup does not perform.
For example, checks are not performed to see if
e.g. 'baseline_arm_1' in "if([event-name]='baseline_arm_1')" is an eventname because 'baseline_arm_1' is not in square brackets.
Checks are not performed on inactive Automated Survey Invitations settings or deactivated Alerts.

Author

Mark Chatfield, The University of Queensland, Australia.

m.chatfield@uq.edu.au