eth-mds / ricu

🏥 ICU data with R 🏥
https://eth-mds.github.io/ricu/
GNU General Public License v3.0
35 stars 10 forks source link

Update MIMIC IV to version 2.2 #45

Closed prockenschaub closed 9 months ago

prockenschaub commented 1 year ago

MIMIC IV has introduced several changes to the data structure, including new tables and columns. This has lead to several issues for new users: #15 #28 #33 #42 #44

NOTE: this PR breaks backward compatibility with prior MIMIC IV versions. Fixing access to previous versions of the data is in process.

nbenn commented 1 year ago

@prockenschaub This is a pure config change, so in terms of review comments, I don't have much to offer. Have you tried something like "loading all concepts from new mimic iv" to check compatibility of current concept definitions with the new data source definition?

nbenn commented 1 year ago

The check CI failures seem unrelated. I'm happy to sort this out post-merge.

prockenschaub commented 11 months ago

I ran all non-recursive concepts and the difference was a drop in 4-5% of rows across all concepts. This should be due to a reduction in patients for version 2.2. I didn't run recursive concepts because collect_dots inload_concepts.cncpt currently throws an error if I pass src as config (related to #19).

Sys.setenv(RICU_SRC_LOAD = "")
library(ricu)

# Get concepts
dict <- load_dictionary(src = "miiv")

# Get custom miiv config
cfg <- load_src_cfg(name = "miiv-1.0", cfg_dirs = "/path/to/miiv/versions")
attach_src(cfg$miiv, data_dir = "/path/to/miiv-1.0/data")

# Try to load a recursive concept
load_concepts(dict[["avpu"]], src = data$miiv)
#> • gcs
#> • egcs
#> • mgcs
#> • vgcs
#> • tgcs
#> • ett_gcs
#> Error in `assert_that()` at ricu-package/R/callback-cncpt.R:10:4:
#> ! length(dots) not identical to 1L
#> Run `rlang::last_trace()` to see where the error occurred.

I nevertheless think this is a sufficient check and this can be merged now.

dplecko commented 9 months ago

Solved in ricu 0.6.0.