Skip to content

Commit 9d394c1

Browse files
docs(mimic-iv): sample query for chartevents before intime
Complement the after-outtime audit for #1961 sensitivity checks. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 94f5328 commit 9d394c1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Count chartevents charted before ICU intime (less common than after outtime).
2+
3+
SELECT
4+
COUNT(*) AS before_intime,
5+
COUNT(*) FILTER (
6+
WHERE ce.charttime < ie.intime
7+
AND ce.charttime >= ie.intime - INTERVAL '2 hours'
8+
) AS before_intime_within_2h
9+
FROM icu.chartevents AS ce
10+
INNER JOIN icu.icustays AS ie
11+
ON ce.stay_id = ie.stay_id
12+
WHERE ce.charttime < ie.intime;

0 commit comments

Comments
 (0)