MIT-LCP / mimic-code

MIMIC Code Repository: Code shared by the research community for the MIMIC family of databases
https://mimic.mit.edu
MIT License
2.48k stars 1.5k forks source link

How to determine if a patient has NIV or Invasive ventilation when ventilator is not a Hamilton #1446

Open snowgato opened 1 year ago

snowgato commented 1 year ago

Prerequisites

Ventilation.sql after defining thracheostomy ventilation mode, defines ventilation_status as InvasiveVent

WHEN o2_delivery_device_1 IN
(
    'Endotracheal tube'
)
OR ventilator_mode IN
(
    '(S) CMV',
    'APRV',
    'APRV/Biphasic+ApnPress',
    'APRV/Biphasic+ApnVol',
    'APV (cmv)',
    'Ambient',
    'Apnea Ventilation',
    'CMV',
    'CMV/ASSIST',
    'CMV/ASSIST/AutoFlow',
    'CMV/AutoFlow',
    'CPAP/PPS',
    'CPAP/PSV+Apn TCPL',
    'CPAP/PSV+ApnPres',
    'CPAP/PSV+ApnVol',
    'MMV',
    'MMV/AutoFlow',
    'MMV/PSV',
    'MMV/PSV/AutoFlow',
    'P-CMV',
    'PCV+',
    'PCV+/PSV',
    'PCV+Assist',
    'PRES/AC',
    'PRVC/AC',
    'PRVC/SIMV',
    'PSV/SBT',
    'SIMV',
    'SIMV/AutoFlow',
    'SIMV/PRES',
    'SIMV/PSV',
    'SIMV/PSV/AutoFlow',
    'SIMV/VOL',
    'SYNCHRON MASTER',
    'SYNCHRON SLAVE',
    'VOL/AC'
)
OR ventilator_mode_hamilton IN
(
    'APRV',
    'APV (cmv)',
    'Ambient',
    '(S) CMV',
    'P-CMV',
    'SIMV',
    'APV (simv)',
    'P-SIMV',
    'VS',
    'ASV'
)

and NonInvasiveVent by:

WHEN o2_delivery_device_1 IN
(
    'Bipap mask ', -- 8997 observations
    'CPAP mask ' -- 5568 observations
)
OR ventilator_mode_hamilton IN
(
    'DuoPaP',
    'NIV',
    'NIV-ST'
)
    THEN 'NonInvasiveVent'

In oxygen_delivery table, there are oxygen_delivery_device_1, o2_delivery_device_2, o2_delivery_device_3, o2_delivery_device_4 that are filled by alphabetical order with o2 delivery device names if there are more than once at the same time. In case of several simultaneous oxygen delivery devices connected, as Bipap mask, or CPAP mask may not be the first to appear in the alphabetical order, I would say that Non Invasive ventilation detection could be missed just focusing on o2_delivery_device_1 without considering o2_delivery_device_2, o2_delivery_device_3 and o2_delivery_device_4.

For patients, I am interested in, no one has in oxygen_delivery table records of 'Bipap mask', some have records with 'CPAP mask'

Looking at ventilator_setting records for these patients , I don't find any records with charttimes closely related to oxygen_delivery charttime records when oxygen_delivery_device_1 or 2 or3 or 4 is set to 'CPAP mask'. I find quite odd, not to find even a PEEP or fiO2 setting for a non Invasive ventilation with 'CPAP mask'. These patients are connected to a ventilator for NIV, but there are no ventilator settings.

What puzzles me too is that Non Invasive ventilation is defined by the interface ('Bipap mask' or 'CPAP mask') or by ventilation_mode_hamilton set to 'DuoPaP', 'NIV', 'NIV-ST' . Thus when a ventilator ,that is not a hamilton, is used , the determination of Non Invasive ventilation doesn't rely at all on the ventilator mode, probably because they may not have a fully specific NIV mode. I guess then that the NIV modes for these non hamilton ventilator are mixed-use and can be also used in Invasive ventilation. Therefore, I am wondering if these mixed Invasive Ventilation/Non Invasive ventilation modes for non Hamilton ventilators, may be part of those defining ventilation_status as InvasiveVent as defined in ventilation.sql.

If all that is clear to someone, thanks very much in advance for your help and explanations ! Cedric

Description

Description of the issue, including:

alistairewj commented 1 year ago

In case of several simultaneous oxygen delivery devices connected, as Bipap mask, or CPAP mask may not be the first to appear in the alphabetical order, I would say that Non Invasive ventilation detection could be missed just focusing on o2_delivery_device_1 without considering o2_delivery_device_2, o2_delivery_device_3 and o2_delivery_device_4.

Good point - worth a fix.

What puzzles me too is that Non Invasive ventilation is defined by the interface ('Bipap mask' or 'CPAP mask') or by ventilation_mode_hamilton set to 'DuoPaP', 'NIV', 'NIV-ST' . Thus when a ventilator ,that is not a hamilton, is used , the determination of Non Invasive ventilation doesn't rely at all on the ventilator mode, probably because they may not have a fully specific NIV mode. I guess then that the NIV modes for these non hamilton ventilator are mixed-use and can be also used in Invasive ventilation. Therefore, I am wondering if these mixed Invasive Ventilation/Non Invasive ventilation modes for non Hamilton ventilators, may be part of those defining ventilation_status as InvasiveVent as defined in ventilation.sql.

When I tried to define NIV in a multi-hospital dataset it was difficult to determine a consistent set of rules that worked across the board, so the logic here is fairly limited based on that experience. I definitely think there's room for improvement, particularly as the non-Invasive ventilation procedure in procedureevents could act as a sensitive ground truth for confirming if the code is working well.