fix read_redcap_tables

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-04-09 10:51:31 +02:00
parent 0628bde488
commit 1bdbb0df94
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,8 @@
# REDCapCAST 24.3.1 - in development # REDCapCAST 24.4.1 - in development
### Functions
* Fix: `read_redcap_tables()`: field names testing allows to include "[form_name]_complete" fields.
### Documentation and more ### Documentation and more

View File

@ -35,7 +35,7 @@ read_redcap_tables <- function(uri,
REDCapR::redcap_metadata_read(redcap_uri = uri, token = token)[["data"]] REDCapR::redcap_metadata_read(redcap_uri = uri, token = token)[["data"]]
if (!is.null(fields)) { if (!is.null(fields)) {
fields_test <- fields %in% unique(m$field_name) fields_test <- fields %in% c(m$field_name,paste(unique(m$form_name),"_complete"))
if (any(!fields_test)) { if (any(!fields_test)) {
print(paste0("The following field names are invalid: ", print(paste0("The following field names are invalid: ",