Learn R Programming

redcapAPI (version 2.7.4)

importMappings: Import Instrument Event Mapping

Description

This method allows you to import Instrument-Event Mappings into a project (this corresponds to the 'Designate Instruments for My Events' page in the project).

NOTE: This only works for longitudinal projects.

Usage

importMappings(rcon, data, refresh = TRUE, ...)

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

Arguments

rcon

a redcapConnection object.

data

data.frame with columns arm_num, unique_event_name, and form. See Details

refresh

logical(1). When TRUE, cached mappings in the rcon object are refreshed after the import.

...

Additional arguments to pass to other methods.

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

The arm_num variable will be compared against existing arms in the project (via rcon$arms(). An error is returned if any of the arm numbers are not found in the project.

The unique_event_name must exist in rcon$events(). An error is returned if an value in the data doesn't match.

The values of form must all match a form name in rcon$instruments(). An error is returned if any values provided do not match.