Skip to content

Commit 6df86e5

Browse files
fix(height): coalesce join keys from h2 in MIMIC-III pivoted height
The FULL OUTER JOIN between cm and inch height measurements used COALESCE(h1.subject_id, h1.subject_id) (and the same for charttime), dropping rows that only appear in h2. Use h2 for the fallback keys. Related to MIT-LCP#2010. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5706978 commit 6df86e5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mimic-iii/concepts/pivot/pivoted_height.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ WITH ht_in AS
5252
, ht_stg0 AS
5353
(
5454
SELECT
55-
COALESCE(h1.subject_id, h1.subject_id) as subject_id
56-
, COALESCE(h1.charttime, h1.charttime) AS charttime
55+
COALESCE(h1.subject_id, h2.subject_id) as subject_id
56+
, COALESCE(h1.charttime, h2.charttime) AS charttime
5757
, COALESCE(h1.height, h2.height) as height
5858
FROM ht_cm h1
5959
FULL OUTER JOIN ht_in h2

0 commit comments

Comments
 (0)