pharmaverse / admiral

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

derive_vars_merged_dtm, define EX record for ADSL TRTSDTM #1217

Closed oreillb1 closed 2 years ago

oreillb1 commented 2 years ago

Feature Idea

derive_vars_merged_dtm takes first EX record for derivation of [ADSL.TRTSDTM] but in multiple study drug studies we might need to define a reference drug dose record not necessarily the first administered by [EX.EXSTDTC]. Could we have a function to specify a priority order which EX records are considered for [ADSL.TRTSDTM]?

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

bundfussr commented 2 years ago

@oreillb1 , thanks for creating an issue.

Could you provide an example? I am not sure what you need. Do you want to restrict the EX records to one of the study drugs or do you want to consider the study drug in the sort order, e.g., select the first record with respect to EXTRT, EXSTDTC?

rossfarrugia commented 2 years ago

@oreillb1 wouldn't you use filter_addargument here to pass something like EXTRT == "DRUG X" ?

oreillb1 commented 2 years ago

We need more than filtering alone to select the required exposure records due to CRF design. Our priority 1 CRF record for drug A that defines treatment cycles requires substitution with an alternative drug B or C record from CRF log line PK timepoint records that have time collected, when our priority 1 record has time missing or Time Unknown ticked in the CRF. If we use drug B or drug C records, we take the earliest by date and time, and if drugs B or C have no time, we take the date of drug A.

bundfussr commented 2 years ago

This sounds quite study specific. However, I am not sure how the derivation should work in details.

Could you provide the specifications of the derivation?

rossfarrugia commented 2 years ago

i'm wondering if the issue could be around expectations here too, as @oreillb1 we tried to explain at https://pharmaverse.github.io/admiral/index.html how admiral will never cover all eventualities of ADaM requirements. and if we were to make arguments for every single possible study-level option then our functions would become overly complex to use, maintain and test. the challenge is figuring out when things truly are too specific to implement here, but my feeling is yours falls more into that category, as i at least never saw such a requirement in my experience. would be good to understand the spec more to make that call though so feel free to email that over to me and Stefan for a look, and we may close this issue if so. it would then be a good opportunity to try out creating a study-level function to fit your need (or even at higher level if you see the same need across your molecule for example).

oreillb1 commented 2 years ago

A study-specific solution will probably be needed whenever EX records have to be explicitly defined for [ADSL.TRTSDTM], or in ADEX parameters e.g. for Cycles and we expect to apply solutions for these at the project or molecule level. Thank you for looking into this issue and responses.

rossfarrugia commented 2 years ago

Yes agree, we've not yet got to periods/phases/cycles but in reality difficult to ever solve too much at industry level for these pieces. will close this issue and thanks for the continued feedback and testing!