-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
As raised in #1529, DATETIME_DIFF
in PostgreSQL calculates a fractional number, whereas DATETIME_DIFF
in BigQuery returns a whole number. This results in a subtle divergence of the concepts in the two dialects. urine_output_rate may be affected as various comparisons expected fractional values to be returned:
mimic-code/mimic-iv/concepts/measurement/urine_output_rate.sql
Lines 44 to 53 in a830870
-- note that we assume data charted at charttime corresponds | |
-- to 1 hour of UO, therefore we use '5' and '11' to restrict the | |
-- period, rather than 6/12 this assumption may overestimate UO rate | |
-- when documentation is done less than hourly | |
, SUM(CASE WHEN DATETIME_DIFF(io.charttime, iosum.charttime, HOUR) <= 5 | |
THEN iosum.urineoutput | |
ELSE null END) AS urineoutput_6hr | |
, SUM(CASE WHEN DATETIME_DIFF(io.charttime, iosum.charttime, HOUR) <= 5 | |
THEN iosum.tm_since_last_uo | |
ELSE null END) / 60.0 AS uo_tm_6hr |
Easiest fix is to (1) update postgres-functions.sql and (2) update the UO query to take a similar approach to the kdigo_uo query.
Metadata
Metadata
Assignees
Labels
No labels