Healthcare Analytics Path · Mission 20 of 25Hard

Provider complication rates

Calculate rates with HAVING filter and handle sensitive data awareness

Back to Healthcare Analytics

The Brief

Dr. Linda NguyenChief Medical Officerslack-dm

Before you share this with ANYONE — this is sensitive. For each active provider, show their complication rate per 100 encounters. Only include providers with at least 20 encounters so we're not flagging someone over 2 cases. Show name, specialty, encounter count, complications, and rate. Exclude inactive providers — some still have encounters in the system.

You'll practice

Correlated subqueryHAVINGRate calc

Tables available

dim_providersfact_encountersfact_quality_metrics

Hints (3)

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

Hint 1

Three tables: provider → encounter → quality metric. Filter to active providers and the complication metric type before aggregating

Hint 2

Rate per 100 = complications ÷ encounters × 100. Post-aggregation volume filter belongs in HAVING, not WHERE

Hint 3

`ROUND(100.0 * SUM(CASE WHEN qm.metric_value = 1 THEN 1 ELSE 0 END) / COUNT(DISTINCT e.encounter_id), 1)` — add `HAVING COUNT(DISTINCT e.encounter_id) ___ 20`