Skip to content

Commit 94f5328

Browse files
docs(mimic-iv): add chartevents-after-outtime audit query
Give researchers a concrete count for the #1961 offset pattern. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cc73b41 commit 94f5328

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Count chartevents whose charttime falls after the linked ICU stay outtime.
2+
-- Useful as a sensitivity check when building in-ICU only cohorts (#1961).
3+
4+
SELECT
5+
COUNT(*) AS chartevents_rows,
6+
COUNT(*) FILTER (WHERE ce.charttime > ie.outtime) AS after_outtime,
7+
COUNT(*) FILTER (
8+
WHERE ce.charttime > ie.outtime
9+
AND ce.charttime <= ie.outtime + INTERVAL '6 hours'
10+
) AS after_outtime_within_6h
11+
FROM icu.chartevents AS ce
12+
INNER JOIN icu.icustays AS ie
13+
ON ce.stay_id = ie.stay_id;

0 commit comments

Comments
 (0)