pharmaverse / admiral

ADaM in R Asset Library
https://pharmaverse.github.io/admiral
Apache License 2.0
222 stars 62 forks source link

Create a function for last dose derivation #168

Closed slamao closed 3 years ago

slamao commented 3 years ago
derive_last_dose_date(
  dataset,
  dataset_ex = ex,
  filter_ex = exprs((EXDOSE > 0 | (EXDOSE == 0 & str_detect(EXTRT, "PLACEBO"))) & nchar(EXENDTC) >= 10),
  date_var = ASDTM,
  new_var = LDOSEDTM
)

Linked to #136

thomas-neitmann commented 3 years ago

@aehmann-gsk I couldn't find a definition for how you would calculate LDOSEDTM in your specs. Do you not derive this variable in ADAE?

aehmann-gsk commented 3 years ago

@thomas-neitmann No - it does not appear LDOSEDTM is in our standards but based on the computational method for ALTRTSTC: min (ASTDT - ADEX.ASTDT+1 (value should >=1)) (here, all ADEX.ASTDT of the corresponding subject should be included). Can be DateTime for it if needed I would generically define it as: max(ADEX.ASTDT) where (ASTDT - ADEX.ASTDT+1 (value should >=1)) (here, all ADEX.ASTDT of the corresponding subject should be included). Can be DateTime for it if needed