Skip to content

Commit

Permalink
Merge pull request #247 from pharmaverse/240-Documentation-and-Templates
Browse files Browse the repository at this point in the history
Closes #240 documentation and templates
  • Loading branch information
ahasoplakus authored Jul 31, 2024
2 parents 34fa7c0 + 712dbdb commit ab7dac5
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 221 deletions.
8 changes: 4 additions & 4 deletions inst/templates/ad_adce.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ adce02 <- adce01 %>%
derive_vars_merged(
dataset_add = adsl,
new_vars = adsl_vars,
by = exprs(STUDYID, USUBJID)
by = get_admiral_option("subject_keys")
) %>%
## Derive analysis start time
## Proposed imputations depending on situation: no needed -> highest imputation = “n”
Expand Down Expand Up @@ -84,7 +84,7 @@ adce03 <-
derive_vars_joined(
adce02,
dataset_add = adperiods,
by_vars = exprs(STUDYID, USUBJID),
by_vars = get_admiral_option("subject_keys"),
filter_join = ASTDT >= APERSDT & ASTDT <= APEREDT,
join_type = "all"
) %>%
Expand Down Expand Up @@ -121,7 +121,7 @@ adce05 <- adce04 %>%
## Derive ASEQ
derive_var_obs_number(
new_var = ASEQ,
by_vars = exprs(STUDYID, USUBJID),
by_vars = get_admiral_option("subject_keys"),
order = exprs(CEDECOD, CELAT, CETPTREF, APERIOD),
check_type = "error"
) %>%
Expand All @@ -146,7 +146,7 @@ adsl_list <- adsl %>%
adce <- adce05 %>%
derive_vars_merged(
dataset_add = adsl_list,
by_vars = exprs(STUDYID, USUBJID)
by_vars = get_admiral_option("subject_keys")
)


Expand Down
8 changes: 4 additions & 4 deletions inst/templates/ad_adface.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ adface <- derive_vars_merged_vaccine(
derive_vars_merged(
dataset_add = adsl,
new_vars = adsl_vars,
by_vars = exprs(STUDYID, USUBJID)
by_vars = get_admiral_option("subject_keys")
) %>%
# Step 4 - Deriving Fever OCCUR records from VS if FAOBJ = "FEVER" records not present in FACE
derive_fever_records(
Expand Down Expand Up @@ -107,7 +107,7 @@ period_ref <- create_period_dataset(
adface <- derive_vars_joined(
adface,
dataset_add = period_ref,
by_vars = exprs(STUDYID, USUBJID),
by_vars = get_admiral_option("subject_keys"),
filter_join = ADT >= APERSDT & ADT <= APEREDT,
join_type = "all"
) %>%
Expand Down Expand Up @@ -212,7 +212,7 @@ lookup_dataset <- tribble(
"MAXDIAM", "MDISW", 29, "Maximum Diameter", "SWELLING",
"MAXSEV", "MAXSPIS", 30, "Maximum Severity", "PAIN AT INJECTION SITE",
"OCCUR", "OCCVOM", 31, "Occurrence Indicator", "VOMITING",
"DIAMETER", "DIASWEL", 32, "Diameter", "SWELLING",
"DIAMETER", "DIASWEL", 32, "Diameter", "SWELLING"
)

adface <- derive_vars_params(
Expand Down Expand Up @@ -241,7 +241,7 @@ adsl <- adsl %>%
adface <- derive_vars_merged(
dataset = adface,
dataset_add = select(adsl, !!!negate_vars(adsl_vars)),
by_vars = exprs(STUDYID, USUBJID)
by_vars = get_admiral_option("subject_keys")
) %>%
# Step 16 post processing
post_process_reacto(
Expand Down
Loading

0 comments on commit ab7dac5

Please sign in to comment.