diff --git a/R/data-gather-clean.R b/R/data-gather-clean.R index a87f5c6..463fda8 100644 --- a/R/data-gather-clean.R +++ b/R/data-gather-clean.R @@ -37,8 +37,8 @@ get_submissions <- function(syn, group, statuses) { #' Process submissions #' #' Process JSON files into a single table containing all submissions. Cleans up -#' the data to provide user-friendly variable and section names, and remove the -#' `metadata` section. +#' the data to provide user-friendly variable and section names, removes the +#' `metadata` section, and removes any fields with the hidden_field key (see ALZ-283). #' #' @param submissions A named list of paths to JSON files, i.e. the output of #' [get_submissions()]. The name of each element should be its form data ID. @@ -77,7 +77,8 @@ process_submissions <- function(submissions, lookup_table, complete = TRUE) { all_subs <- dplyr::filter(all_subs, .data$section != "metadata") %>% ## Fix display of some responses change_logical_responses() %>% - therapeutic_approach_response() + therapeutic_approach_response() %>% + remove_hidden_fields() all_subs } @@ -307,6 +308,16 @@ therapeutic_approach_response <- function(data) { ) } +#' ALZ-283: Remove hidden fields so they aren't displayed +#' +#' @inheritParams append_exp_nums +remove_hidden_fields <- function(data) { + dplyr::filter( + data, + variable != "hidden_field" + ) +} + #' Combine multiple routes into one comma-separated response #' #' @param data List containing route data diff --git a/data-raw/stopad_lookup_table.csv b/data-raw/stopad_lookup_table.csv index 866f298..0352879 100644 --- a/data-raw/stopad_lookup_table.csv +++ b/data-raw/stopad_lookup_table.csv @@ -62,6 +62,7 @@ In Vivo Data,Dosing Regimen,in_vivo_data,dose_regimen PK In Silico,Drug Partition Coefficient (LogP),pk_in_silico,partition_coefficient PK In Silico,Acid Dissociation Constant (pKA),pk_in_silico,dissociation_constant PK In Silico,Molecular Weight (g/mol),pk_in_silico,molecular_weight +PK In Vitro,Ignore me,pk_in_vitro,hidden_field PK In Vitro,Cell Permeablity Assay,pk_in_vitro,assay_description PK In Vitro,Permeability,pk_in_vitro,permeability PK In Vitro,Drug Lipophilicity Coefficient (LogD),pk_in_vitro,lipophilicity