if (FALSE) {
uri <- "https://bbmc.ouhsc.edu/redcap/api/"
token <- "D70F9ACD1EDD6F151C6EA78683944E98" # pid=213
# event <- "" # only for longitudinal projects
(full_name <- base::temp(pattern="instruments-all-records-all", fileext = ".pdf"))
result_1 <- REDCapR::redcap_instrument_download(
file_name = full_name,
redcap_uri = uri,
token = token
)
base::unlink(full_name)
(full_name <- base::tempfile(pattern="instruments-all-record-1-", fileext = ".pdf"))
result_2 <- REDCapR::redcap_instrument_download(
record = 5,
file_name = full_name,
redcap_uri = uri,
token = token
)
base::unlink(full_name)
(full_name <- base::tempfile(pattern="instrument-1-record-1-", fileext=".pdf"))
result_3 <- REDCapR::redcap_instrument_download(
record = 5,
instrument = "health",
file_name = full_name,
redcap_uri = uri,
token = token
)
base::unlink(full_name)
}
Run the code above in your browser using DataLab