pharmaverse / admiralophtha

Ophthalmology package extension of admiral
https://pharmaverse.github.io/admiralophtha
Apache License 2.0
15 stars 3 forks source link

General Issue: `derive_var_studyeye()` accidentally uses hardcoded subject keys #254

Closed manciniedoardo closed 2 weeks ago

manciniedoardo commented 1 month ago

Background Information

  derive_vars_merged(
    dataset_adsl,
    dataset_add = dataset_sc,
    by_vars = exprs(STUDYID, USUBJID), 
    order = NULL,
    filter_add = SCTESTCD == !!sctestcd_value,
    new_vars = exprs(STUDYEYE = SCSTRESC),
    mode = NULL,
    missing_values = exprs(STUDYEYE = "")
  ) 

Should be:

  derive_vars_merged(
    dataset_adsl,
    dataset_add = dataset_sc,
    by_vars = get_admiral_option("subject_keys"),
    order = NULL,
    filter_add = SCTESTCD == !!sctestcd_value,
    new_vars = exprs(STUDYEYE = SCSTRESC),
    mode = NULL,
    missing_values = exprs(STUDYEYE = "")
  ) 

Definition of Done

Replace problematic line!

manciniedoardo commented 1 month ago

@steventing12 mind knocking this one out too please? thanks