Skip to content

Commit

Permalink
Includes SQL query to fetch ntprobnb lab results in cardiac markers c…
Browse files Browse the repository at this point in the history
…oncept
  • Loading branch information
pedrogemal committed Dec 9, 2021
1 parent ccb6972 commit 7fdc98a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mimic-iv/concepts/measurement/cardiac_marker.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ SELECT
, MAX(charttime) AS charttime
, le.specimen_id
-- convert from itemid into a meaningful column
, MAX(CASE WHEN itemid = 51002 THEN value ELSE NULL END) AS troponin_i
, MAX(CASE WHEN itemid = 51003 THEN value ELSE NULL END) AS troponin_t
, MAX(CASE WHEN itemid = 50911 THEN valuenum ELSE NULL END) AS ck_mb
, MAX(CASE WHEN itemid = 50963 THEN valuenum ELSE NULL END) AS ntprobnp
FROM mimic_hosp.labevents le
WHERE le.itemid IN
(
-- 51002, -- Troponin I (troponin-I is not measured in MIMIC-IV)
-- 52598, -- Troponin I, point of care, rare/poor quality
51003, -- Troponin T
50911 -- Creatinine Kinase, MB isoenzyme
50911, -- Creatinine Kinase, MB isoenzyme
50963 -- N-terminal (NT)-pro hormone BNP (NT-proBNP)
)
AND valuenum IS NOT NULL
GROUP BY le.specimen_id
;

0 comments on commit 7fdc98a

Please sign in to comment.