Skip to contents

This function is designed to upload changes from a locally modified project object to REDCap. It should be run after using project_import <- read_from_REDCap_upload(project). The function compares the imported data (project_import) to the existing data in project and only uploads new or changed data. It will not directly delete any data.

This function has the potential to modify your data, so it should be used cautiously. Any changes made through this function will be logged in the REDCap log.

Usage

upload_project_to_REDCap(
  project,
  batch_size = 500,
  ask = TRUE,
  view_old = TRUE,
  n_row_view = 20
)

Arguments

project

A validated project object containing REDCap project data and settings. Generated using load_project or setup_project

batch_size

Numeric. The number of records to upload in each batch. Default is 500.

ask

Logical. If TRUE, the function will prompt you to preview the data that will be uploaded before proceeding. Defaults to TRUE.

view_old

Logical. If TRUE, the function will show a preview of the old records before upload. Defaults to TRUE.

n_row_view

Numeric. The number of rows to display when previewing old data. Default is 20.

Value

A series of messages indicating the progress and status of the upload.

Details

This function uploads changes to a REDCap project, based on the differences between the locally imported data (project_import) and the existing data (project). It uploads changes in batches as specified by batch_size and allows you to preview the changes before the upload if ask is set to TRUE. It will not delete any data from REDCap, and it is intended to only upload new or modified records. This function should be used with caution. Any changes during the upload will be logged in the REDCap system log.