#' Generate a report of TSTs read outside of the 44-76 hour window.
#'
#' This function generates a data.frame of participants whose TSTs were
#' read less than 44 or more than 76 hours after placement (the window
#' permitted under the study protocol).
#'
#' @return
#' This function returns a data.frame of participants whose tests fall outside
#' the window, including study ID, date/time placed, date/time read,
#' placer and reader initials, and the hours from placement to reading.
#'
#' @param cleanlist The list of cleaned TO1 data generated by
#' \code{\link{clean_to1}}
#'
#' @export
tst_win_check <- function(cleanlist) {
tsts <- cleanlist$skintest[cleanlist$skintest$Status %in% "Submitted", ]
###########################################################################
# Were TSTs read within 48-72 hours?
###########################################################################
tsts$hrs_to_read <- round(as.numeric(
difftime(tsts$dt_read, tsts$dt_placed, units = "hours")), 1)
# Report any outside of the 48-72 hour bounds (which are actually 44-76)
tsts[tsts$hrs_to_read > 76 | tsts$hrs_to_read < 44,
c("StudyID", "dt_placed", "TstPlacedBy",
"dt_read", "TstReadBy", "hrs_to_read")]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.