Skip to content

Commit 1be5b53

Browse files
fix: use DATETIME_DIFF in neuroblock_dose for BigQuery
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4cf9855 commit 1be5b53

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mimic-iii/concepts/durations/neuroblock_dose.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ select
179179
)
180180
= 1 then 1
181181

182-
when (CHARTTIME - (LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime))) > (interval '8 hours') then 1
182+
when DATETIME_DIFF(
183+
CHARTTIME,
184+
LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime),
185+
HOUR
186+
) > 8 then 1
183187
else null
184188
end as drug_start
185189

0 commit comments

Comments
 (0)