Skip to content

Commit

Permalink
check for missing records
Browse files Browse the repository at this point in the history
ref #400
  • Loading branch information
wibeasley committed Jul 21, 2022
1 parent 9e93557 commit 374cd0f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,17 @@ redcap_read <- function(
)
}

unique_ids_actual <- sort(unique(ds_stacked[[id_position]]))
ids_missing_rows <- setdiff(unique_ids, unique_ids_actual)

if (0L < length(ids_missing_rows)) {
warning(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="; ")
))
}

elapsed_seconds <- as.numeric(difftime( Sys.time(), start_time, units="secs"))
status_code_combined <- paste(lst_status_code , collapse="; ")
outcome_message_combined <- paste(lst_outcome_message, collapse="; ")
Expand Down

0 comments on commit 374cd0f

Please sign in to comment.