Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALZ-200: Test hidden_field filtering #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions R/data-gather-clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions data-raw/stopad_lookup_table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading