exportPdf: Export PDF file of Data Collection Instruments (either as...

Description Usage Arguments Details Value REDCap API Documentation REDCap Version Known REDCap Limitations Author(s)

View source: R/exportPDF.R

Description

This function allows you 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

 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
exportPdf(
  rcon,
  dir,
  filename = "redcap_forms_download",
  record = NULL,
  events = NULL,
  instruments = NULL,
  all_records = FALSE,
  ...
)

## S3 method for class 'redcapDbConnection'
exportPdf(
  rcon,
  dir,
  filename = "redcap_forms_download",
  record = NULL,
  events = NULL,
  instruments = NULL,
  all_records = FALSE,
  ...
)

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

Arguments

rcon

A REDCap connection object as generated by redcapConnection.

dir

The directory into which the file should be saved.

filename

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

record

The record id for which forms should be downloaded. May only have length 1.

events

The events for which forms should be downloaded

instruments

The instruments for which forms should be downloaded

all_records

Logical. If TRUE forms for all records are downloaded. When TRUE, this overrides the records argument.

...

Arguments to be passed to other methods.

error_handling

An option for how to handle errors returned by the API. see redcap_error

Details

This function mimics the behavior of "Download PDF of Instruments" button on the REDCap user interface.

Value

Creates a PDF file that is saved to the directory specified by the user.

REDCap API Documentation

This function allows you to export a PDF file for any of the following: 1) a single data collection instrument (blank), 2) all instruments (blank), 3) a single instrument (with data from a single record), 4) all instruments (with data from a single record), or 5) all instruments (with data from ALL records). This is the exact same PDF file that is downloadable from a project's data entry form in the web interface, and additionally, the user's privileges with regard to data exports will be applied here just like they are when downloading the PDF in the web interface (e.g., if they have de-identified data export rights, then it will remove data from certain fields in the PDF). If the user has "No Access" data export rights, they will not be able to use this method, and an error will be returned.

REDCap Version

6.5.0+

Known REDCap Limitations

None

Author(s)

Benjamin Nutter


redcapAPI documentation built on Feb. 18, 2020, 1:09 a.m.