An innovative healthcare organization uses its Care Insights platform to review diagnoses recorded during patient encounters. Write a PostgreSQL query that returns distinct diagnosis codes and names for qualifying encounters.
2025-01-01.| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient display name |
| status | VARCHAR(20) | Current patient status |
| Column | Type | Description |
|---|---|---|
| encounter_idPK | INT | Unique encounter identifier |
| patient_id | INT | Patient associated with the encounter |
| encounter_date | DATE | Date the encounter occurred |
| status | VARCHAR(20) | Encounter workflow status |
| Column | Type | Description |
|---|---|---|
| diagnosis_idPK | INT | Unique diagnosis record identifier |
| encounter_id | INT | Encounter associated with the diagnosis |
| diagnosis_code | VARCHAR(20) | Clinical diagnosis code |
| diagnosis_name | VARCHAR(150) | Human-readable diagnosis name |