-- Which companies pay U.S. doctors the most? Device makers, not pharma
-- Fonteum reproducible query — https://fonteum.com/research/open-payments-top-manufacturers-2024
-- Data as of: 2026-01-23  ·  methodology: open-payments/v1
-- Source datasets: CMS Open Payments
-- Run against the frozen federal snapshot to reproduce the published figures.
-- License: U.S. Government Works (federal sources; 17 U.S.C. §105).

-- Which companies pay U.S. doctors the most? — fully reproducible query.
--
-- Source:   CMS Open Payments, program year 2024 (PGYR2024, published 2026-01-23).
-- Table:    public.cms_open_payments (16,146,544 records, public, read-only).
-- Scope:    General (non-research) payments only  (record_type = 'general').
-- Identity: one row = one reported transfer of value from a company to a covered
--           recipient. Aggregates are by manufacturer only; no recipient is named.
--
-- The study reads the bounded open_payments_by_manufacturer_mv / _overview_mv
-- materialized views; their exact definitions are reproduced here.

-- Headline totals (open_payments_overview_mv):
SELECT
  count(*) FILTER (WHERE record_type = 'general')                     AS general_records, -- 15,385,047
  round(sum(total_amount_usd) FILTER (WHERE record_type = 'general')) AS general_value,   -- 3,313,801,737
  count(DISTINCT recipient_npi) FILTER
    (WHERE record_type = 'general' AND recipient_npi IS NOT NULL)     AS recipients,      -- 979,136
  count(DISTINCT manufacturer_name) FILTER
    (WHERE record_type = 'general' AND manufacturer_name IS NOT NULL) AS companies        -- 1,763
FROM public.cms_open_payments
WHERE program_year = 2024;

-- Top 15 companies by general-payment dollars (open_payments_by_manufacturer_mv):
SELECT
  manufacturer_name                  AS manufacturer,
  count(*)                           AS payment_count,
  round(sum(total_amount_usd))::bigint AS general_payments
FROM public.cms_open_payments
WHERE record_type = 'general' AND program_year = 2024 AND manufacturer_name IS NOT NULL
GROUP BY manufacturer_name
ORDER BY general_payments DESC
LIMIT 15;
--  BioNTech SE                        180,558,679        164   <- largest payer; royalty income
--  ABBVIE INC.                        156,382,683  1,720,745   <- broadest reach; avg $91/payment
--  Stryker Corporation                132,155,940    162,439
--  Medtronic, Inc.                    117,649,217    342,148
--  Arthrex, Inc.                      104,199,464     49,443
--  Edge Endo LLC                       91,139,127         11   <- avg $8.3M/payment (acquisition)
--  Zimmer Biomet Holdings, Inc.        83,904,351     32,760
--  INTUITIVE SURGICAL, INC.            72,225,869    116,855
--  Takeda Pharmaceuticals U.S.A.       71,616,187    171,595
--  Advanced Accelerator Applications   63,931,988        167
--  AstraZeneca Pharmaceuticals LP      63,099,382    609,976
--  Boston Scientific Corporation       61,435,976    265,585
--  Genentech, Inc.                     59,226,516      2,534
--  GENZYME CORPORATION                 55,555,371    181,575
--  DePuy Synthes Products, Inc.        50,211,032      2,541

-- Payer concentration — top 25 share of all general-payment dollars:
WITH ranked AS (
  SELECT manufacturer_name, sum(total_amount_usd) AS amt
  FROM public.cms_open_payments
  WHERE record_type = 'general' AND program_year = 2024 AND manufacturer_name IS NOT NULL
  GROUP BY manufacturer_name
  ORDER BY amt DESC
  LIMIT 25
)
SELECT
  round(sum(amt))::bigint                                             AS top25_value,  -- 1,731,853,106
  round(100.0 * sum(amt) / (SELECT sum(total_amount_usd)
                            FROM public.cms_open_payments
                            WHERE record_type = 'general' AND program_year = 2024), 1) AS top25_pct -- 52.3
FROM ranked;
