Learn R Programming

redcapAPI (version 2.8.0)

exportPdf: Export PDF file of Data Collection Instruments

Description

These methods allow the user to download PDF files of data collection instruments. The download may be with or without collected data; and may return a single record, multiple records, or all records.

Usage

exportPdf(
  rcon,
  dir,
  filename = "redcap_forms_download",
  record = NULL,
  events = NULL,
  instruments = NULL,
  all_records = FALSE,
  ...
)

# S3 method for redcapApiConnection exportPdf( rcon, dir, filename = "redcap_forms_download", record = NULL, events = NULL, instruments = NULL, all_records = FALSE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

exportPdf has no return. After saving the file to the local computer, a message is displayed providing the location of the file on the system.

Arguments

rcon

A redcapConnection object.

dir

character(1). The directory into which the file should be saved.

filename

character(1). The base of the file name. When record = NULL, it will be appended with "_blank.pdf". When record has a value, it will be appended with "_record_[record id].pdf"

record

character(1), integerish(1), or NULL. The record id for which forms should be downloaded.

events

character. The events for which forms should be downloaded

instruments

character. The instruments for which forms should be downloaded

all_records

logical(1). When TRUE forms for all records are downloaded. When TRUE, this overrides the records argument.

...

Arguments to pass to other methods

error_handling

character(1). One of c("error", "null"). An option for how to handle errors returned by the API. see redcapError().

config

A named list. Additional configuration parameters to pass to httr::POST(). These are appended to any parameters in rcon$config.

api_param

A named 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

These methods mimics the behavior of "Download PDF of Instruments" button on the REDCap user interface. They permit the user to export a PDF file for:

  1. A single collection instrument (blank)c

  2. All instruments (blank)

  3. A single instrument (with data from a single record)c

  4. All instruments (with data from a single record)

  5. All instruments (with data from all records)

See Also

exportMetaData(),
importMetaData(),
exportFieldNames(),
exportInstruments(),
exportMappings(),
importMappings()