Skip to content

Commit

Permalink
Correct SERREAS derivation in ael03 (#284)
Browse files Browse the repository at this point in the history
Fixes #269

---------

Signed-off-by: Davide Garolini <[email protected]>
Signed-off-by: Davide Garolini <[email protected]>
Co-authored-by: Pawel Rucki <[email protected]>
Co-authored-by: Emily de la Rua <[email protected]>
Co-authored-by: Joe Zhu <[email protected]>
  • Loading branch information
4 people authored Dec 2, 2024
1 parent ba49f74 commit a69de29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions book/listings/adverse-events/ael03.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ library(dplyr)
library(rlistings)
adae <- random.cdisc.data::cadae
adae$AESCONG[which(adae$AESER == "Y")[seq(3)]] <- "Y" # To mimic possibility of overlap
out <- adae %>%
filter(AESER == "Y") %>%
Expand All @@ -38,17 +39,20 @@ 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()
out <- out %>%
select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, AESEV, Related, Outcome, Treated, Action, SERREAS)
var_labels(out) <- c(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<chr> <int> <dbl> <fct> <chr> <dbl> <chr> <dbl> <chr>
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<chr> <int> <dbl> <fct> <chr> <dbl> <chr> <dbl> <chr>
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
Expand Down

0 comments on commit a69de29

Please sign in to comment.