fix(mimic-iii): do not bridge paused vasopressor gaps - #2121
Conversation
MetaVision vasopressor_durations collapsed rows by linkorderid with min(starttime)/max(endtime). After a Paused status that leaves a gap (median ~1h), that incorrectly counted the pause as infusion time. Keep each inputevents_mv row as its own interval; vasomv_grp still merges contiguous/overlapping intervals. Fixes MIT-LCP#1808
Chessing234
left a comment
There was a problem hiding this comment.
nice catch on the linkorderid collapse — that paused gap example (~6h) really shouldn't get glued into one interval. leaving vasomv_grp to merge only contiguous/overlapping bits feels like the right split. maybe worth a one-liner in the test plan for a non-paused contiguous pair still merging, just so nobody regresses that later.
|
not bridging paused vaso gaps is the right clinical call. can you cite the duration threshold you used in the pr description? |
|
keeping paused gaps as separate intervals matches the raw inputevents_mv semantics better than collapsing on linkorderid. can you add a short comment in the sql citing the paused-gap example so future edits dont reintroduce the group by? |
Chessing234
left a comment
There was a problem hiding this comment.
dropping the linkorderid min/max collapse is the right fix for paused vaso gaps — contiguous merge in vasomv_grp still covers true overlaps. mirrored across dialects which is what this repo needs. a one-line comment in the postgres/duckdb copies pointing at #1808 (like the bq file already has) would help the next reader.
Summary
GROUP BY linkorderid+min/maxtimesinputevents_mvrow as its own interval;vasomv_grpstill merges contiguous/overlapping intervalsTest plan
GROUP BY linkorderidremains invasomvlinkorderid = 8781494(Paused gap ~6h) yields separate durations, not one bridged intervalvasomv_grpvasopressor_durationsgrouped MetaVision rows bylinkorderidand tookmin(starttime)/max(endtime). That is correct when successive rows abut, but afterstatusdescription = 'Paused'there is often a multi-hour gap (see #1808, median ~1h 11m). Bridging that gap overstates vasopressor exposure. Drop thelinkorderidcollapse and let the existing overlap-merge (vasomv_grp) join only contiguous/overlapping intervals.Fixes #1808