Exports the Event-Form Mappings for a Project

Description

Retrieve a data frame giving the events-form mapping for a project.

Usage

1
2
3
4
5
6
7
exportMappings(rcon, arms, ...)

## S3 method for class 'redcapDbConnection'
exportMappings(rcon, arms, ...)

## S3 method for class 'redcapApiConnection'
exportMappings(rcon, arms, ...)

Arguments

rcon

A REDCap connection object as generated by redcapConnection.

arms

A vector of arm numbers that you wish to pull events for (by default, all events are pulled)

...

Arguments to be passed to other methods

Details

The data frame that is returned shows the arm number, unique event name, and forms mapped in a project.

When this function is called for a classic project, a character string is returned giving the API error message, '400: You cannot export form-event mappings for classic projects' but without casting an error in R. This is by design and allows more flexible error checks in certain functions.

Author(s)

Benjamin Nutter

References

Please refer to your institution's API documentation.

Additional details on API parameters are found on the package wiki at https://github.com/nutterb/redcapAPI/wiki/REDCap-API-Parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
> #*** Note: I cannot provide working examples without
> #*** compromising security.  Instead, I will try to
> #*** offer up sample code with the matching results
>
>
> #*** Create the connection object
> rcon <- redcapConnection(url=[YOUR_REDCAP_URL], token=[API_TOKEN])
>
> exportMappings(rcon)
arm_num        unique_event_name                 form_name
1        1            event_1_arm_1              demographics
2        1            event_1_arm_1 all_the_different_options
3        1            event_1_arm_1        uploading_decimals
4        1            event_1_arm_1              calculations
5        1        follow_up_1_arm_1              calculations
6        1        follow_up_2_arm_1              calculations
7        2 experimental_inter_arm_2              demographics
8        2 experimental_inter_arm_2        uploading_decimals
9        2 experimental_follo_arm_2 all_the_different_options
10       2 experimental_follo_arm_2        uploading_decimals
11       2 experimental_follo_arm_2              calculations
12      10          baseline_arm_10              demographics
13      10          baseline_arm_10        uploading_decimals
>
> exportMappings(rcon, 1:2)
arm_num        unique_event_name                 form_name
1        1            event_1_arm_1              demographics
2        1            event_1_arm_1 all_the_different_options
3        1            event_1_arm_1        uploading_decimals
4        1            event_1_arm_1              calculations
5        1        follow_up_1_arm_1              calculations
6        1        follow_up_2_arm_1              calculations
7        2 experimental_inter_arm_2              demographics
8        2 experimental_inter_arm_2        uploading_decimals
9        2 experimental_follo_arm_2 all_the_different_options
10       2 experimental_follo_arm_2        uploading_decimals
11       2 experimental_follo_arm_2              calculations

## End(Not run)