pharmaverse / admiral

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

ADEX - dose adjustments #178

Closed aehmann-gsk closed 3 years ago

kabis-ops commented 3 years ago

Hi @bundfussr , could you please point me to the spec where the dose adjustment calculation uses FA or EC. I had a look at our spec, and cannot find anything related to this.

bundfussr commented 3 years ago

Hi @kabis-ops , please look at the ADJ parameter in the "ADEX Parameters" tab. (You have to enlarge the cell to see the complete derivation.)

kabis-ops commented 3 years ago

Thanks, so the definition is (this is for the 1:1 mapping)

I don't think this definition is standard and i guess it is also dependent on the data collection. To derive this, I would expect the user to first add the required variables from EC and FA in EX (to add the relevant variables, we could offer a function that would link the domains and add the required info based on the LINKID? Maybe what is used in ADCM, for the WHO Drug (FA) could be used too here?) and then adjust the derivation in the 1:1 mapping.

adex0<-<ex +EC.ADJ where ECMOD=PERFORMED and FA.FAORRES where .... >
adex1_1 <- bind_rows(
  adex0 %>% mutate(PARAMCD = "DURD", AVAL = EXDUR),
  adex0 %>% mutate(PARAMCD = "DOSE", AVAL = EXDOSE),
  adex0 %>% mutate(PARAMCD = "ADJ", AVALC = if_else(!is.na(EXADJ) | !is.na(ECADJ) | FAECADJ=="Y"), "Y", NA_character_)),
...

Then the flag for an overall/periodic adjustment would be handled as described in the adex script:

# Any Dose adjustment?
tadj <- exposure_var_spec(
  new_parameter = "TADJ",
  input_parameter = "ADJ",
  fns = list(AVALC ~ if_else(sum(!is.na(.)) > 0, "Y", NA_character_))
)

At the end, of the code, we should have the metadata function which should select only the relevant variables and get rif odd these extra variables.

@aehmann-gsk , @thomas-neitmann, please let us know your thoughts :) Thanks

bundfussr commented 3 years ago

In principle this workflow could work. But it is not really modular. The derivation is separated in three steps:

  1. derive variables ECADJ and FAECADJ (this requires more than merging a variable because the relationship between EC/FA and EX may be many to one.)
  2. derive the ADJ parameter
  3. remove the ECADJ and FAECADJ variable
thomas-neitmann commented 3 years ago

For now we require the user to merge any variables from other datasets onto EX themselves.