alistairewj/sepsis3-mimic

Issue on abx_micro_poe time windows

mmr12 opened this issue · 2 comments

mmr12 commented

On line: https://github.com/alistairewj/sepsis3-mimic/blob/master/query/tbls/abx-micro-prescription.sql#L89

When setting the intervals between cultures and antibiotics, in specific looking at the 24h prior the sampling, I disagree with the interval here:
-- if charttime is not available, use chartdate me24.charttime is null and ab_tbl.antibiotic_time > me24.chartdate and ab_tbl.antibiotic_time <= me24.chartdate + interval '24' hour

Say ab = 4 and me = 12,
then ab < me; this violates the first constraint (
and ab_tbl.antibiotic_time > me24.chartdate

hence I would have this
-- if charttime is not available, use chartdate me24.charttime is null and ab_tbl.antibiotic_time > me24.chartdate - interval '24' hour and ab_tbl.antibiotic_time <= me24.chartdate

mmr12 commented

Got it, thank you for the explanation!