M
Medigy
05 / SQL Transformations
Connect with us →

Everything is queryable.

All logic lives in SQL. Every metric, cohort, and opportunity signal is defined as a view — not hidden in compiled code.

For:BD leadersProductData teams

Canonical views

mat_condition_national_summary

High-level market magnitude and financial intensity across all conditions.

mat_condition_state_breakdown

Regional drill-downs by state, locality, and GPCI cost tier.

mat_condition_hcpcs_detail

Granular procedure-level utilization and spend analytics by HCPCS code.

mat_opportunity_score

Prioritized market targets based on normalized reach and spend composite.

mat_executive_kpis

Top-line portfolio performance metrics for executive dashboards.

data_provenance

Traceability audit table for all 7 integrated federal CMS data streams.

Querying Clinical Intensity

▸ cold_market_analysis.sql
-- Find high-spend states for Heart Failure
-- where clinical intensity is below the national average
SELECT
  state_abbr,
  total_beneficiaries,
  total_allowed_amt    AS Market_Magnitude,
  allowed_per_patient  AS Economic_Density,
  services_per_patient AS Utilization_Velocity
FROM mat_condition_state_breakdown
WHERE condition_name = 'Heart Failure'
  AND services_per_patient < (
    SELECT AVG(services_per_patient)
    FROM mat_condition_national_summary
    WHERE condition_name = 'Heart Failure'
  )
ORDER BY total_allowed_amt DESC
LIMIT 10;

Why SQL-native matters

  • Zero Latency: Insight is generated the moment surveilr finishes the ingestion.
  • Auditability: Every metric in mat_opportunity_score can be traced back via data_provenance.
  • Extensibility: New clinical logic can be added by simply creating a new SQL view, with no changes required to the ingestion engine.
What this means for you
Your analysts can fork a view, adjust the definition for your business, and ship a new opportunity signal in an afternoon — not a quarter.
See this in your data

Ready to put the Opportunity Atlas to work?

See the Opportunity Atlas run against your product, segment, or geography in a 30-minute walkthrough.