Clinical Operations Analytics Path · Mission 15 of 25Hard

Coding shift detection

Self-join on fact_diagnoses to compare two dx_types within the same encounter. Find encounters where the admit dx differs from the principal dx — the audit pattern that surfaces real coding revisions and (occasionally) ICD-9 legacy leaks.

The Brief

You'll practice

Self-join via dual CTEsLEFT JOIN auditEncounter pivot