Skip to content

Commit f07d661

Browse files
author
Alistair Johnson
committed
refactor cast call to datetime for easier postgres compatibility
1 parent 0af68e4 commit f07d661

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mimic-iv/concepts/sepsis/suspicion_of_infection.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ WITH ab_tbl AS
4141
, ab_tbl.ab_id
4242

4343
, me72.micro_specimen_id
44-
, coalesce(me72.charttime, CAST(me72.chartdate AS DATETIME)) as last72_charttime
44+
, coalesce(me72.charttime, DATETIME(me72.chartdate)) as last72_charttime
4545
, me72.positiveculture as last72_positiveculture
4646
, me72.spec_type_desc as last72_specimen
4747

@@ -83,7 +83,7 @@ WITH ab_tbl AS
8383
, ab_tbl.ab_id
8484

8585
, me24.micro_specimen_id
86-
, COALESCE(me24.charttime, CAST(me24.chartdate AS DATETIME)) as next24_charttime
86+
, COALESCE(me24.charttime, DATETIME(me24.chartdate)) as next24_charttime
8787
, me24.positiveculture as next24_positiveculture
8888
, me24.spec_type_desc as next24_specimen
8989

0 commit comments

Comments
 (0)