diff --git a/vignettes/chevron_catalog.rmd b/vignettes/chevron_catalog.rmd index 95aef540ba..381d5f1502 100644 --- a/vignettes/chevron_catalog.rmd +++ b/vignettes/chevron_catalog.rmd @@ -781,6 +781,79 @@ To display all possible grades even if they do not occur in the data, set the ar run(lbt14, syn_data, direction = "high", prune_0 = FALSE) ``` + +### **Laboratory Test Shifts to `NCI-CTCAE` Grade 3-4 Post-Baseline (`LBT15`)** + +Please note that the following examples of summarizing lab grades using single and double grading approaches can be applied to other lab table templates beyond `LBT15`. + +#### **1. Laboratory Test Shifts to `NCI-CTCAE` Grade 3-4 Post-Baseline (Single Grading Approach)** + +In ADaM v1.1 or below, lab grade variables (`BTOXGR` and `ATOXGR`) in ADLB range from -4 to +4, with -/+ indicating the direction of lab abnormality. This is known as the single grading approach. + +To summarize patients shifting to post-baseline grade 3-4 based on ADLB with the single grading approach, simply run the default `lbt15` template shown below. + +```{r} +run(lbt15, syn_data) +``` + +#### **2. Laboratory Test Shifts to `NCI-CTCAE` Grade 3-4 Post-Baseline (Double Grading Approach)** + +In ADaM v1.2 or above, ADLB now has two sets of lab grade variables - the high-directional variables (`ATOXDSCH`/`ATOXGRH`/`BTOXGRH`) and the low-directional variables (`ATOXDSCL`/`BTOXGRL`/`ATOXGRL`), both ranging from 0 to 4. This is known as the double grading or the bi-directional approach, which is the default in `{admiral}`. + +To summarize patients shifting to post-baseline grade 3-4 based on ADLB with the double grading approach, redefining `ANRIND` and `BNRIND` is needed in the pre-processing step shown below. + +```{r} +proc_data <- syn_data +# Convert single grading variables to double ones for demo purpose only +# as the original syn_data is using single grading approach +hr <- rule("0" = c("-4", "-3", "-2", "-1", "0")) +lr <- rule( + "0" = c("4", "3", "2", "1", "0"), + "1" = "-1", "2" = "-2", "3" = "-3", "4" = "-4" +) +proc_data$adlb <- proc_data$adlb %>% + mutate( + BTOXGRH = reformat(.data$BTOXGR, hr), + ATOXGRH = reformat(.data$ATOXGR, hr), + BTOXGRL = reformat(.data$BTOXGR, lr), + ATOXGRL = reformat(.data$ATOXGR, lr) + ) + +# Redefine ANRIND and BNRIND to adopt double grading approach +preprocess(lbt15) <- function(adam_db, ...) { + adam_db$adlb <- adam_db$adlb %>% + filter(.data$ONTRTFL == "Y", .data$PARCAT2 == "SI") %>% + mutate( + PARAM = with_label(.data$PARAM, "Laboratory Test"), + ANRIND = with_label( + as.factor( + case_when( + ATOXGRH == "0" & ATOXGRL %in% c("3", "4") ~ "LOW", + is.na(ATOXGRH) & ATOXGRL %in% c("3", "4") ~ "LOW", + ATOXGRH %in% c("3", "4") & ATOXGRL == "0" ~ "HIGH", + ATOXGRH %in% c("3", "4") & is.na(ATOXGRL) ~ "HIGH", + is.na(ATOXGRH) & is.na(ATOXGRL) ~ NA_character_, + TRUE ~ "MODERATE/NORMAL" + ) + ), "Direction of Abnormality" + ), + BNRIND = as.factor( + case_when( + BTOXGRH == "0" & BTOXGRL %in% c("3", "4") ~ "LOW", + is.na(BTOXGRH) & BTOXGRL %in% c("3", "4") ~ "LOW", + BTOXGRH %in% c("3", "4") & BTOXGRL == "0" ~ "HIGH", + BTOXGRH %in% c("3", "4") & is.na(BTOXGRL) ~ "HIGH", + is.na(BTOXGRH) & is.na(BTOXGRL) ~ NA_character_, + TRUE ~ "MODERATE/NORMAL" + ) + ) + ) + adam_db +} + +run(lbt15, proc_data) +``` + ### **Medical History (`MHT01`)** #### **1. Medical History**