From 02b073f51711cc1a0302788546586862ebf59e4b Mon Sep 17 00:00:00 2001 From: Blair Cooper Date: Fri, 21 Jul 2023 12:14:41 -0700 Subject: [PATCH] Remove repeat_instrument param from redcap_file_download_oneshot fixes: 506 The REDCap does not have a repeat_instrument parameter on the file/export API. The test that was present in the code would prevent the repeat_instance parameter for having any effect unless the repeat_instrument parameter was also set. --- R/redcap-file-download-oneshot.R | 12 +----------- man/redcap_file_download_oneshot.Rd | 5 ----- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/R/redcap-file-download-oneshot.R b/R/redcap-file-download-oneshot.R index 77b58d42..253dc3c9 100644 --- a/R/redcap-file-download-oneshot.R +++ b/R/redcap-file-download-oneshot.R @@ -26,9 +26,6 @@ #' Required #' @param event The name of the event where the file is saved in REDCap. #' Optional -#' @param repeat_instrument The name of the instrument that is repeating -#' for a given event. -#' Optional #' @param repeat_instance (only for projects with repeating instruments/events) #' The repeat instance number of the repeating event (if longitudinal) or the #' repeating instrument (if classic or longitudinal). Default value is '1'. @@ -127,7 +124,6 @@ redcap_file_download_oneshot <- function( record, field, event = "", - repeat_instrument = NULL, repeat_instance = NULL, verbose = TRUE, config_options = NULL, @@ -161,13 +157,7 @@ redcap_file_download_oneshot <- function( if (0L < nchar(event)) post_body$event <- event - if (!is.null(repeat_instrument)) { - if (is.null(repeat_instance)) { - stop("You must specify repeat_instance when specified repeat_instrument") - } - post_body$repeat_instrument <- repeat_instrument - post_body$repeat_instance <- repeat_instance - } + if (!is.null(repeat_instance)) post_body$repeat_instance <- repeat_instance # This is the first of two important lines in the function. # It retrieves the information from the server and stores it in RAM. diff --git a/man/redcap_file_download_oneshot.Rd b/man/redcap_file_download_oneshot.Rd index 9b82aae0..ffa80e8d 100644 --- a/man/redcap_file_download_oneshot.Rd +++ b/man/redcap_file_download_oneshot.Rd @@ -14,7 +14,6 @@ redcap_file_download_oneshot( record, field, event = "", - repeat_instrument = NULL, repeat_instance = NULL, verbose = TRUE, config_options = NULL, @@ -49,10 +48,6 @@ Required} \item{event}{The name of the event where the file is saved in REDCap. Optional} -\item{repeat_instrument}{The name of the instrument that is repeating -for a given event. -Optional} - \item{repeat_instance}{(only for projects with repeating instruments/events) The repeat instance number of the repeating event (if longitudinal) or the repeating instrument (if classic or longitudinal). Default value is '1'.