1- -- Calculate duration of mechanical ventilation.
1+ -- Classify oxygen devices into six relevant clinical categories in ordinal fashion
2+ -- Invasive oxygen delivery types:
3+ -- Tracheostomy (with or without positive pressure ventilation)
4+ -- InvasiveVent (positive pressure ventilation via endotracheal tube, could be oro/nasotracheal or tracheostomy)
5+ -- Non invasive oxygen delivery types (divided similar to doi:10.1001/jama.2020.9524):
6+ -- NonInvasiveVent (non-invasive positive pressure ventilation)
7+ -- HFNC (high flow nasal oxygen / cannula)
8+ -- SupplementalOxygen (all other non-rebreather, facemask, face tent, nasal prongs...)
9+ -- No oxygen device:
10+ -- None
211-- Some useful cases for debugging:
312-- stay_id = 30019660 has a tracheostomy placed in the ICU
413-- stay_id = 30000117 has explicit documentation of extubation
@@ -23,10 +32,12 @@ WITH tm AS
2332 -- tracheostomy
2433 WHEN o2_delivery_device_1 IN
2534 (
26- ' Tracheostomy tube'
27- -- 'Trach mask ' -- 16435 observations
35+ ' Tracheostomy tube' ,
36+ ' Trach mask ' -- 16435 observations
37+ -- 'T-piece', -- 1135 observations (T-piece could be either InvasiveVent or Tracheostomy)
38+
2839 )
29- THEN ' Trach '
40+ THEN ' Tracheostomy '
3041 -- mechanical ventilation
3142 WHEN o2_delivery_device_1 IN
3243 (
@@ -98,30 +109,31 @@ WITH tm AS
98109 ' NIV-ST'
99110 )
100111 THEN ' NonInvasiveVent'
101- -- high flow
102- when o2_delivery_device_1 IN
112+ -- high flow nasal cannula
113+ when o2_delivery_device_1 IN
103114 (
104- ' High flow neb' , -- 10785 observations
105115 ' High flow nasal cannula' -- 925 observations
106116 )
107- THEN ' HighFlow '
108- -- normal oxygen delivery
117+ THEN ' HFNC '
118+ -- non rebreather
109119 WHEN o2_delivery_device_1 in
110- (
111- ' Nasal cannula ' , -- 153714 observations
120+ (
121+ ' Non-rebreather ' , -- 5182 observations
112122 ' Face tent' , -- 24601 observations
113123 ' Aerosol-cool' , -- 24560 observations
114- ' Non-rebreather' , -- 5182 observations
115124 ' Venti mask ' , -- 1947 observations
116125 ' Medium conc mask ' , -- 1888 observations
117- ' T-piece' , -- 1135 observations
118126 ' Ultrasonic neb' , -- 9 observations
119127 ' Vapomist' , -- 3 observations
120- ' Oxymizer' -- 1301 observations
121- )
122- THEN ' Oxygen'
123- -- Not categorized:
124- -- 'Other', 'None'
128+ ' Oxymizer' , -- 1301 observations
129+ ' High flow neb' , -- 10785 observations
130+ ' Nasal cannula' )
131+ then ' SupplementalOxygen'
132+ WHEN o2_delivery_device_1 in
133+ (
134+ ' None' )
135+ THEN ' None'
136+ -- not categorized: other
125137 ELSE NULL END AS ventilation_status
126138 FROM tm
127139 LEFT JOIN ` physionet-data.mimic_derived.ventilator_setting` vs
0 commit comments