Write a query to find the top three highest-billing insurance providers for a specific diagnostic test over the last quarter at Natera.
Use the Panorama test and the previous calendar quarter relative to the query date. Exclude voided claims and records outside the quarter.
provider_id, provider_name, total_billed, and billing_rank.billing_rank, then provider_name.| Column | Type | Description |
|---|---|---|
| provider_idPK | INT | Unique insurance provider identifier |
| provider_name | VARCHAR(100) | Insurance provider name |
| payer_type | VARCHAR(30) | Provider classification |
| Column | Type | Description |
|---|---|---|
| test_idPK | INT | Unique diagnostic test identifier |
| test_code | VARCHAR(30) | Diagnostic test code |
| test_name | VARCHAR(100) | Diagnostic test name |
| Column | Type | Description |
|---|---|---|
| billing_idPK | INT | Unique billing record identifier |
| provider_id | INT | Referenced insurance provider |
| test_id | INT | Referenced diagnostic test |
| billed_amount | DECIMAL(12,2) | Amount billed for the claim |
| billed_at | DATE | Date the billing record was submitted |
| claim_status | VARCHAR(20) | Claim processing status |