Skip to content

Commit

Permalink
#294: combined confirmed resp section removed, CA2XULRR removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Starostecka,Olga (AH GI Clin) BIV-DE-I committed Jan 9, 2025
1 parent 381edb5 commit 12f1633
Showing 1 changed file with 4 additions and 216 deletions.
220 changes: 4 additions & 216 deletions vignettes/adrs_gcig.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ For this vignette we made assumptions that following information is collected on
list_supp <- tibble::tribble(
~"QNAM", ~"QLABEL", ~"QVAL", ~"Purpose", ~"Use case",
"`CA125EFL`", "CA-125 response evaluable", "Y/N", "Indicates population evaluable for CA-125 response (baseline CA-125 >= 2 * ULRR and no mouse antibodies)", "`CA125EFL` variable",
"`CA2XULRR`", "CA-125 pre-treatment 2x ULRR", "Y", "Indicates CA-125 level at baseline (Y - >= 2 * ULRR)", "",
"`CAELEPRE`", "Elevated pre-treatment CA-125", "Y/N", "Indicates CA-125 level at baseline (Y - elevated, N - not elevated)", "Derivation of PD category (`MCRIT1`/`MCRIT1ML`/`MCRIT1MN`)",
"`MOUSEANT`", "Received mouse antibodies", "Y", "Indicates if a prohibited therapy was received", "Derivation of `ANL02FL`",
"`CA50RED`", ">=50% reduction from baseline", "Y", "Indicates response, but does not distinguish between CR and PR", "Not used in further derivations",
Expand Down Expand Up @@ -156,10 +155,7 @@ library(tibble)
- [CA-125 Progression Category](#pdcacat)
- [CA-125 Best Confirmed Overall Response](#cborca)
- [Combined Best Unconfirmed Overall Response](#combubor)
- [Confirmed RECIST 1.1 Overall Response](#covrr11)
- [Combined Best Confirmed Overall Response](#combcbor)
- [Derive Confirmed Response Parameter](#cborca125)


## Read in Data {#readdata}

Expand All @@ -181,7 +177,7 @@ rs <- convert_blanks_to_na(rs)
```{r, eval=TRUE, echo=FALSE}
dataset_vignette(
rs,
display_vars = exprs(USUBJID, RSTESTCD, RSCAT, RSSTRESC, VISIT, CA125EFL, CA2XULRR, CAELEPRE, CA50RED, CANORM2X, CNOTNORM, MOUSEANT)
display_vars = exprs(USUBJID, RSTESTCD, RSCAT, RSSTRESC, VISIT, CA125EFL, CAELEPRE, CA50RED, CANORM2X, CNOTNORM, MOUSEANT)
)
```

Expand Down Expand Up @@ -605,219 +601,11 @@ dataset_vignette(
)
```

## Confirmed RECIST 1.1 Overall Response {#covrr11}

For studies where ORR is one of the primary endpoints there is a need to derive combined response based on confirmed RECIST 1.1 and confirmed CA-125 overall responses. To perform this step, there is a need to confirm `CR` and `PR` RECIST 1.1 responses by deriving Confirmed RECIST 1.1 Overall Response parameter.

Following table provides a summary of the `Confirmed RECIST 1.1 Overall Response` calculation at each time point.

```{r echo=FALSE}
list_resp <- tribble(
~"RECIST 1.1 response at 1st time point", ~"RECIST 1.1 response at 2nd time point",
~"Confirmed RECIST 1.1 response at 1st time point",
"CR", "CR", "CR",
"CR", "PR/SD/PD", "PD",
"CR", "NE", "NE",
"PR", "CR/PR", "PR",
"PR", "SD/PD/NE", "SD/PD/NE",
"CR/PR", "missing", "SD",
"SD/PD/NE", "any", "SD/PD/NE"
)
knitr::kable(list_resp)
```

In brief, the following steps are described below:

1. Derive confirmed overall response based on the response from next consecutive assessment.
2. Display a warning if responses used for confirmation are less than `confirmed_period` apart.
3. Remove unnecessary variables, assign `AVAL`, `AVALC` and other parameter details.


```{r}
confirmation_period <- 21
covr_r11 <- ovr_r11 %>%
arrange(USUBJID, ADTM) %>%
group_by(USUBJID) %>%
mutate(
AVALC.next = lead(AVALC),
AVAL.next = lead(AVAL),
ADT.next = lead(ADT)
) %>%
ungroup() %>%
mutate(AVALC.confirmed = case_when(
# CR
AVALC == "CR" & AVALC.next == "CR" ~ "CR",
AVALC == "CR" & AVALC.next %in% c("PR", "SD", "PD") ~ "PD",
AVALC == "CR" & AVALC.next == "NE" ~ "NE",
# PR
AVALC == "PR" & AVALC.next %in% c("CR", "PR") ~ "PR",
AVALC == "PR" & AVALC.next %in% c("SD", "PD", "NE") ~ AVALC.next,
# next assessment NA
AVALC %in% c("CR", "PR") & is.na(AVALC.next) ~ "SD",
# no need to confirm SD, PD, NE
AVALC %in% c("SD", "PD", "NE") ~ AVALC,
!is.na(AVALC) ~ AVALC
))
covr_r11_check <- covr_r11 %>%
mutate(diff_days = as.numeric(difftime(ADT.next, ADT, units = "days"))) %>%
filter(diff_days < confirmation_period) %>%
mutate(warn = paste(
"For USUBJID", USUBJID, "to confirm", AVISIT,
"visit, a visit that took place", diff_days, "days later was used."
)) %>%
pull(warn)
if (length(covr_r11_check) > 0) {
cli::cli_warn("{covr_r11_check}")
}
covr_r11 <- covr_r11 %>%
select(-AVAL, -AVALC, -AVAL.next, -AVALC.next, -ADT.next) %>%
rename(AVALC = AVALC.confirmed) %>%
mutate(AVAL = aval_resp(AVALC)) %>%
mutate(
PARAMCD = "COVRR11",
PARAM = "Confirmed RECIST 1.1 Overall Response by Investigator",
PARAMN = 7,
PARCAT1 = "RECIST 1.1",
PARCAT1N = 2,
PARCAT2 = "Investigator",
PARCAT2N = 1,
)
adrs <- bind_rows(adrs, covr_r11)
```

```{r, echo=FALSE}
dataset_vignette(
adrs,
display_vars = exprs(USUBJID, AVISIT, PARAMCD, AVALC, ADT),
filter = PARAMCD == "COVRR11"
)
```

## Combined Best Confirmed Overall Response {#combcbor}

Now that we have both components of the combined response as confirmed responses, we can derive the combined response and at a later step Combined Best Confirmed Overall Response parameter.

Following table provides a summary of the `Combined Overall Response by Investigator (Confirmation of RECIST 1.1 Required)` calculation at each time point as per GCIG guidelines.

```{r echo=FALSE}
list_resp <- tribble(
~"Confirmed RECIST 1.1 response", ~"Confirmed CA-125 response", ~"Combined response",
"CR", "CR", "CR",
"CR", "PR/SD/NE", "PR",
"PR/SD/NE", "CR", "PR",
"PR", "CR/PR/SD/NE", "PR",
"CR/PR/SD/NE", "PR", "PR",
"SD", "SD", "SD",
"SD", "NE", "SD",
"NE", "SD", "SD",
"PD", "any", "PD",
"any", "PD", "PD",
"NE", "NE", "NE",
"any", "missing", "NE",
"missing", "any", "NE"
)
knitr::kable(list_resp)
```

```{r}
ovr_cbor <- covr_r11 %>%
derive_vars_transposed(
ovr_ca125,
by_vars = exprs(!!!get_admiral_option("subject_keys"), AVISIT, ADT, ANL01FL, ANL02FL),
key_var = PARAMCD,
value_var = AVALC
) %>%
select(-AVAL) %>%
rename(OVRR11 = AVALC) %>%
mutate(AVALC = case_when(
# CR
OVRR11 == "CR" & OVRCA125 == "CR" ~ "CR",
OVRR11 == "CR" & OVRCA125 %in% c("PR", "SD", "NE") ~ "PR",
OVRCA125 == "CR" & OVRR11 %in% c("PR", "SD", "NE") ~ "PR",
# PR
OVRR11 == "PR" & OVRCA125 %in% c("CR", "PR", "SD", "NE") ~ "PR",
OVRCA125 == "PR" & OVRR11 %in% c("CR", "PR", "SD", "NE") ~ "PR",
# SD, NE
OVRR11 %in% c("SD", "NE") & OVRCA125 %in% c("SD", "NE") & OVRR11 == OVRCA125 ~ OVRR11,
OVRR11 %in% c("SD", "NE") & OVRCA125 %in% c("SD", "NE") & OVRR11 != OVRCA125 ~ "SD",
# PD
OVRR11 == "PD" | OVRCA125 == "PD" ~ "PD",
# next assessment NA
is.na(OVRR11) | is.na(OVRCA125) ~ "NE",
TRUE ~ "MISSING"
))
ovr_cbor <- ovr_cbor %>%
# select(-OVRR11, -OVRCA125) %>%
mutate(
PARAMCD = "COVR11CA",
PARAM = "Combined Overall Response by Investigator (Confirmation of RECIST 1.1 Required)",
PARAMN = 8,
PARCAT1 = "Combined",
PARCAT1N = 3,
PARCAT2 = "Investigator",
PARCAT2N = 1,
AVAL = aval_resp(AVALC)
)
adrs <- bind_rows(adrs, ovr_cbor)
```

```{r, echo=FALSE}
dataset_vignette(
adrs,
display_vars = exprs(USUBJID, AVISIT, PARAMCD, AVALC, ADT),
filter = PARAMCD == "COVR11CA"
)
```

Finally Combined Best Confirmed Overall Response parameter can be derived based on `ovr_cbor` data frame.

```{r}
ovr <- ovr_cbor
adrs <- adrs %>%
derive_extreme_event(
by_vars = get_admiral_option("subject_keys"),
tmp_event_nr_var = event_nr,
order = exprs(event_nr, ADT),
mode = "first",
source_datasets = list(
ovr = ovr,
adsl = adsl
),
events = list(
bor_cr, bor_pr, bor_sd_gcig, bor_pd, bor_ne_gcig, no_data_missing
),
set_values_to = exprs(
PARAMCD = "CBORCA11",
PARAM = "Combined Best Confirmed Overall Response by Investigator",
PARAMN = 9,
PARCAT1 = "Combined",
PARCAT1N = 3,
PARCAT2 = "Investigator",
PARCAT2N = 1,
AVAL = aval_resp(AVALC),
ANL01FL = "Y",
ANL02FL = "Y"
)
)
```

```{r, echo=FALSE}
dataset_vignette(
adrs,
display_vars = exprs(USUBJID, AVISIT, PARAMCD, AVALC, ADT),
filter = PARAMCD == "CBORCA11"
)
```
For studies where ORR is one of the primary endpoints, best RECIST 1.1 response
for CR and PR needs to be confirmed and maintained for at least 28 days.
Due to the complexity of the problem, we will not address it in this vignette.

## Other Endpoints {#other}

Expand Down

0 comments on commit 12f1633

Please sign in to comment.