eth-mds / ricu

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

Mech_vent giving null matrix return #8

Closed royarkaprava closed 11 months ago

royarkaprava commented 2 years ago

Hi, Is there any issue with this command load_concepts("mech_vent", "mimic"). It is giving me null output.

-Arkaprava

dplecko commented 11 months ago

Hi,

Upon looking at the definition for mech_vent on mimic:

> get_config("concept-dict")[["mech_vent"]][["sources"]][["mimic"]]
NULL

one can see that this concept is not defined on mimic. The reason for this is the heterogeneity of data in MIMIC-III (i.e., for carevue data, distinguishing between invasive/non-invasive ventilation is not possible). Therefore, on mimic one may use vent_start, vent_end, and vent_ind, which are a bit less informative, e.g.,

> load_concepts("vent_ind", "mimic")
-- Loading 1 concept -------------------------------------------------------------
* vent_ind                                                                      
* vent_start
* vent_end
* mech_vent
----------------------------------------------------------------------------------
# A `win_tbl`:  1,041,862 x 4
# Id var:       `icustay_id`
# Index var:    `starttime` (1 hours)
# Duration var: `vent_dur`
          icustay_id starttime vent_dur vent_ind
               <int> <drtn>    <drtn>   <lgl>
1             200003 22 hours  28 hours TRUE
2             200003 23 hours  29 hours TRUE
3             200003 27 hours  33 hours TRUE
4             200003 31 hours  37 hours TRUE
5             200003 32 hours  38 hours TRUE
...
1,041,858     299998 10 hours   3 hours TRUE
1,041,859     299998 13 hours   0 hours TRUE
1,041,860     299999 10 hours   3 hours TRUE
1,041,861     299999 12 hours   1 hours TRUE
1,041,862     299999 13 hours   0 hours TRUE
# i 1,041,857 more rows
# i Use `print(n = ...)` to see more rows