Clinical Operations Analytics Path · Mission 10 of 25Medium

Orphan codes — codebook gaps

First LEFT JOIN with IS NULL anti-join. Find ICD codes in the codebook (dim_icd) that never appear in fact_diagnoses. Sets up the Hard-tier anti-join intuition behind the M24 data-quality audit.

The Brief

Maya ThompsonCoding Managerslack-dm

Codebook utilization audit, follow-up to last quarter's coder training. We added a bunch of codes to dim_icd to support the ED expansion (sepsis, AKI, respiratory failure variants), but I'm hearing the coding team isn't reaching for them. Show me every code in dim_icd that has *zero* rows in fact_diagnoses — those are the codes we trained on but nobody's documenting. Just code, description, and body system. Sort by code. If the list is short we can run targeted refreshers; if it's long we have a documentation problem, not a knowledge problem.

You'll practice

LEFT JOINAnti-join (IS NULL)Codebook audit

Tables & columns available

dim_icddim7 columns
ColumnTypeKey
icd_codeTEXTPK
icd_descriptionTEXT
ccsr_categoryTEXT
ccsr_descriptionTEXT
body_systemTEXT
is_chronicINT
hcc_flagINT
fact_diagnosesfact6 columns
ColumnTypeKey
diagnosis_idINTPK
encounter_idINTFK → fact_encounters
icd_codeTEXTFK → dim_icd
dx_typeTEXT
poa_indicatorTEXT
dx_rankINT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

LEFT JOIN dim_icd to fact_diagnoses ON icd_code (NOT INNER JOIN — INNER would only keep codes WITH activity, which is the opposite of what Maya wants).

Hint 2

Filter WHERE fd.icd_code IS NULL — the codes that didn't match any fact_diagnoses row. That's the anti-join idiom.

Hint 3

Three columns: icd_code, icd_description, body_system. ORDER BY icd_code.