Filter dim_icd on a boolean flag column. Chronic-condition codes drive every long-term care management roster — knowing what's in the bucket is the first step before counting it.
Care management is staffing up the chronic-disease registry next quarter and they need the list of codes that qualify. Give me every ICD-10 code in dim_icd flagged as chronic — code, description, CCSR category, and body system. Sort by CCSR description so similar conditions cluster. Anything where is_chronic = 1 belongs in the registry; non-chronic acute codes (pneumonia, appendicitis, MI) are out.
| Column | Type | Key |
|---|---|---|
| icd_code | TEXT | PK |
| icd_description | TEXT | |
| ccsr_category | TEXT | |
| ccsr_description | TEXT | |
| body_system | TEXT | |
| is_chronic | INT | |
| hcc_flag | INT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Single table — dim_icd. WHERE is_chronic = 1.
is_chronic is stored as INTEGER — 1 = chronic, 0 = acute. Don't compare to the string 'true' or to 1.0; integer equality is what works.
ORDER BY ccsr_description so the rollup categories cluster. Within each CCSR you'll often see multiple ICD subcodes.