Skip to content

Recursively passing arguments to lower-level concepts  #18

@prockenschaub

Description

@prockenschaub

Some callbacks rely on additional arguments depending on the database. For example, eICU does not contain reliable fluid sampling so sepsis definitions may need to be based on antibiotics alone. susp_inf allows to specify the si_mode parameter to do so.

library(ricu)
so <- load_concepts("sofa", "eicu_demo", verbose = FALSE)
si <- load_concepts("susp_inf", "eicu_demo", si_mode = "abx", verbose = FALSE)
se <- sep3(sofa = so, susp_inf = si)

This will lead to a different result than the default sepsis-3 calculation:

se_std <- load_concepts("sep3", "eicu_demo", verbose = FALSE)
setequal(se, se_std)
#> [1] FALSE

Problem

Currently, the above cannot be loaded directly

se_std <- load_concepts("sep3", "eicu_demo", verbose = FALSE)
setequal(se, se_std)
#> Error in `assert_that()`:
#> ! setequal(x = names(dots), y = concepts) is not TRUE

The reason for this is twofold:

  1. collect_dots currently only allows for concepts to be passed via ..., which leads to the above error when the sep3 callback is executed. I may be missing something here but to me this seems unnecessarily restrictive.
  2. Even if collect_dots accepted other parameters, those parameters would not be be passed down to the lower-level concepts.

ricu/R/concept-load.R

Lines 496 to 498 in 4a64d6b

ext <- list(patient_ids = patient_ids, id_type = id_type,
interval = coalesce(x[["interval"]], interval),
progress = progress)

(Potential) Solution

Change the behaviour of collect_dots and add ... to ext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions