-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In the code below, we want to be able to give app developers the option to use event_id for brevity sake. Some orgs' studies may have really long event_names so swapping for event_id could be SO much more concise... so that visits columns isn't extremely wide.
get_static_overview_data <- function(
data,
expected_general_columns = NULL
){
stopifnot(is.list(data))
expected_general_columns <- expected_general_columns %||% character(0)
stopifnot(is.character(expected_general_columns))
visits <- data |>
bind_rows_custom("item_value") |>
dplyr::filter(
!is.na(event_name),
!event_name %in% c("Any visit", "Exit"),
!is.na(subject_id)
) |>
dplyr::arrange(subject_id, day) |>
dplyr::distinct(subject_id, event_name) |>
collapse_column_vals(group_by = "subject_id") |>
dplyr::distinct()
create_table.general(
data[["General"]],
expected_columns = expected_general_columns
) |>
dplyr::select(tidyr::all_of("subject_id"), tidyr::any_of(c("status", "WHO.classification", "Age", "Sex"))) |>
dplyr::left_join(visits, by = "subject_id")
}The most important section below, for the proposed change:
dplyr::distinct(subject_id, event_name) |>
collapse_column_vals(group_by = "subject_id") |> I envision the change being a new function argument... but doesn't it also need to be in the metadata.xlsx??? This could be a study-specific change...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request