Write a SQL query to find all patients who had a specific spine procedure and subsequently visited the emergency room within 30 days.
Assume the specific procedure is identified by procedure_code = 'LUMBAR_FUSION'. Return only the earliest qualifying emergency room visit for each patient.
patient_id, patient_name, procedure_date, and er_visit_date.patient_id ascending.| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient's display name |
| Column | Type | Description |
|---|---|---|
| procedure_idPK | INT | Unique procedure identifier |
| patient_id | INT | Patient receiving the procedure |
| procedure_code | VARCHAR(50) | Clinical procedure code |
| procedure_date | DATE | Date the procedure occurred |
| Column | Type | Description |
|---|---|---|
| encounter_idPK | INT | Unique encounter identifier |
| patient_id | INT | Patient associated with the encounter |
| visit_type | VARCHAR(50) | Type of healthcare encounter |
| visit_date | DATE | Date of the encounter |