MIT-LCP / MIT-LCP/mimic-code

time interval used in kdigo-uo.sql

Open
#476 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mimic-iii
Dominant language
Jupyter Notebook
Stars
3.4k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

To calculate urine ouput over 3 periods, that is:

  -- three sums:
  -- 1) over a 6 hour period
  -- 2) over a 12 hour period
  -- 3) over a 24 hour period

The code in mimic-code/concepts/organfailure/kdigo-uo.sql is:

  , sum(case when iosum.charttime <= io.charttime + interval '5' hour
      then iosum.VALUE
    else null end) as UrineOutput_6hr
  , sum(case when iosum.charttime <= io.charttime + interval '11' hour
      then iosum.VALUE
    else null end) as UrineOutput_12hr
  , sum(iosum.VALUE) as UrineOutput_24hr
....
and iosum.charttime <= (io.charttime + interval '23' hour)
....

The 3 intervals used were 5/11/23 hrs. And later in kdigo-stages-48hr.sql and kdigo-stages-7days.sql:

..
min(uo.urineoutput_6hr / uo.weight / 6.0)::numeric as uo6
...
, min(uo.urineoutput_12hr / uo.weight / 12.0)::numeric as uo12
...
, min(uo.urineoutput_24hr / uo.weight / 24.0)::numeric as uo24
...

so, shouldn't the above intervals be 6/12/24 hrs?

And in the comments from kdigo-stages-48hr.sql and kdigo-stages-7days.sql:

-- For urine output: the highest UO in hours 0-48 is used

Aren't we using the lowest UO as seen from the code above min()?

Correct me if I am missing something here, thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with mimic-code/concepts/organfailure/kdigo-uo.sql, then compare the interval calculations with kdigo-stages-48hr.sql and kdigo-stages-7days.sql. Check how the documented 6-, 12-, and 24-hour windows relate to the 5/11/23-hour bounds and whether min() matches the comments about the highest urine output. Done means the SQL behavior and its comments consistently express the intended KDIGO calculation.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.