Learn R Programming

redcapAPI (version 2.10.0)

exportProjectXml: Export Entire Project as REDCap XML File

Description

These methods enable the user to export a project's settings as an XML file in CDISC ODM format. This file may be used to transfer the project to another project, REDCap instance, or any other CDISC ODM compliant database.

Usage

exportProjectXml(
  rcon,
  file,
  return_metadata_only = TRUE,
  records = NULL,
  fields = NULL,
  events = NULL,
  survey = FALSE,
  dag = FALSE,
  export_files = FALSE,
  ...
)

# S3 method for redcapApiConnection exportProjectXml( rcon, file, return_metadata_only = TRUE, records = NULL, fields = NULL, events = NULL, survey = FALSE, dag = FALSE, export_files = FALSE, ... )

Arguments

rcon

A redcapConnection object.

file

character(1) The file to which the XML export will be saved.

return_metadata_only

logical(1). When TRUE (default) only meta data values are returned. When FALSE, project records data are also exported.

records

character or integerish. A vector of study id's to be returned. When NULL, all subjects are returned.

fields

character. Vector of fields to be returned. When NULL, all fields are returned (unless forms is specified).

events

A character. Vector of events to be returned from a longitudinal database. When NULL, all events are returned.

survey

logical(1). When TRUE the survey identifier fields (e.g., redcap_survey_identifier) or survey timestamp fields (e.g., [form_name]_timestamp) will be included in the export when surveys are utilized in the project.

dag

logical(1). When TRUE the redcap_data_access_group field is exported when data access groups are utilized in the project.

export_files

logical(1). When TRUE will cause the XML returned to include all files uploaded for File Upload and Signature fields for all records in the project. Setting this option to TRUE can make the export very large and may prevent it from completing if the project contains many files or very large files.

...

Arguments to pass to other methods

Details

The entire project (all records, events, arms, instruments, fields, and project attributes) can be downloaded as a single XML file, which is in CDISC ODM format (ODM version 1.3.1). This XML file can be used to create a clone of the project (including its data, optionally) on this REDCap server or on another REDCap server (it can be uploaded on the Create New Project page). Because it is in CDISC ODM format, it can also be used to import the project into another ODM-compatible system.

When the return_metadata_only parameter is set to FALSE, the Data Export user rights will be applied to any data returned. For example, if the user has 'De-Identified' or 'Remove All Identifier Fields' data export rights, then some data fields might be removed and filtered out of the data set. To make sure that no data is unnecessarily filtered out of the API request, the user should have 'Full Data Set' export rights in the project.

See Also

createRedcapProject()

Examples

Run this code
if (FALSE) {
unlockREDCap(connections = c(rcon = "token_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
xml_file <- tempfile(file.ext = ".xml")
exportProjectXml(rcon, 
                 file = xml_file)
}

  
  

Run the code above in your browser using DataLab