Skip to content

Commit b1cdb21

Browse files
committed
add crrt to kdigo concept
1 parent 1ff562b commit b1cdb21

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

mimic-iv/concepts_postgres/organfailure/kdigo_stages.sql

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ with cr_stg AS
6666
SELECT
6767
stay_id, charttime
6868
FROM uo_stg
69+
),
70+
-- get CRRT data
71+
crrt_stg AS (
72+
SELECT
73+
stay_id,
74+
charttime,
75+
CASE
76+
WHEN charttime IS NOT NULL THEN 3
77+
ELSE NULL END AS aki_stage_crrt
78+
FROM mimic_derived.crrt
6979
)
7080
select
7181
ie.subject_id
@@ -80,10 +90,12 @@ select
8090
, uo.uo_rt_12hr
8191
, uo.uo_rt_24hr
8292
, uo.aki_stage_uo
93+
, crrt.aki_stage_crrt
8394
-- Classify AKI using both creatinine/urine output criteria
8495
, GREATEST(
8596
COALESCE(cr.aki_stage_creat,0),
86-
COALESCE(uo.aki_stage_uo,0)
97+
COALESCE(uo.aki_stage_uo,0),
98+
COALESCE(crrt.aki_stage_crrt,0)
8799
) AS aki_stage
88100
FROM mimiciv_icu.icustays ie
89101
-- get all possible charttimes as listed in tm_stg
@@ -95,4 +107,7 @@ LEFT JOIN cr_stg cr
95107
LEFT JOIN uo_stg uo
96108
ON ie.stay_id = uo.stay_id
97109
AND tm.charttime = uo.charttime
110+
LEFT JOIN crrt_stg crrt
111+
ON ie.stay_id = crrt.stay_id
112+
AND tm.charttime = crrt.charttime
98113
;

0 commit comments

Comments
 (0)