Skip to content

Commit

Permalink
elevate warning to error
Browse files Browse the repository at this point in the history
for missing records

closes #400
  • Loading branch information
wibeasley committed Jul 22, 2022
1 parent c022b5e commit 09fb518
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ redcap_read <- function(
min(selected_ids), " through ", max(selected_ids),
" (ie, ", length(selected_ids), " unique subject records)."
)
message(
"\nReading batch ", i, " of ", nrow(ds_glossary), ", with subjects ",
paste(selected_ids, collapse = ','),
"\n(ie, ", length(selected_ids), " unique subject records)."
)
# message(
# "\nReading batch ", i, " of ", nrow(ds_glossary), ", with subjects ",
# paste(selected_ids, collapse = ','),
# "\n(ie, ", length(selected_ids), " unique subject records)."
# )
}
read_result <- REDCapR::redcap_read_oneshot(
redcap_uri = redcap_uri,
Expand Down Expand Up @@ -400,10 +400,10 @@ redcap_read <- function(
ids_missing_rows <- setdiff(unique_ids, unique_ids_actual)

if (0L < length(ids_missing_rows)) {
warning(sprintf(
stop(sprintf(
"There are %i subject(s) that are missing rows in the final dataset.\nCheck for funny values that could trip up REDCap's PHP code:\n%s.",
length(ids_missing_rows),
paste(ids_missing_rows, collapse="; ")
paste(ids_missing_rows, collapse=",")
))
}

Expand Down

0 comments on commit 09fb518

Please sign in to comment.