Learn R Programming

redcapAPI (version 2.7.4)

importRepeatingInstrumentsEvents: Import Repeating Instruments and Events Settings

Description

This method allows you to import a list of the repeated instruments and repeating events for a project. This includes their unique instrument name as seen in the second column of the Data Dictionary, as well as each repeating instrument's corresponding custom repeating instrument label. For longitudinal projects, the unique event name is also needed for each repeating instrument. Additionally, repeating events must be submitted as separate items, in which the instrument name will be blank/null to indicate that it is a repeating event (rather than a repeating instrument).

Usage

importRepeatingInstrumentsEvents(rcon, data, ...)

# S3 method for redcapApiConnection importRepeatingInstrumentsEvents( rcon, data, refresh = TRUE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Arguments

rcon

A redcapConnection object.

data

data.frame. For classical projects, it must have the columns form_name and custom_form_label. Longitudinal projects also require a column for event_name.

...

additional arguments to pass to other methods.

refresh

logical(1) If TRUE, the cached value of repeating instruments and events on rcon will be refreshed.

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Details

It should be noted that it is not possible to update the has_repeating_instruments_or_events property of the project through importProjectInformation. Enabling of repeating instruments and events must be done through the GUI.

Although the API does not provide a delete method, it is possible to remove settings by doing an import that excludes the settings you wish to remove. All settings can be cleared by executing importRepeatingInstrumentsEvents(rcon, REDCAP_REPEAT_INSTRUMENT_STRUCTURE).