Skip to content

Commit e13d29c

Browse files
committed
database compatibility
1 parent 36d5a23 commit e13d29c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

models/readmissions/intermediate/readmissions__encounter_overlap.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
with encounter_enhanced as (
88
select
99
*
10-
-- Calculate actual length of stay in days
1110
, COALESCE(
1211
case
13-
when discharge_date >= admit_date
14-
then discharge_date - admit_date + 1
15-
else 1
12+
when {{ dbt.datediff("discharge_date", "admit_date","day") }} >= 1
13+
then {{ dbt.datediff("discharge_date", "admit_date","day") }}
1614
end
1715
, 1
1816
) as actual_length_of_stay

0 commit comments

Comments
 (0)