fix(mimic-iii): merge overlapping line duration intervals - #2175
Open
Chessing234 wants to merge 1 commit into
Open
Chessing234 wants to merge 1 commit into
Chessing234 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MetaVision arterial and central line concepts currently emit overlapping procedure rows directly, so summing
duration_hoursdouble-counts time when a line is present. This implements the interval collapse requested in #371.Merge overlapping or touching intervals within each ICU stay using the maximum end time across all preceding intervals. Using only the immediately preceding end time would split nested intervals incorrectly. Deduplicate identical bounds before applying the window functions, preserve actual gaps and the existing CareVue extraction, and regenerate both PostgreSQL and DuckDB outputs. The resulting intervals represent time with at least one qualifying line present, not individual catheter lifetimes; the existing hour-boundary duration calculation is retained.
Fixes #371.
Validation:
git diff --checkpasses.Validation used synthetic data, not the full credentialed MIMIC-III dataset. This is scoped to the line-duration issue; the earlier combined PR #2124 removed its concept changes after the request to split them into individual PRs.