Skip to content

Commit 67ad6b3

Browse files
committed
fix(mimic-iv): do not treat CANCELLED cultures as positive
suspicion_of_infection marked any non-empty org_name as positiveculture except NEGATIVE (90856). CANCELLED (90760) is not organism growth; exclude it (and the CANCELLED label) so positive_culture stays accurate. Fixes #1677
1 parent 780de1c commit 67ad6b3

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

mimic-iv/concepts/sepsis/suspicion_of_infection.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ WITH ab_tbl AS (
3030
, CAST(MAX(chartdate) AS DATE) AS chartdate
3131
, MAX(charttime) AS charttime
3232
, MAX(spec_type_desc) AS spec_type_desc
33-
-- identify negative cultures as NULL organism
34-
-- or a specific itemid saying "NEGATIVE"
33+
-- non-positive: NULL/empty organism, NEGATIVE (90856),
34+
-- or CANCELLED culture (90760) — cancelled is not growth
3535
, MAX(
3636
CASE WHEN org_name IS NOT NULL
37-
AND org_itemid != 90856
37+
AND org_itemid NOT IN (90856, 90760)
3838
AND org_name != ''
39+
AND org_name != 'CANCELLED'
3940
THEN 1 ELSE 0
4041
END) AS positiveculture
4142
FROM `physionet-data.mimiciv_hosp.microbiologyevents`

mimic-iv/concepts_duckdb/sepsis/suspicion_of_infection.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ WITH ab_tbl AS (
2424
MAX(spec_type_desc) AS spec_type_desc,
2525
MAX(
2626
CASE
27-
WHEN NOT org_name IS NULL AND org_itemid <> 90856 AND org_name <> ''
27+
WHEN NOT org_name IS NULL
28+
AND NOT org_itemid IN (90856, 90760)
29+
AND org_name <> ''
30+
AND org_name <> 'CANCELLED'
2831
THEN 1
2932
ELSE 0
3033
END

mimic-iv/concepts_postgres/sepsis/suspicion_of_infection.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ WITH ab_tbl AS (
2222
MAX(hadm_id) AS hadm_id,
2323
CAST(MAX(chartdate) AS DATE) AS chartdate,
2424
MAX(charttime) AS charttime,
25-
MAX(spec_type_desc) AS spec_type_desc, /* identify negative cultures as NULL organism */ /* or a specific itemid saying "NEGATIVE" */
25+
MAX(spec_type_desc) AS spec_type_desc, /* non-positive: NULL/empty, NEGATIVE (90856), CANCELLED (90760) */
2626
MAX(
2727
CASE
28-
WHEN NOT org_name IS NULL AND org_itemid <> 90856 AND org_name <> ''
28+
WHEN NOT org_name IS NULL
29+
AND NOT org_itemid IN (90856, 90760)
30+
AND org_name <> ''
31+
AND org_name <> 'CANCELLED'
2932
THEN 1
3033
ELSE 0
3134
END

0 commit comments

Comments
 (0)