Skip to contents

Pre-processing data for Adverse Event domain specific reports

Usage

ae_pre_processor(
  datain,
  fmq_data = NULL,
  date_vars = c("ASTDT", "AENDT", "TRTSDT", "TRTEDT"),
  ae_filter = "Any Event",
  subset = NA,
  obs_residual = NA_real_,
  max_sevctc = NA_character_,
  sev_ctcvar = "ASEVN",
  hterm = "AEBODSYS",
  lterm = "AEDECOD",
  rpt_byvar = character(0),
  trtvar = "TRTA",
  pt_total = "N"
)

Arguments

datain

the input ADaM (ADAE) dataset.

fmq_data

FMQ table dataframe, if passed, will be merged to adae date by PT.

date_vars

Vector of variables to be converted to R date format

ae_filter

Vector of adverse event types to be used as filter conditions. Permissible Values: "ANY", "ANY EVENT", "TREATMENT EMERGENT", "SERIOUS", "DRUG-RELATED", "RELATED", "MILD", "MODERATE", "SEVERE", "RECOVERED/RESOLVED", "RECOVERING/RESOLVING", "NOT RECOVERING/NOT RESOLVING", "FATAL", "GRADE N"

subset

Analysis subset condition to be applied to ADAE dataset prior to ADSL join; will be appended to ae_filter

obs_residual

If not NA, use this argument to pass a period (numeric) to extend the observation period. If passed as NA, overall study duration is considered for analysis. eg. if 5, only events occurring upto 5 days past the TRTEDT are considered.

max_sevctc

If needed to filter maximum severity/ctc grade rows. Values: NA/"SEV"/"CTC"

sev_ctcvar

Variable to determine max severity. eg: ASEVN, ATOXGRN

hterm

High Level Event Term (req for max Sev tables only)

lterm

Low Level Event Term (req for max Sev tables only)

rpt_byvar

Page/report by variable if any, to identify max sev/ctc

trtvar

Treatment Variable

pt_total

Required to calculate total of preferred terms? Y/N

Value

: a list containing 2 objects

  • data - Processed dataframe output for further utilities (pass to mentry())

  • a_subset - Analysis Subset condition as a string (pass to mentry() OR further utilities as required)

Examples

data(adae)
data(FMQ_Consolidated_List)

data_pre <- ae_pre_processor(
  datain = adae,
  ae_filter = "Serious",
  obs_residual = 0,
  fmq_data = FMQ_Consolidated_List
)
data_pre$data
#> # A tibble: 1 × 58
#>   STUDYID      SITEID USUBJID TRTA  TRTAN   AGE AGEGR1 AGEGR1N RACE  RACEN SEX  
#>   <chr>        <chr>  <chr>   <chr> <dbl> <dbl> <chr>    <dbl> <chr> <dbl> <chr>
#> 1 CDISCPILOT01 718    01-718… Xano…    81    69 65-80        2 WHITE     1 F    
#> # ℹ 47 more variables: SAFFL <chr>, TRTSDT <date>, TRTEDT <date>, ASTDT <date>,
#> #   ASTDTF <chr>, ASTDY <dbl>, AENDT <date>, AENDY <dbl>, ADURN <dbl>,
#> #   ADURU <chr>, AETERM <chr>, AELLT <chr>, AELLTCD <dbl>, AEDECOD <chr>,
#> #   AEPTCD <dbl>, AEHLT <chr>, AEHLTCD <dbl>, AEHLGT <chr>, AEHLGTCD <dbl>,
#> #   AEBODSYS <chr>, AESOC <chr>, AESOCCD <dbl>, AESEV <chr>, AESER <chr>,
#> #   AESCAN <chr>, AESCONG <chr>, AESDISAB <chr>, AESDTH <chr>, AESHOSP <chr>,
#> #   AESLIFE <chr>, AESOD <chr>, AEREL <chr>, AEACN <chr>, AEOUT <chr>, …
data_pre$a_subset
#> [1] "AESER == 'Y' & (ASTDT > TRTSDT) & (ASTDT < (TRTEDT + 0))"