From 46d3361eef5eb1ca8588bc0451b8a3996678ea69 Mon Sep 17 00:00:00 2001 From: Melkiades Date: Tue, 12 Nov 2024 13:43:22 +0100 Subject: [PATCH 1/7] Correct SERREAS derivation in ael03 --- book/listings/adverse-events/ael03.qmd | 34 ++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index ec6cbec0da..6aaba36fd4 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -7,13 +7,13 @@ subtitle: Listing of Serious Adverse Events {{< include ../../_utils/envir_hook.qmd >}} -:::: {.panel-tabset} - +::: panel-tabset ```{r setup, echo = FALSE} library(dplyr) library(rlistings) adae <- random.cdisc.data::cadae +adae$AESCONG[which(adae$AESER == "Y")[seq(3)]] <- "Y" # To mimick correct possibility of overlap out <- adae %>% filter(AESER == "Y") %>% @@ -40,17 +40,23 @@ out <- adae %>% AEACN == "DRUG WITHDRAWN" ~ 5, AEACN == "NOT APPLICABLE" | AEACN == "NOT EVALUABLE" ~ 6, AEACN == "UNKNOWN" ~ 7 - ), - SERREAS = case_when( - AESDTH == "Y" ~ "1", - AESLIFE == "Y" ~ "2", - AESHOSP == "Y" ~ "3", - AESDISAB == "Y" ~ "4", - AESCONG == "Y" ~ "5", - AESMIE == "Y" ~ "6", - TRUE ~ " " ) ) %>% + rowwise() %>% + mutate( + SERREAS = paste( + which( + c(AESDTH, AESLIFE, AESHOSP, AESDISAB, AESCONG, AESMIE) == "Y" + ), + collapse = ", " + ) + ) %>% + ungroup() + +# Check correct derivation of SERREAS +# out |> select(AESDTH, AESLIFE, AESHOSP, AESDISAB, AESCONG, AESMIE, SERREAS) + +out <- out %>% select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, AESEV, Related, Outcome, Treated, Action, SERREAS) var_labels(out) <- c( @@ -99,8 +105,7 @@ lsting <- as_listing( head(lsting, 20) ``` -`r webr_code_labels <- c("setup", "lsting")` -{{< include ../../_utils/webr.qmd >}} +`r webr_code_labels <- c("setup", "lsting")` {{< include ../../_utils/webr.qmd >}} ::: ## Data Setup @@ -108,8 +113,7 @@ head(lsting, 20) ```{r setup} #| code-fold: show ``` - -:::: +::: {{< include ../../_utils/save_results.qmd >}} From db3c2f4e45c341076f9a9c6d54c33721ef2b9799 Mon Sep 17 00:00:00 2001 From: Davide Garolini Date: Fri, 22 Nov 2024 12:49:09 +0100 Subject: [PATCH 2/7] Update book/listings/adverse-events/ael03.qmd Co-authored-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Signed-off-by: Davide Garolini --- book/listings/adverse-events/ael03.qmd | 1 - 1 file changed, 1 deletion(-) diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index e40dc06a29..1af96f56c0 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -113,7 +113,6 @@ lsting <- as_listing( head(lsting, 20) ``` - ```{r include = FALSE} webr_code_labels <- c("lsting") ``` From e708d3a6ba978ac2d90d4fcd5a97abace50734c7 Mon Sep 17 00:00:00 2001 From: Davide Garolini Date: Mon, 25 Nov 2024 09:40:48 +0100 Subject: [PATCH 3/7] Update book/listings/adverse-events/ael03.qmd Co-authored-by: Emily de la Rua <59304861+edelarua@users.noreply.github.com> Signed-off-by: Davide Garolini --- book/listings/adverse-events/ael03.qmd | 3 --- 1 file changed, 3 deletions(-) diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index 1af96f56c0..b5d1d949d9 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -52,9 +52,6 @@ out <- adae %>% ) %>% ungroup() -# Check correct derivation of SERREAS -# out |> select(AESDTH, AESLIFE, AESHOSP, AESDISAB, AESCONG, AESMIE, SERREAS) - out <- out %>% select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, AESEV, Related, Outcome, Treated, Action, SERREAS) From 072b28aaa184362d9696f9fbc83762d2b4a62373 Mon Sep 17 00:00:00 2001 From: Davide Garolini Date: Mon, 25 Nov 2024 09:40:58 +0100 Subject: [PATCH 4/7] Update book/listings/adverse-events/ael03.qmd Co-authored-by: Emily de la Rua <59304861+edelarua@users.noreply.github.com> Signed-off-by: Davide Garolini --- book/listings/adverse-events/ael03.qmd | 1 - 1 file changed, 1 deletion(-) diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index b5d1d949d9..134ecd32fa 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -122,7 +122,6 @@ webr_code_labels <- c("lsting") ```{r setup} #| code-fold: show ``` - :::: {{< include ../../_utils/save_results.qmd >}} From 1682402e94d7d6395785b64e3914cb7461fe9488 Mon Sep 17 00:00:00 2001 From: Davide Garolini Date: Mon, 25 Nov 2024 09:41:09 +0100 Subject: [PATCH 5/7] Update book/listings/adverse-events/ael03.qmd Co-authored-by: Emily de la Rua <59304861+edelarua@users.noreply.github.com> Signed-off-by: Davide Garolini --- book/listings/adverse-events/ael03.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/listings/adverse-events/ael03.qmd b/book/listings/adverse-events/ael03.qmd index 134ecd32fa..35bc6e739d 100644 --- a/book/listings/adverse-events/ael03.qmd +++ b/book/listings/adverse-events/ael03.qmd @@ -12,7 +12,7 @@ library(dplyr) library(rlistings) adae <- random.cdisc.data::cadae -adae$AESCONG[which(adae$AESER == "Y")[seq(3)]] <- "Y" # To mimick correct possibility of overlap +adae$AESCONG[which(adae$AESER == "Y")[seq(3)]] <- "Y" # To mimic possibility of overlap out <- adae %>% filter(AESER == "Y") %>% From 481df956a904d0a5fc23f11fbe4d471f1d909a87 Mon Sep 17 00:00:00 2001 From: Melkiades Date: Tue, 26 Nov 2024 16:49:39 +0100 Subject: [PATCH 6/7] snap --- .../testthat/_snaps/stable/listings-adverse-events-ael03.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/tests/testthat/_snaps/stable/listings-adverse-events-ael03.md b/package/tests/testthat/_snaps/stable/listings-adverse-events-ael03.md index a65bcc03ff..336805654e 100644 --- a/package/tests/testthat/_snaps/stable/listings-adverse-events-ael03.md +++ b/package/tests/testthat/_snaps/stable/listings-adverse-events-ael03.md @@ -18,7 +18,7 @@ 10 A: Drug X BRA-1/id-93 34/F/ASIAN dcd D.1.1.1.1 Date_First ASTDY Duration AESEV Related Outcome Treated Action SERREAS - 1 04NOV2020 321 149 MODERATE No 5 Yes 2 4 + 1 04NOV2020 321 149 MODERATE No 5 Yes 2 4, 5 2 04NOV2020 393 43 MODERATE No 5 No 5 5 3 01JAN2020 64 630 SEVERE Yes 1 No 6 1 4 01JAN2020 160 259 MODERATE No 2 Yes 2 4 From 0fab9b9e63423f879454d369c2f88e08d94f7b0f Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:26:06 +0100 Subject: [PATCH 7/7] update snap devel --- .../_snaps/development/listings-adverse-events-ael03.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/tests/testthat/_snaps/development/listings-adverse-events-ael03.md b/package/tests/testthat/_snaps/development/listings-adverse-events-ael03.md index a08ecc094d..675faf4de7 100644 --- a/package/tests/testthat/_snaps/development/listings-adverse-events-ael03.md +++ b/package/tests/testthat/_snaps/development/listings-adverse-events-ael03.md @@ -18,7 +18,7 @@ 10 A: Drug X BRA-1/id-93 34/F/ASIAN dcd D.1.1.1.1 Date_First ASTDY Duration AESEV Related Outcome Treated Action SERREAS - 1 04NOV2020 321 149 MODERATE No 5 Yes 2 4 + 1 04NOV2020 321 149 MODERATE No 5 Yes 2 4, 5 2 04NOV2020 393 43 MODERATE No 5 No 5 5 3 01JAN2020 64 630 SEVERE Yes 1 No 6 1 4 01JAN2020 160 259 MODERATE No 2 Yes 2 4