Skip to content

Commit 7c41c2d

Browse files
committed
fix imputation of abs cell counts, closes #1208
1 parent ad293e2 commit 7c41c2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mimic-iv/concepts/measurement/blood_differential.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,27 @@ subject_id, hadm_id, charttime, specimen_id
9696
-- impute absolute count if percentage & WBC is available
9797
, ROUND(CASE
9898
WHEN basophils_abs IS NULL AND basophils IS NOT NULL AND impute_abs = 1
99-
THEN basophils * wbc
99+
THEN basophils * wbc / 100
100100
ELSE basophils_abs
101101
END, 4) AS basophils_abs
102102
, ROUND(CASE
103103
WHEN eosinophils_abs IS NULL AND eosinophils IS NOT NULL AND impute_abs = 1
104-
THEN eosinophils * wbc
104+
THEN eosinophils * wbc / 100
105105
ELSE eosinophils_abs
106106
END, 4) AS eosinophils_abs
107107
, ROUND(CASE
108108
WHEN lymphocytes_abs IS NULL AND lymphocytes IS NOT NULL AND impute_abs = 1
109-
THEN lymphocytes * wbc
109+
THEN lymphocytes * wbc / 100
110110
ELSE lymphocytes_abs
111111
END, 4) AS lymphocytes_abs
112112
, ROUND(CASE
113113
WHEN monocytes_abs IS NULL AND monocytes IS NOT NULL AND impute_abs = 1
114-
THEN monocytes * wbc
114+
THEN monocytes * wbc / 100
115115
ELSE monocytes_abs
116116
END, 4) AS monocytes_abs
117117
, ROUND(CASE
118118
WHEN neutrophils_abs IS NULL AND neutrophils IS NOT NULL AND impute_abs = 1
119-
THEN neutrophils * wbc
119+
THEN neutrophils * wbc / 100
120120
ELSE neutrophils_abs
121121
END, 4) AS neutrophils_abs
122122

0 commit comments

Comments
 (0)