Skip to content

Commit

Permalink
feat: blanks in ADSL added; feat: trying to deploy slides as pages
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Oct 17, 2024
1 parent 2f0a646 commit 22f5c78
Show file tree
Hide file tree
Showing 3 changed files with 306 additions and 102 deletions.
27 changes: 13 additions & 14 deletions exercises/adsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Input: dm, ds, ex, ae, suppdm, rphrama_specs.xlsx
library(admiral)
library(pharmaversesdtm) # Contains example datasets from the CDISC pilot project
library(pharmaversesdtm)
library(dplyr)
library(lubridate)
library(stringr)
Expand All @@ -17,7 +17,7 @@ metacore <- spec_to_metacore(
path = "metadata/rpharma_specs.xlsx",
where_sep_sheet = FALSE
) %>%
select_dataset("ADSL")
select_dataset("????")

# ---- Load User-defined function ----
source("exercises/adams_little_helpers.R")
Expand Down Expand Up @@ -53,13 +53,13 @@ ex_ext <- ex %>%
derive_vars_dtm(
dtc = EXSTDTC,
new_vars_prefix = "EXST",
time_imputation = "last",
time_imputation = "????",
flag_imputation = "time"
) %>%
derive_vars_dtm(
dtc = EXENDTC,
new_vars_prefix = "EXEN",
time_imputation = "last",
time_imputation = "????",
flag_imputation = "time"
)

Expand All @@ -74,7 +74,7 @@ adsl01 <- dm_suppdm %>%
!is.na(EXSTDTM),
new_vars = exprs(TRTSDTM = EXSTDTM, TRTSTMF = EXSTTMF),
order = exprs(EXSTDTM, EXSEQ),
mode = "first",
mode = "????",
by_vars = exprs(STUDYID, USUBJID)
)

Expand All @@ -89,7 +89,7 @@ adsl02 <- adsl01 %>%
str_detect(EXTRT, "PLACEBO"))) & !is.na(EXENDTM),
new_vars = exprs(TRTEDTM = EXENDTM, TRTETMF = EXENTMF),
order = exprs(EXENDTM, EXSEQ),
mode = "last",
mode = "????",
by_vars = exprs(STUDYID, USUBJID)
)

Expand All @@ -107,7 +107,7 @@ adsl03 <- adsl02 %>%
# Derive treatment start time (TRTSDTM) ----
adsl04 <- adsl03 %>%
derive_vars_dtm_to_tm(
source_vars = exprs(TRTSDTM)
source_vars = exprs()
)

# View(adsl04 %>% select(USUBJID, starts_with("TRT")))
Expand All @@ -116,8 +116,8 @@ adsl04 <- adsl03 %>%
# Derive treatment duration (TRTDURD) ----
adsl05 <- adsl04 %>%
derive_var_trtdurd(
start_date = TRTSDT,
end_date = TRTEDT
start_date = ,
end_date =
)

# View(adsl05 %>% select(USUBJID, starts_with("TRT")))
Expand All @@ -135,7 +135,7 @@ adsl06 <- adsl05 %>%
derive_vars_merged(
dataset_add = ds_ext,
by_vars = exprs(STUDYID, USUBJID),
new_vars = exprs(SCRFDT = DSSTDT),
new_vars = exprs( = ),
filter_add = DSCAT == "DISPOSITION EVENT" & DSDECOD == "SCREEN FAILURE"
)

Expand All @@ -146,7 +146,7 @@ adsl07 <- adsl06 %>%
derive_vars_merged(
dataset_add = ds_ext,
by_vars = exprs(STUDYID, USUBJID),
new_vars = exprs(EOSDT = DSSTDT),
new_vars = exprs( = ),
filter_add = DSCAT == "DISPOSITION EVENT" & DSDECOD != "SCREEN FAILURE"
)

Expand Down Expand Up @@ -269,16 +269,15 @@ adsl16 <- adsl15 %>%
# Numeric Variables are from Spec File ----
## (AGEGR1N, RACEN, RACEGR1N, REGION1N, TRT01PN, TRT01AN)
adsl17 <- adsl16 %>%
create_var_from_codelist(metacore, input_var = AGEGR1, out_var = AGEGR1N) %>%
create_var_from_codelist(metacore, input_var = RACE, out_var = RACEN) %>%
create_var_from_codelist(metacore, input_var = AGEGR1, out_var = ) %>%
create_var_from_codelist(metacore, input_var = RACE, out_var = ) %>%
create_var_from_codelist(metacore, input_var = RACEGR1, out_var = RACEGR1N) %>%
create_var_from_codelist(metacore, input_var = REGION1, out_var = REGION1N) %>%
create_var_from_codelist(metacore, input_var = TRT01P, out_var = TRT01PN) %>%
create_var_from_codelist(metacore, input_var = TRT01A, out_var = TRT01AN)

# View(adsl17 %>% select(USUBJID, ends_with("N")))


adsl <- adsl17 %>%
drop_unspec_vars(metacore) %>% # Drop unspecified variables from specs
check_variables(metacore, dataset_name = "ADSL") %>% # Check all variables specified are present and no more
Expand Down
88 changes: 0 additions & 88 deletions solutions/Solutions.R

This file was deleted.

Loading

0 comments on commit 22f5c78

Please sign in to comment.