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

Closes #2501-general-issue-make-subject-keys-flexible-in-all-functions #2516

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
5 changes: 3 additions & 2 deletions R/create_single_dose_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ dose_freq_lookup <- tribble(
#' # Select valid dose records, non-missing `EXSTDTC` and `EXDOSE`.
#' ex_mod <- ex %>%
#' filter(!is.na(EXSTDTC) & !is.na(EXDOSE)) %>%
#' derive_vars_merged(adsl_death, by_vars = exprs(STUDYID, USUBJID)) %>%
#' derive_vars_merged(adsl_death, by_vars = get_admiral_option("subject_keys")) %>%
#' # Example, set up missing `EXDOSFRQ` as QD daily dosing regime.
#' # Replace with study dosing regime per trial treatment.
#' mutate(EXDOSFRQ = if_else(is.na(EXDOSFRQ), "QD", EXDOSFRQ)) %>%
Expand Down Expand Up @@ -450,7 +450,8 @@ create_single_dose_dataset <- function(dataset,
lookup_column = CDISC_VALUE,
nominal_time = NULL,
keep_source_vars = expr_c(
exprs(USUBJID), dose_freq, start_date, start_datetime,
get_admiral_option("subject_keys"), dose_freq,
start_date, start_datetime,
end_date, end_datetime
)) {
dose_freq <- assert_symbol(enexpr(dose_freq))
Expand Down
4 changes: 2 additions & 2 deletions R/derive_vars_transposed.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ derive_vars_transposed <- function(dataset,
#' derive_vars_atc(cm, facm)
derive_vars_atc <- function(dataset,
dataset_facm,
by_vars = exprs(USUBJID, CMREFID = FAREFID),
id_vars = NULL,
by_vars = c(get_admiral_option("subject_keys"),
exprs(CMREFID = FAREFID)),
value_var = FASTRESC) {
value_var <- assert_symbol(enexpr(value_var))
assert_vars(by_vars)
Expand Down
6 changes: 3 additions & 3 deletions man/create_single_dose_dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/derive_vars_atc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/bds_exposure.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ For example, to calculate the total dose by subject and treatment,
adex <- derive_param_exposure(
adex,
dataset_add = adex,
by_vars = exprs(STUDYID, USUBJID, !!!adsl_vars),
by_vars = c(get_admiral_option("subject_keys"), adsl_vars),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either we should update all calls in the vignette or none.

@bms63 , did we reach a decision regarding updating vignettes and templates?

input_code = "DOSE",
set_values_to = exprs(
PARAMCD = "TDOSE",
Expand Down Expand Up @@ -441,7 +441,7 @@ adex <- adex %>%
)
),
dataset_add = adex,
by_vars = exprs(STUDYID, USUBJID, !!!adsl_vars)
by_vars = c(get_admiral_option("subject_keys"), adsl_vars)
)

count(adex, PARAMCD, PARCAT1)
Expand All @@ -465,7 +465,7 @@ specified in the `by_vars` argument will be populated in this new record.
```{r eval=TRUE, echo=TRUE}
adex <- adex %>%
derive_param_doseint(
by_vars = exprs(STUDYID, USUBJID, !!!adsl_vars),
by_vars = c(get_admiral_option("subject_keys"), adsl_vars),
set_values_to = exprs(PARAMCD = "TNDOSINT"),
tadm_code = "TDOSE",
tpadm_code = "TPDOSE"
Expand Down
Loading