mimic-code icon indicating copy to clipboard operation
mimic-code copied to clipboard

`DATETIME_DIFF` implementation varies between postgres and bigquery

Open alistairewj opened this issue 1 year ago • 0 comments

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:

https://github.com/MIT-LCP/mimic-code/blob/a8308706d8f2bf3bbf42f5e7065094c648f64576/mimic-iv/concepts/measurement/urine_output_rate.sql#L44-L53

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.

alistairewj avatar May 17 '23 18:05 alistairewj