File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
mimic-iv/concepts_postgres/organfailure Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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)
7080select
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
88100FROM mimiciv_icu .icustays ie
89101-- get all possible charttimes as listed in tm_stg
@@ -95,4 +107,7 @@ LEFT JOIN cr_stg cr
95107LEFT 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;
You can’t perform that action at this time.
0 commit comments