if (FALSE) {
uri <- "https://redcap-dev-2.ouhsc.edu/redcap/api/"
# Longitudinal project with one arm
token_1 <- "76B4A71A0158BD34C98F10DA72D5F27C" # "arm-single-longitudinal" test project
REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1)$data
REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_1)$data
# Project with two arms
token_2 <- "DA6F2BB23146BD5A7EA3408C1A44A556" # "longitudinal" test project
REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2)$data
REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2)$data
REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = c("1", "2"))$data
REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = "2")$data
# Classic project (without arms) throws an error
token_3 <- "9A068C425B1341D69E83064A2D273A70" # "simple" test project
REDCapR::redcap_arm_export(redcap_uri=uri, token=token_3)$data
# REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_3)$data
}
Run the code above in your browser using DataLab