Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistencies in respiratory system scores between first_day_sofa.sql and sofa.sql #1806

Open
1 task done
weilidr opened this issue Sep 26, 2024 · 0 comments
Open
1 task done

Comments

@weilidr
Copy link

weilidr commented Sep 26, 2024

Prerequisites

Description

Description of the issue, including:

Greetings!

  • [1] I have identified an inconsistency between first_day_sofa.sql and sofa.sql concerning the calculation of respiratory system scores. Specifically, first_day_sofa.sql does not restrict the respiratory system scores to records where specimen = 'ART.'

sofa.sql is

pafi AS (
  /* join blood gas to ventilation durations to determine if patient was vent */
  SELECT
    ie.stay_id,
    bg.charttime, /* because pafi has an interaction between vent/PaO2:FiO2, */ /* we need two columns for the score */ /* it can happen that the lowest unventilated PaO2/FiO2 is 68, */ /* but the lowest ventilated PaO2/FiO2 is 120 */ /* in this case, the SOFA score is 3, *not* 4. */
    CASE WHEN vd.stay_id IS NULL THEN pao2fio2ratio ELSE NULL END AS pao2fio2ratio_novent,
    CASE WHEN NOT vd.stay_id IS NULL THEN pao2fio2ratio ELSE NULL END AS pao2fio2ratio_vent
  FROM mimiciv_icu.icustays AS ie
  INNER JOIN mimiciv_derived.bg AS bg
    ON ie.subject_id = bg.subject_id
  LEFT JOIN mimiciv_derived.ventilation AS vd
    ON ie.stay_id = vd.stay_id
    AND bg.charttime >= vd.starttime
    AND bg.charttime <= vd.endtime
    AND vd.ventilation_status = 'InvasiveVent'
  WHERE
    specimen = 'ART.'
)

while first_day_sofa.sql is missing the restriction for arterial pO2, specifically WHERE specimen = 'ART.'

pafi1 AS (
  /* join blood gas to ventilation durations to determine if patient was vent */
  SELECT
    ie.stay_id,
    bg.charttime,
    bg.pao2fio2ratio,
    CASE WHEN NOT vd.stay_id IS NULL THEN 1 ELSE 0 END AS isvent
  FROM mimiciv_icu.icustays AS ie
  LEFT JOIN mimiciv_derived.bg AS bg
    ON ie.subject_id = bg.subject_id
    AND bg.charttime >= ie.intime - INTERVAL '6 HOUR'
    AND bg.charttime <= ie.intime + INTERVAL '1 DAY'
  LEFT JOIN mimiciv_derived.ventilation AS vd
    ON ie.stay_id = vd.stay_id
    AND bg.charttime >= vd.starttime
    AND bg.charttime <= vd.endtime
    AND vd.ventilation_status = 'InvasiveVent'
)
  • [2] Regarding the restriction of vd.ventilation_status = 'InvasiveVent'
    I am confused about whether the respiratory support in the SOFA score includes only invasive mechanical ventilation, why not include vd.ventilation_status = 'NonInvasiveVent'? Non-invasive mechanical ventilation also provides respiratory support, yet the original SOFA literature seems to lack a clear definition of what constitutes respiratory support. Interestingly, the Berlin definition for ARDS appears to include non-invasive mechanical ventilation as well.
    Which one is more appropriate?
    vd.ventilation_status = 'InvasiveVent
    v.ventilation_status in ('InvasiveVent', 'NonInvasiveVent')
    v.ventilation_status in ('InvasiveVent', 'Tracheostomy', 'NonInvasiveVent')

Thank you for your attention to this matter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant