From 6df86e563d2d381d80ec01b96bd6ba5a1565e6a0 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 24 Jun 2026 20:52:06 +0530 Subject: [PATCH] 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 #2010. Co-authored-by: Cursor --- mimic-iii/concepts/pivot/pivoted_height.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mimic-iii/concepts/pivot/pivoted_height.sql b/mimic-iii/concepts/pivot/pivoted_height.sql index 0410e9a02..614527395 100644 --- a/mimic-iii/concepts/pivot/pivoted_height.sql +++ b/mimic-iii/concepts/pivot/pivoted_height.sql @@ -52,8 +52,8 @@ WITH ht_in AS , ht_stg0 AS ( SELECT - COALESCE(h1.subject_id, h1.subject_id) as subject_id - , COALESCE(h1.charttime, h1.charttime) AS charttime + COALESCE(h1.subject_id, h2.subject_id) as subject_id + , COALESCE(h1.charttime, h2.charttime) AS charttime , COALESCE(h1.height, h2.height) as height FROM ht_cm h1 FULL OUTER JOIN ht_in h2