diff --git a/R/mod_query_data.R b/R/mod_query_data.R index 722f74b0..f3a59dd6 100644 --- a/R/mod_query_data.R +++ b/R/mod_query_data.R @@ -305,8 +305,19 @@ mod_query_data_server <- function(id, tadat) { ) # user uploaded data - raw <- - suppressWarnings(readxl::read_excel(input$file$datapath, sheet = 1)) + raw <- suppressWarnings(readxl::read_excel(input$file$datapath, sheet = 1)) + + # run code included in TADA data retrieval + # need to specify this or throws error when trying to bind rows. Temporary fix for larger + # issue where data structure for all columns should be specified. + cols <- names(raw) + raw <- raw %>% dplyr::mutate_at(cols, as.character) + # check that all TADA template columns are included + raw <- EPATADA::TADA_CheckRequiredFields(raw) + # run autoclean + raw <- EPATADA::TADA_AutoClean(raw) + + # other steps to prepare data for app raw$TADA.Remove <- NULL initializeTable(tadat, raw) if (!is.null(tadat$original_source)) { diff --git a/R/utils_flag_functions.R b/R/utils_flag_functions.R index 5a9457b0..17205d5b 100644 --- a/R/utils_flag_functions.R +++ b/R/utils_flag_functions.R @@ -90,7 +90,7 @@ applyFlags <- function(in_table, orgs) { out <- EPATADA::TADA_FlagResultUnit(out, clean = "none") # QC rep/blank - out <- EPATADA::TADA_FindQCActivities(out, clean = FALSE) + out <- EPATADA::TADA_FindQCActivities(out, clean = FALSE, flaggedonly = FALSE) # Result is flagged as suspect by data submitter out <- EPATADA::TADA_FlagMeasureQualifierCode(out, clean = FALSE, define = TRUE) @@ -116,8 +116,7 @@ applyFlags <- function(in_table, orgs) { # Continuous data out <- EPATADA::TADA_FlagContinuousData(out, clean = FALSE, - flaggedonly = FALSE, - time_difference = 4) + flaggedonly = FALSE) # Above WQX Upper Threshold out <- EPATADA::TADA_FlagAboveThreshold(out, clean = FALSE)