Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ WITH mv AS (
icustay_id,
charttime,
charttime_lag,
charttime - charttime_lag AS arterial_line_duration,
DATE_DIFF('HOUR', charttime_lag, charttime) AS arterial_line_duration,
CASE WHEN DATE_DIFF('HOUR', charttime_lag, charttime) > 16 THEN 1 ELSE 0 END AS arterial_line_new
FROM cv0
), cv2 AS (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ WITH mv AS (
icustay_id,
charttime,
charttime_lag,
charttime - charttime_lag AS central_line_duration,
DATE_DIFF('HOUR', charttime_lag, charttime) AS central_line_duration,
CASE WHEN DATE_DIFF('HOUR', charttime_lag, charttime) > 16 THEN 1 ELSE 0 END AS central_line_new
FROM cv0
), cv2 AS (
Expand Down
5 changes: 4 additions & 1 deletion mimic-iii/concepts_duckdb/organfailure/kdigo_stages.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ WITH cr_stg AS (
THEN 3
WHEN cr.creat >= 4
AND (
cr.creat_low_past_48hr <= 3.7 OR cr.creat >= (
cr.creat >= (
cr.creat_low_past_48hr + 0.3
)
OR cr.creat >= (
1.5 * cr.creat_low_past_7day
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ WITH mv AS (
icustay_id,
charttime,
charttime_lag, /* if the current observation indicates a line is present */ /* calculate the time since the last charted line */
charttime - charttime_lag AS arterial_line_duration, /* now we determine if the current line is "new" */ /* new == no documentation for 16 hours */
CAST(EXTRACT(EPOCH FROM DATE_TRUNC('hour', charttime) - DATE_TRUNC('hour', charttime_lag)) / 3600 AS BIGINT) AS arterial_line_duration, /* now we determine if the current line is "new" */ /* new == no documentation for 16 hours */
CASE
WHEN CAST(EXTRACT(EPOCH FROM DATE_TRUNC('hour', charttime) - DATE_TRUNC('hour', charttime_lag)) / 3600 AS BIGINT) > 16
THEN 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ WITH mv AS (
icustay_id,
charttime,
charttime_lag, /* if the current observation indicates a line is present */ /* calculate the time since the last charted line */
charttime - charttime_lag AS central_line_duration, /* now we determine if the current line is "new" */ /* new == no documentation for 16 hours */
CAST(EXTRACT(EPOCH FROM DATE_TRUNC('hour', charttime) - DATE_TRUNC('hour', charttime_lag)) / 3600 AS BIGINT) AS central_line_duration, /* now we determine if the current line is "new" */ /* new == no documentation for 16 hours */
CASE
WHEN CAST(EXTRACT(EPOCH FROM DATE_TRUNC('hour', charttime) - DATE_TRUNC('hour', charttime_lag)) / 3600 AS BIGINT) > 16
THEN 1
Expand Down
13 changes: 8 additions & 5 deletions mimic-iii/concepts_postgres/organfailure/kdigo_stages.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ WITH cr_stg AS (
)
THEN 3
WHEN cr.creat >= 4
-- For patients reaching Stage 3 by SCr >4.0 mg/dl
-- require that the patient first achieve ... acute increase >= 0.3 within 48 hr
-- *or* an increase of >= 1.5 times baseline
and (cr.creat >= (cr.creat_low_past_48hr+0.3) OR cr.creat >= (1.5*cr.creat_low_past_7day))
then 3
AND /* For patients reaching Stage 3 by SCr >4.0 mg/dl */ /* require that the patient first achieve ... acute increase >= 0.3 within 48 hr */ /* *or* an increase of >= 1.5 times baseline */ (
cr.creat >= (
cr.creat_low_past_48hr + 0.3
)
OR cr.creat >= (
1.5 * cr.creat_low_past_7day
)
)
THEN 3
WHEN cr.creat >= (
cr.creat_low_past_7day * 2.0
Expand Down
Loading