Open prockenschaub opened 2 years ago
This behavior is by design (currently). If I understand correctly, the suggestion would be to have:
id_var
would take the value based on the passed id_type
(such as icustay_id
/hosp_id
for icustay
/hosp
)index_var
value would depend only on id_type
(such as an index_var
called "icu_time"
for icustay
or "hosp_time"
for hosp
)In this way, whenever load_concepts
is invoked, meta_vars
values would not depend on the data source from which the data is loaded.
I discussed this with @nbenn, and I think this may be a good suggestion. We should perhaps allow for this in the next version of ricu
.
Problem
When combining databases (say MIMIC III and eICU), the names of the ID variables and the time variable depend on the order in which sources are passed to
load_concepts
. See the following reprex inspired by the quick start guide:As you can see, although the information is exactly the same, the names depend on the order of
src
. This prevents me for example from simply appending two concepts from different databases:Question
Am I missing something obvious here and am I supposed to do something differently? I did find the helper function
id_vars
andindex_var
that can help me recover what the names are but this seems cumbersome and does not allow me to only merge on a specific ID level (e.g. admissions) without remembering what this colum was called in the first database I passed toload_concept
.What was the reasoning underlying this design choice and would it be more practical to rename them directly to patient, hadm, and icustay, as returned e.g. by
as_id_cfg(mimic_demo)
?