Skip to content

Commit ccb6972

Browse files
authored
Merge pull request #1182 from MIT-LCP/flow_rate_fix
2 parents 4ea0513 + 204e07a commit ccb6972

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mimic-iv/concepts/measurement/oxygen_delivery.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ with ce_stg1 as
66
, ce.charttime
77
, CASE
88
-- merge o2 flows into a single row
9-
WHEN itemid IN (223834, 227582, 224691) THEN 223834
9+
WHEN itemid IN (223834, 227582) THEN 223834
1010
ELSE itemid END AS itemid
1111
, value
1212
, valuenum
@@ -18,9 +18,10 @@ with ce_stg1 as
1818
(
1919
223834 -- o2 flow
2020
, 227582 -- bipap o2 flow
21-
, 224691 -- Flow Rate (L)
2221
-- additional o2 flow is its own column
2322
, 227287 -- additional o2 flow
23+
-- below flow rate is *not* o2 flow, and not included
24+
-- , 224691 -- Flow Rate (L)
2425
)
2526
)
2627
, ce_stg2 AS

mimic-iv/concepts/measurement/ventilator_setting.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ with ce as
4848
, 223849 -- vent mode
4949
, 229314 -- vent mode (Hamilton)
5050
, 223848 -- vent type
51+
, 224691 -- Flow Rate (L)
5152
)
5253
)
5354
SELECT
@@ -64,6 +65,7 @@ SELECT
6465
, MAX(CASE WHEN itemid = 224696 THEN valuenum ELSE NULL END) AS plateau_pressure
6566
, MAX(CASE WHEN itemid in (220339, 224700) THEN valuenum ELSE NULL END) AS peep
6667
, MAX(CASE WHEN itemid = 223835 THEN valuenum ELSE NULL END) AS fio2
68+
, MAX(CASE WHEN itemid = 224691 THEN valuenum ELSE NULL END) AS flow_rate
6769
, MAX(CASE WHEN itemid = 223849 THEN value ELSE NULL END) AS ventilator_mode
6870
, MAX(CASE WHEN itemid = 229314 THEN value ELSE NULL END) AS ventilator_mode_hamilton
6971
, MAX(CASE WHEN itemid = 223848 THEN value ELSE NULL END) AS ventilator_type

0 commit comments

Comments
 (0)