# Openpipe Health API: essentials > Openpipe Health is an API over public data on US healthcare, most of it from CMS: clinicians (NPI registry, Medicare Part B), procedure volumes by HCPCS code, Part D prescribing, hospitals with their owners, quality scores, EHR vendor, health system, DRG volumes and affiliated clinicians, nursing homes and other care sites with their owners, group practices, drug markets in Medicare Part D and Medicaid, Medicare Advantage payers and plans, ACOs, clinical-trial investigators and NIH grants, and industry payments. Use it through REST search and lookup endpoints, a plain-English question that returns a finished dashboard as JSON, or MCP tools. There is no endpoint that accepts SQL. Every data response shows the SQL the server ran, as a read-only receipt. This is the short version of the docs: Quickstart, Authentication, Credits, Errors, MCP server, Ask, Exports, Tables, Caveats, plus a table of every endpoint. Some sections that only matter to the browser app or to people running the server are left out. The complete docs are at https://openpipe.health/docs/llms-full.txt and the index of pages is at https://openpipe.health/docs/llms.txt. --- # Quickstart URL: https://openpipe.health/docs/quickstart/ Markdown: https://openpipe.health/docs/quickstart.md > Make your first Openpipe Health API request. > **Using a coding agent?:** Skip the typing: [copy one prompt](https://openpipe.health/docs/agents.md#copy-this-to-your-agent) into Claude Code, Cursor or any other agent. It makes these same requests for you once `OPH_API` and `OPH_KEY` are set. ## 1. Set the base URL Every path in these docs is relative to the base URL of your deployment. When you run the repo locally with `bun run dev`, that is `http://localhost:4318`. ```sh export OPH_API=http://localhost:4318 ``` Check that the API is up. This endpoint needs no key: ```sh curl $OPH_API/api/health ``` ## 2. Create an API key Sign in to the app at `/app`, find **API key**, and select **Create a key**. Keys start with `oph_` and are shown once, so copy it straight away. The key belongs to the [workspace](https://openpipe.health/docs/workspaces.md) you created it in and spends that workspace's credits. In an organization workspace, only owners and admins can create keys. ```sh export OPH_KEY=oph_your_key_here ``` ## 3. Search Rank Texas clinicians by the number of total knee replacements (HCPCS `27447`) they billed to Medicare: ```sh curl "$OPH_API/api/providers?hcpcs=27447&state=TX&limit=5" \ -H "Authorization: Bearer $OPH_KEY" ``` The response has the rows, the SQL that produced them, the datasets it read, and what the call cost: ```json { "rows": [ { "npi": "1234567893", "name": "Jane Example", "credentials": "MD", "specialty": "Orthopedic Surgery", "city": "Houston", "state": "TX", "hcpcs_code": "27447", "services": 412, "patients": "398", "medicare_payment": "498213" } ], "sql": "SELECT s.npi, ... FROM medicare_service s JOIN medicare_provider m ...", "params": ["27447", "TX"], "sources": ["medicare_service", "medicare_provider"], "ms": 4, "usage": { "credits": 1, "creditsUsed": 1, "creditsLimit": 100, "txid": "81234" } } ``` Values in example responses throughout these docs are illustrative. Field names and shapes are exact. Identifiers such as `npi`, and sums and money amounts, arrive as JSON strings. ## 4. Ask in plain English ```sh curl "$OPH_API/api/ask" \ -H "Authorization: Bearer $OPH_KEY" \ -H "Content-Type: application/json" -H "Accept: application/json" \ -d '{"question": "Which states do the most cataract surgeries per Medicare patient?"}' ``` With `Accept: application/json` the finished dashboard comes back as one JSON document after 5 to 30 seconds: a title, a summary, and two to four tiles with their columns and rows. Leave the header out and the same answer arrives as server-sent events, one tile at a time. It costs 25 credits either way. See [Ask](https://openpipe.health/docs/api/ask.md). ## 5. Connect an AI client The same key works with the [MCP server](https://openpipe.health/docs/mcp.md), which gives Claude Code, Cursor and other MCP clients the search and lookup tools and `ask` directly: ```sh claude mcp add --transport http openpipe "$OPH_API/mcp" \ --header "Authorization: Bearer $OPH_KEY" ``` [Build with an AI agent](https://openpipe.health/docs/agents.md) has a ready-made prompt, rules files for Claude Code and Cursor, and the docs as [`/docs/llms.txt`](https://openpipe.health/docs/llms.txt). ## Limits to know about Requests are [rate limited](https://openpipe.health/docs/api/errors.md#rate-limits) per workspace: 300 a minute overall, 10 for Ask and 10 for exports. A `429` response has a `Retry-After` header that says how many seconds to wait. --- # Authentication URL: https://openpipe.health/docs/authentication/ Markdown: https://openpipe.health/docs/authentication.md > API keys, session tokens, browser sign-in, and which endpoints need neither. Send a bearer token on every request under `/api/`, except the public endpoints listed below. ```http Authorization: Bearer oph_your_key_here ``` ## Two kinds of token | Token | Looks like | Use it for | |---|---|---| | API key | Starts with `oph_` | Servers, scripts, notebooks and the [MCP server](https://openpipe.health/docs/mcp.md). Everything except key management. | | Session token | A short-lived JWT issued to a signed-in person | The browser app. Required to create or revoke API keys. | The two do not always resolve to the same place: - An **API key** always acts in the [workspace](https://openpipe.health/docs/workspaces.md) that created it. - A **session token** acts in your personal workspace, unless the request also sends `X-Oph-Workspace: ` to pick an organization workspace you belong to. Credits, usage and keys belong to the workspace, so a key and a session share a balance only when they act in the same workspace. ## API keys - Create and revoke keys in the app, or with [`POST /api/keys`](https://openpipe.health/docs/api/account.md#create-a-key) using a session token. - In an organization workspace, only owners and admins can create or revoke keys. Members get `403`. - The full key is returned once, at creation. Only a SHA-256 hash is stored. Afterwards you can see its 12-character prefix, its name and when it was last used. - A workspace can have 20 active keys. Creating a 21st returns `409`. Revoked keys do not count. - A revoked key stops working on the next request. - An API key cannot create or revoke keys. Those calls return `403` with `Sign in to do that; an API key cannot.` - A key is not tied to the person who created it. It keeps working if that person leaves the workspace. Keep keys on a server. Any key can spend its workspace's credits. ### The `X-Oph-Token` header If a proxy between you and the API replaces the `Authorization` header with its own credentials, send the same token in `X-Oph-Token` instead. When both are present, `X-Oph-Token` wins. ```http X-Oph-Token: oph_your_key_here ``` ## Public endpoints These need no token: | Endpoint | Returns | |---|---| | `GET /api/health` | Database and service status | | `GET /api/config` | Values the browser app needs to start | | `GET /api/meta` | The loaded datasets, their versions and row counts | The sign-in endpoints under `/api/auth/` take no bearer token either. They are described next. ## Failures | Status | Message | Cause | |---|---|---| | `401` | `Missing Authorization: Bearer .` | No header, or not a bearer token. The response has a `WWW-Authenticate: Bearer` header. | | `401` | `Unknown or revoked API key.` | The `oph_` key does not match an active key | | `401` | `Invalid or expired session token.` | The JWT failed verification | | `403` | `You are not a member of that workspace.` | `X-Oph-Workspace` names an organization you do not belong to, or one that does not exist | | `403` | `Sign in to do that; an API key cannot.` | Key management called with an API key | | `403` | `Only workspace owners and admins can do that.` | Key management called by a member of an organization workspace | --- # Credits URL: https://openpipe.health/docs/credits/ Markdown: https://openpipe.health/docs/credits.md > What each call costs, how the monthly limit works, and how to check your balance. Every metered call spends credits from a monthly allowance. The allowance belongs to the [workspace](https://openpipe.health/docs/workspaces.md), not to a person or a key: every key and every member of a workspace draws on the same balance. A new workspace, personal or organization, is on the `free` plan with 100 credits a month. ## Prices | Action | Endpoints | Credits | |---|---|---| | Search | `GET /api/providers`, `/api/facilities`, `/api/groups`, `/api/procedures` | 1 | | Lookup | `GET /api/providers/:npi`, `/api/facilities/:ccn`, `/api/groups/:id` | 1 | | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | `GET /api/hospital-intel`, `/api/health-systems`, `/api/health-systems/:id`, `/api/facilities/:ccn/intel`, `/api/facilities/:ccn/clinicians`, `/api/facilities/:ccn/measures`, `/api/facilities/:ccn/drgs`, `/api/providers/:npi/facilities` | 1 each | | [Care sites](https://openpipe.health/docs/api/care-sites.md) | `GET /api/care-sites`, `/api/care-sites/types`, `/api/care-sites/:id`, `/api/care-sites/:id/owners` | 1 each | | [Drug markets](https://openpipe.health/docs/api/drug-markets.md) | `GET /api/market/drugs`, `/api/market/drugs/spending` | 1 each | | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | `GET /api/market/payers`, `/api/market/payers/counties/:fips`, `/api/market/plans`, `/api/market/acos`, `/api/market/acos/:id` | 1 each | | [Experts](https://openpipe.health/docs/api/experts.md) | `GET /api/market/experts`, `/api/market/experts/:npi` | 1 each | | Export | `POST /api/exports` | 10 | | Ask | `POST /api/ask` | 25 | | [Ask (instant)](https://openpipe.health/docs/api/ask2.md), answered from a recipe | `POST /api/ask2/ask`, `/api/ask2/edit` | 5 | | Ask (instant), answered by the planner | `POST /api/ask2/ask`, `/api/ask2/edit` | 25 | | Open a predicted dashboard | `POST /api/ask2/open` | 5 | [MCP tools](https://openpipe.health/docs/mcp.md#tools) cost the same as the endpoint they match: 1 credit for the `search_*` and `get_*` tools and for `list_hospital_clinicians` and `list_care_site_types`, 25 for `ask`. `list_datasets` and `describe_data` are free. Not metered: `/api/health`, `/api/config`, `/api/meta`, `/api/me`, `/api/usage`, `/api/keys`, `GET /api/exports`, `GET /api/ask2/preview`, `POST /api/ask2/predict`, `GET /api/ask2/d/:id`, `GET /api/ask2/about` and everything under `/api/auth/`. Three more groups are free and have their own rate limits in place of a price: - [`/api/dashboards`](https://openpipe.health/docs/api/saved.md): listing, opening, saving, renaming and deleting, and also refreshing. A refresh runs the stored SQL again at no charge, up to 20 refreshes a minute per workspace and 2 at a time. - [`/api/catalog`](https://openpipe.health/docs/data/catalog.md): the dataset list, column descriptions and statistics, sample rows and search. - [`/api/profile`](https://openpipe.health/docs/api/profile.md): the onboarding profile. Session tokens only. ## When you are charged - **Search** on providers, facilities, groups and procedures is charged when the request arrives. - **Lookup** is charged only if the record exists. A `404` is free. - **Hospitals and systems, care sites, drug markets, payers, ACOs and experts** are charged only when the call succeeds. A `400` or a `404` is free. A search that returns no rows is a success and is charged. - **Exports** run first. An export that is rejected, fails or times out is free. - **Ask** is charged once, when the model has produced a plan and before any tile runs. If the model cannot plan an answer, nothing is charged. If a tile fails afterwards, the call is still charged, and [refreshing](https://openpipe.health/docs/api/saved.md#refresh-a-dashboard) the stored dashboard retries the tile for free. - **Ask (instant)** is charged 5 credits when a recipe answers, once, when the first tile has a result and before any row is sent. If every tile fails, or you disconnect before that point, nothing is charged. When the planner answers it is charged 25, the same way as Ask. A retry with the same `rid` and a second open of the same prediction are free. See [when you are charged](https://openpipe.health/docs/api/ask2.md#when-you-are-charged-and-what-is-stored). ## The usage object Every metered response carries what the call cost and where the workspace stands: ```json "usage": { "credits": 1, "creditsUsed": 42, "creditsLimit": 100, "txid": "81240" } ``` | Field | Meaning | |---|---| | `credits` | Cost of this call | | `creditsUsed` | Total the workspace has spent this calendar month, including this call | | `creditsLimit` | The workspace's monthly allowance | | `txid` | Postgres transaction id of the usage record. The app uses it to know when its live usage feed has caught up. You can ignore it. | ## Running out The balance is checked twice, and both checks answer `402`. **Before any work.** Every metered endpoint first checks whether the workspace can cover the price of the call. If it cannot, the request stops there: no query runs, and nothing else about the request is looked at. A malformed request or an unknown id gets `402` too, not `400` or `404`. ```json { "error": "Out of credits: 92 of 100 used this month, this call costs 10." } ``` The message is the same whether the allowance is spent or there is only too little left for this call. In the example, eight credits remain: a 1-credit search still works, a 10-credit export does not. **At the moment of charging.** The same check runs again, together with the usage record, and answers with the same message. It matters when several calls arrive at once: a call that passed the first check can still be refused here if others spent the balance in between. It is not charged. For an export the statement has already run by then; its result is discarded and no file is written. For Ask the plan is discarded and no tile runs. Charging is atomic. The balance check and the usage record happen together under one lock per workspace, so concurrent calls cannot spend past the limit between them. The limit is read fresh on every call, so a plan change applies to the next request. Over [MCP](https://openpipe.health/docs/mcp.md#errors), both cases come back as a tool error with the same message, not as an HTTP `402`. The count resets at the start of each calendar month, by the database clock. Check the balance any time with [`GET /api/me`](https://openpipe.health/docs/api/account.md#get-your-account). ## Older usage records `POST /api/sql` (5 credits) was removed. Calls made before that still appear in [`GET /api/usage`](https://openpipe.health/docs/api/account.md#list-usage) with `kind` set to `sql`, and still count toward the month they were made in. --- # Errors URL: https://openpipe.health/docs/api/errors/ Markdown: https://openpipe.health/docs/api/errors.md > Status codes, the error body, rate limits and request size limits. Every error is JSON with an `error` message: ```json { "error": "NPI must be 10 digits." } ``` Some errors add a machine-readable `code`: ```json { "error": "Too many requests. Try again in 23s.", "code": "RATE_LIMITED" } ``` `code` is present on `429` (`RATE_LIMITED`, or `REFRESH_BUSY` when a workspace already has two [refreshes](https://openpipe.health/docs/api/saved.md#refreshing-is-free-but-rationed) running), on `413` (`TOO_LARGE`), on `502` from Ask (`ASK_FAILED`) and on errors from the [sign-in endpoints](https://openpipe.health/docs/authentication.md#browser-sign-in) under `/api/auth/`. Other errors have only `error`. The message is written to be shown to a person. Branch on the status code, and on `code` where there is one, not on the text. | Status | Meaning | What to do | |---|---|---| | `400` | The request is malformed, has a field the endpoint does not take, or an export could not run | Fix the request; the message says how. Not charged. | | `401` | Missing, unknown, revoked or expired token | See [Authentication](https://openpipe.health/docs/authentication.md#failures) | | `402` | Out of credits for the month | Wait for the monthly reset or raise your limit. See [Credits](https://openpipe.health/docs/credits.md#running-out). | | `403` | Not a member of the workspace named in `X-Oph-Workspace`; key management called with an API key or by a member; a dashboard saved, renamed or deleted by an API key, or changed by a member who does not own it; `/api/profile` called with an API key | See [Authentication](https://openpipe.health/docs/authentication.md#failures), [Roles](https://openpipe.health/docs/workspaces.md#roles) and [who can do what](https://openpipe.health/docs/api/saved.md#who-can-do-what) | | `404` | No provider, hospital, group, key, dashboard, dashboard tile or catalog dataset with that id or name. A dashboard in another workspace answers `404` too. So do the removed endpoints: `POST /api/sql` and everything under `/api/queries`. | Check the id. Lookups that miss are not charged. | | `409` | The workspace already has 20 active API keys or 200 saved dashboards; a dashboard with no tiles was refreshed | Remove one first, or see [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `413` | Request body larger than 64 KB, or 8 KB under `/api/profile` | Send a smaller body. See [Request size](#request-size). | | `429` | Rate limited | Wait the number of seconds in `Retry-After`. See [Rate limits](#rate-limits). | | `502` | [Ask](https://openpipe.health/docs/api/ask.md#json-mode) in JSON mode: the model could not plan an answer. `code` is `ASK_FAILED` and `charged` is `false`. | Rephrase the question, or name the procedure, drug or state you mean. Nothing was charged. | | `500` | `Internal error.` | Retry once. If it repeats, check [`/api/health`](https://openpipe.health/docs/api/meta.md#health). | The [MCP server](https://openpipe.health/docs/mcp.md#errors) reports errors differently: JSON-RPC errors for protocol problems, and tool results marked `isError` for failed tool calls. ## Order of checks A request under `/api/` passes these checks in order, and stops at the first that fails: 1. Rate limit per client address (`429`) 2. Request size (`413`) 3. Authentication and workspace (`401`, `403`) 4. Rate limits per workspace (`429`) 5. Credit pre-check, on metered endpoints only (`402`) 6. The endpoint's own validation and work (`400`, `404`, and `402` if this call would pass the limit) Two consequences: - A workspace that has already spent its allowance gets `402` from every metered endpoint before the request is validated or anything runs. See [Running out](https://openpipe.health/docs/credits.md#running-out). - Requests that fail authentication still count against the per-address limit. ## SQL is not accepted No endpoint and no MCP tool takes SQL. `POST /api/sql` and `/api/queries` answer `404`, [`POST /api/exports`](https://openpipe.health/docs/api/exports.md#errors) answers `400` to a body with a `sql` field, and the endpoint that renames or saves a dashboard answers `400` to any field other than `name` and `saved`. The `sql` fields in responses are [receipts](https://openpipe.health/docs/receipts.md). ## Errors inside an Ask stream Once [`/api/ask`](https://openpipe.health/docs/api/ask.md) starts streaming, the HTTP status is already `200`. Failures arrive as events: - `tile_error`: one tile failed. Others still arrive, and `done` reports the count in `failed`. A free [refresh](https://openpipe.health/docs/api/saved.md#refresh-a-dashboard) of the stored dashboard retries it. - `error`: the answer could not start. With `code: "ASK_FAILED"` and `charged: false`, the model could not plan and nothing was charged; with `status: 402`, the balance ran out before the charge. The stream ends. See [errors inside the stream](https://openpipe.health/docs/api/ask.md#errors-inside-the-stream). In [JSON mode](https://openpipe.health/docs/api/ask.md#json-mode) the same failures are ordinary responses: failed tiles are listed in `failed`, and a failed plan is a `502`. ## Rate limits Requests are rate limited. The limits stop bursts and runaway loops; the hard cap on spend is still your [credits](https://openpipe.health/docs/credits.md). | Applies to | Limit | Counted per | |---|---|---| | Every request under `/api/`, including public and sign-in endpoints | 900 per minute | Client address | | Every authenticated request under `/api/` | 300 per minute | Workspace | | `/api/ask`, together with the MCP `ask` tool | 10 per minute | Workspace | | `POST /api/exports` (listing with `GET` counts only toward the 300) | 10 per minute | Workspace | | [Refreshing](https://openpipe.health/docs/api/saved.md#refreshing-is-free-but-rationed) a dashboard | 20 per minute, and 2 running at once | Workspace | | [`/api/catalog`](https://openpipe.health/docs/data/catalog.md#limits) | 240 per minute | Workspace | | `/api/catalog/search` | 180 per minute | Workspace | | `/api/catalog/:table/sample` | 40 per minute | Workspace | | [`/api/profile`](https://openpipe.health/docs/api/profile.md#limits): 120 updates, 90 lookups, 12 market summaries, 6 suggestion builds per minute | See left | Signed-in person | | [`/mcp`](https://openpipe.health/docs/mcp.md#limits) | 120 per minute | API key and client address together | How they combine: - **Limits stack.** A call to `/api/ask` counts against the per-address limit, the workspace's 300 and the workspace's 10. It must be under all three. - **Workspace limits are shared.** Every key and every signed-in member of a workspace draws on the same counters. - **Rejected requests count.** A request that gets `429` still counts toward the limits checked before it and the one that rejected it, though it cannot extend the window. - **Windows are fixed.** A window starts at the first request and lasts 60 seconds. The count returns to zero when it ends; it is not a sliding average. ### Headers Responses carry the state of one limit: | Header | Meaning | |---|---| | `RateLimit-Limit` | Requests allowed per window | | `RateLimit-Remaining` | Requests left in the current window | | `RateLimit-Reset` | Seconds until the window ends | | `Retry-After` | Only on `429`: seconds to wait. Same value as `RateLimit-Reset`. | When several limits apply, the headers describe the last one checked. On a successful call that is the most specific: the 10 on `/api/ask`, the 300 on `/api/providers`, the 900 on a public endpoint such as `/api/health`. The refresh limit is the exception: a successful refresh reports the 300, and only its `429` reports the 20. On a `429` they describe the limit that rejected the request. On a `401` they describe the per-address limit, because the workspace is not yet known. ### The 429 response ```http HTTP/1.1 429 Too Many Requests RateLimit-Limit: 10 RateLimit-Remaining: 0 RateLimit-Reset: 23 Retry-After: 23 ``` ```json { "error": "Too many requests. Try again in 23s.", "code": "RATE_LIMITED" } ``` Nothing is charged for a `429`. Wait `Retry-After` seconds, then retry. ## Request size A request body under `/api/` can be at most 64 KB. A larger one gets: ```json { "error": "Request body is too large (64 KB limit).", "code": "TOO_LARGE" } ``` with status `413`. This is checked before authentication. The [MCP endpoint](https://openpipe.health/docs/mcp.md#limits) has its own limit of 256 KB, and the [profile endpoints](https://openpipe.health/docs/api/profile.md) a smaller one of 8 KB, checked after authentication. --- # Endpoints Every endpoint in the API reference. Paths are relative to `$OPH_API`. Credits are charged per call; `0` means the call is not metered. | Endpoint | What it does | Credits | Reference | |---|---|---|---| | `GET /api/providers` | Search providers | 1 | [Providers](https://openpipe.health/docs/api/providers.md) | | `GET /api/providers/:npi` | Get a provider | 1 | [Providers](https://openpipe.health/docs/api/providers.md) | | `GET /api/facilities` | Search facilities | 1 | [Facilities](https://openpipe.health/docs/api/facilities.md) | | `GET /api/facilities/:ccn` | Get a facility | 1 | [Facilities](https://openpipe.health/docs/api/facilities.md) | | `GET /api/hospital-intel` | Search hospitals by EHR, rating, system or DRG | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/health-systems` | Search health systems | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/health-systems/:id` | Get a health system | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/facilities/:ccn/intel` | Get hospital intel | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/facilities/:ccn/clinicians` | List a hospital's clinicians | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/facilities/:ccn/measures` | List a hospital's quality measures | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/facilities/:ccn/drgs` | List a hospital's DRG volume | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/providers/:npi/facilities` | List a clinician's facilities | 1 | [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md) | | `GET /api/care-sites` | Search care sites | 1 | [Care sites](https://openpipe.health/docs/api/care-sites.md) | | `GET /api/care-sites/types` | List care site types | 1 | [Care sites](https://openpipe.health/docs/api/care-sites.md) | | `GET /api/care-sites/:id` | Get a care site | 1 | [Care sites](https://openpipe.health/docs/api/care-sites.md) | | `GET /api/care-sites/:id/owners` | List a care site's owners | 1 | [Care sites](https://openpipe.health/docs/api/care-sites.md) | | `GET /api/groups` | Search groups | 1 | [Groups](https://openpipe.health/docs/api/groups.md) | | `GET /api/groups/:id` | Get a group | 1 | [Groups](https://openpipe.health/docs/api/groups.md) | | `GET /api/procedures` | Search procedures | 1 | [Procedures](https://openpipe.health/docs/api/procedures.md) | | `GET /api/market/drugs` | Get a drug's market by state | 1 | [Drug markets](https://openpipe.health/docs/api/drug-markets.md) | | `GET /api/market/drugs/spending` | Get a drug's national spending by year | 1 | [Drug markets](https://openpipe.health/docs/api/drug-markets.md) | | `GET /api/market/payers` | Get Medicare payers in a state or the nation | 1 | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | | `GET /api/market/payers/counties/:fips` | Get Medicare payers in a county | 1 | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | | `GET /api/market/plans` | Search Medicare Advantage and Part D plans | 1 | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | | `GET /api/market/acos` | Search ACOs | 1 | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | | `GET /api/market/acos/:id` | Get an ACO | 1 | [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md) | | `GET /api/market/experts` | Search experts | 1 | [Experts](https://openpipe.health/docs/api/experts.md) | | `GET /api/market/experts/:npi` | Get an expert | 1 | [Experts](https://openpipe.health/docs/api/experts.md) | | `POST /api/ask` | Ask a question | 25 | [Ask](https://openpipe.health/docs/api/ask.md) | | `GET /api/ask2/preview` | Preview a question | 0 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `POST /api/ask2/ask` | Ask a question | 5 or 25 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `POST /api/ask2/edit` | Change a dashboard | 5 or 25 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `POST /api/ask2/predict` | Predict the next dashboards | 0 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `POST /api/ask2/open` | Open a predicted dashboard | 5 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `GET /api/ask2/d/:id` | Read a stored answer | 0 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `GET /api/ask2/about` | Recipes, prices and limits | 0 | [Ask (instant)](https://openpipe.health/docs/api/ask2.md) | | `GET /api/dashboards` | List dashboards | 0 | [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `GET /api/dashboards/:id` | Open a dashboard | 0 | [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `POST /api/dashboards/:id/refresh` | Refresh a dashboard | 0 | [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `PATCH /api/dashboards/:id` | Save, unsave or rename a dashboard | 0 | [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `DELETE /api/dashboards/:id` | Delete a dashboard | 0 | [Saved dashboards](https://openpipe.health/docs/api/saved.md) | | `POST /api/exports` | Create an export | 10 | [Exports](https://openpipe.health/docs/api/exports.md) | | `GET /api/exports` | List exports | 0 | [Exports](https://openpipe.health/docs/api/exports.md) | | `GET /api/me` | Get your account | 0 | [Account and keys](https://openpipe.health/docs/api/account.md) | | `POST /api/keys` | Create a key | 0 | [Account and keys](https://openpipe.health/docs/api/account.md) | | `DELETE /api/keys/:id` | Revoke a key | 0 | [Account and keys](https://openpipe.health/docs/api/account.md) | | `GET /api/usage` | List usage | 0 | [Account and keys](https://openpipe.health/docs/api/account.md) | | `GET /api/profile` | Get your profile | 0 | [Onboarding profile](https://openpipe.health/docs/api/profile.md) | | `PUT /api/profile` | Update your profile | 0 | [Onboarding profile](https://openpipe.health/docs/api/profile.md) | | `GET /api/profile/resolve` | Match text to the data | 0 | [Onboarding profile](https://openpipe.health/docs/api/profile.md) | | `POST /api/profile/market` | Size your market | 0 | [Onboarding profile](https://openpipe.health/docs/api/profile.md) | | `POST /api/profile/suggestions` | Build suggestions | 0 | [Onboarding profile](https://openpipe.health/docs/api/profile.md) | | `GET /api/meta` | List datasets | 0 | [Meta and health](https://openpipe.health/docs/api/meta.md) | | `GET /api/health` | Health | 0 | [Meta and health](https://openpipe.health/docs/api/meta.md) | | `GET /api/config` | Config | 0 | [Meta and health](https://openpipe.health/docs/api/meta.md) | | `GET /api/catalog` | List datasets | 0 | [Data catalog](https://openpipe.health/docs/data/catalog.md) | | `GET /api/catalog/:table` | Describe a table | 0 | [Data catalog](https://openpipe.health/docs/data/catalog.md) | | `GET /api/catalog/:table/sample` | Sample rows | 0 | [Data catalog](https://openpipe.health/docs/data/catalog.md) | | `GET /api/catalog/search` | Search the catalog | 0 | [Data catalog](https://openpipe.health/docs/data/catalog.md) | | `POST /mcp` | MCP server | Per tool | [MCP server](https://openpipe.health/docs/mcp.md) | --- # MCP server URL: https://openpipe.health/docs/mcp/ Markdown: https://openpipe.health/docs/mcp.md > Connect Claude Code, Cursor and other MCP clients to the same data, with the same API keys and credit prices. The API includes a remote [Model Context Protocol](https://modelcontextprotocol.io) server. It gives an MCP client (Claude Code, Cursor, or any client that speaks Streamable HTTP) 27 tools over the same data as the REST API: 24 search and lookup tools, a plain-English `ask` that returns a finished dashboard, and two free tools that describe the data. Each tool calls the same function as the matching REST endpoint and is metered the same way. No tool takes SQL. ```http POST /mcp ``` The path is `/mcp` on your base URL, not under `/api/`. - **Stateless.** There are no sessions. Every request stands alone, and the server never sends an `Mcp-Session-Id`. - **JSON only.** Every response is one `application/json` body. The server does not open an event stream. - **Tools only.** No resources, prompts or sampling. The tool list never changes during a connection. ## Authentication Send an [API key](https://openpipe.health/docs/authentication.md#api-keys) as a bearer token on every request: ```http Authorization: Bearer oph_your_key_here ``` **OAuth is not supported.** The server has no authorization endpoints and no client registration, so a client that can only connect through an OAuth sign-in flow cannot use it. Your client must be able to send a static header. The key acts in the [workspace](https://openpipe.health/docs/workspaces.md) that created it and spends that workspace's credits. ## Add it to Claude Code With `OPH_API` and `OPH_KEY` set as in the [Quickstart](https://openpipe.health/docs/quickstart.md): ```sh claude mcp add --transport http openpipe "$OPH_API/mcp" \ --header "Authorization: Bearer $OPH_KEY" ``` ## Other clients Clients that read a `{ "mcpServers": { ... } }` config take a URL and headers. Replace `YOUR_HOST` with the host of your base URL: ```json { "mcpServers": { "openpipe": { "url": "https://YOUR_HOST/mcp", "headers": { "Authorization": "Bearer oph_your_key_here" } } } } ``` Some clients need a transport named as well, for example `"type": "http"`. Check your client's documentation for the exact key. ## Tools | Tool | What it does | Credits | |---|---|---| | `search_providers` | Find clinicians and organizations that billed Medicare Part B. Filter by `q`, `state`, `city`, `specialty`, `entity`; pass `hcpcs` to rank by volume of one procedure. Same as [`GET /api/providers`](https://openpipe.health/docs/api/providers.md). | 1 | | `get_provider` | Full profile for one provider by 10-digit `npi`. | 1, free if not found | | `search_facilities` | Find hospitals. Filter by `q`, `state`, `city`, `min_beds`, `ownership`, `private_equity`. Same as [`GET /api/facilities`](https://openpipe.health/docs/api/facilities.md). For EHR, star rating, health system or DRG volume use `search_hospital_intel`. | 1 | | `get_facility` | One hospital by `ccn`, with its owners. | 1, free if not found | | `search_groups` | Find group practices. Filter by `q`, `state`, `min_members`, `specialty`. Same as [`GET /api/groups`](https://openpipe.health/docs/api/groups.md). | 1 | | `get_group` | One group practice by `id` (its `group_pac_id`), with specialty mix and top 50 members. | 1, free if not found | | `search_procedures` | Look up HCPCS/CPT codes by code prefix or description. Same as [`GET /api/procedures`](https://openpipe.health/docs/api/procedures.md). | 1 | | `search_hospital_intel` | Find hospitals by primary EHR vendor (`ehr`, `ehr_changed`, `uses_product`), star rating (`min_rating`, `max_rating`), health system (`system`, `system_id`), `hospital_type`, `min_beds`, or Medicare volume in one MS-DRG (`drg`, `min_discharges`). Same as [`GET /api/hospital-intel`](https://openpipe.health/docs/api/hospital-intel.md#search-hospitals-by-ehr-rating-system-or-drg). | 1 | | `get_hospital_intel` | Account research for one hospital by `ccn`. `section` picks the result: `summary` (default) is [`GET /api/facilities/:ccn/intel`](https://openpipe.health/docs/api/hospital-intel.md#get-hospital-intel), `measures` is [`/api/facilities/:ccn/measures`](https://openpipe.health/docs/api/hospital-intel.md#list-a-hospitals-quality-measures) (with `domain`), `drgs` is [`/api/facilities/:ccn/drgs`](https://openpipe.health/docs/api/hospital-intel.md#list-a-hospitals-drg-volume) (with `limit`, `offset`). | 1 per call, free if not found | | `list_hospital_clinicians` | The clinicians affiliated with one hospital by `ccn`, highest Medicare payment first. Filter by `specialty`. Same as [`GET /api/facilities/:ccn/clinicians`](https://openpipe.health/docs/api/hospital-intel.md#list-a-hospitals-clinicians). | 1, free if not found | | `get_clinician_hospitals` | The hospitals and other facilities one clinician works at, by `npi`. Same as [`GET /api/providers/:npi/facilities`](https://openpipe.health/docs/api/hospital-intel.md#list-a-clinicians-facilities). | 1, free if not found | | `search_health_systems` | Find health systems. Filter by `q`, `state` (home office), `min_hospitals`. Same as [`GET /api/health-systems`](https://openpipe.health/docs/api/hospital-intel.md#search-health-systems). | 1 | | `get_health_system` | One health system by `system_id`, with its EHR vendor mix and hospitals. Same as [`GET /api/health-systems/:id`](https://openpipe.health/docs/api/hospital-intel.md#get-a-health-system). | 1, free if not found | | `search_care_sites` | Find nursing homes, home health agencies, hospices, dialysis facilities, surgery centers, clinics and other non-hospital sites. Filter by `types`, `q`, `state`, `city`, `zip`, `chain`, `npi`, `ownership`, `min_beds`, `min_stars`, `min_patients`, `private_equity`, `reit`, `changed_ownership_since`. Same as [`GET /api/care-sites`](https://openpipe.health/docs/api/care-sites.md#search-care-sites). | 1 | | `get_care_site` | One care site by `id`. `section` picks the result: `profile` (default) is [`GET /api/care-sites/:id`](https://openpipe.health/docs/api/care-sites.md#get-a-care-site), `owners` is [`/api/care-sites/:id/owners`](https://openpipe.health/docs/api/care-sites.md#list-a-care-sites-owners) (with `equity_only`, `limit`, `offset`). | 1 per call, free if not found | | `list_care_site_types` | The facility types `search_care_sites` accepts, with national counts. Same as [`GET /api/care-sites/types`](https://openpipe.health/docs/api/care-sites.md#list-care-site-types). | 1 | | `get_drug_market` | One `drug` by state: Medicare Part D next to Medicaid. Optional `state` and `medicaid_year`. Same as [`GET /api/market/drugs`](https://openpipe.health/docs/api/drug-markets.md#get-a-drugs-market-by-state). | 1 | | `get_drug_spending` | One `drug`'s national spending per year, 2020 to 2024, in Part D, Part B and Medicaid. Optional `program` and `by_manufacturer`. Same as [`GET /api/market/drugs/spending`](https://openpipe.health/docs/api/drug-markets.md#get-a-drugs-national-spending-by-year). | 1 | | `get_medicare_payers` | Medicare private-plan enrollment and share by parent company. National by default and [`GET /api/market/payers`](https://openpipe.health/docs/api/payers-acos.md#get-medicare-payers-in-a-state-or-the-nation) with `state`, `category`, `parent`, `limit`. With `county_fips` it is [`GET /api/market/payers/counties/:fips`](https://openpipe.health/docs/api/payers-acos.md#get-medicare-payers-in-a-county). | 1, free if the county is not found | | `search_ma_plans` | Find Medicare Advantage and Part D plans. Filter by `q`, `parent`, `state`, `category`, `plan_type`, `snp`. Same as [`GET /api/market/plans`](https://openpipe.health/docs/api/payers-acos.md#search-medicare-advantage-and-part-d-plans). | 1 | | `search_acos` | Find Medicare Shared Savings Program ACOs. Filter by `q`, `state`, `track`, `participating`, `group_pac_id`. Same as [`GET /api/market/acos`](https://openpipe.health/docs/api/payers-acos.md#search-acos). | 1 | | `get_aco` | One ACO by `id`, with its participant organizations. Same as [`GET /api/market/acos/:id`](https://openpipe.health/docs/api/payers-acos.md#get-an-aco). | 1, free if not found | | `search_experts` | Rank clinicians by the trials they lead. At least one of `condition`, `sponsor`, `state`; optional `confidence`. Same as [`GET /api/market/experts`](https://openpipe.health/docs/api/experts.md#search-experts). | 1 | | `get_expert` | One clinician's trials, NIH grants and industry payments, by `npi`. Same as [`GET /api/market/experts/:npi`](https://openpipe.health/docs/api/experts.md#get-an-expert). | 1, free if not found | | `ask` | Answer a plain-English `question` (5 to 500 characters) with a finished dashboard: title, summary, and 2 to 4 tiles with their columns and rows. For aggregates, rankings, comparisons and market sizing that the search tools cannot do. Takes 5 to 30 seconds. Same as [`POST /api/ask`](https://openpipe.health/docs/api/ask.md#json-mode) in JSON mode. | 25, nothing if no answer can be planned | | `list_datasets` | The loaded datasets with publisher, version, data year, row count and load time. Same as [`GET /api/meta`](https://openpipe.health/docs/api/meta.md). | Free | | `describe_data` | What the data means. With no arguments: every dataset with its summary, what one row is and its join keys. With `dataset`: that dataset's caveats and its columns (type, description, unit, coded values). Use it to read the columns in a result or to word an `ask` question. | Free | `tools/list` returns the full JSON Schema for each tool. Things to know: - Arguments are strict. An unknown argument, or one of the wrong type, is rejected before anything runs or is charged. This holds for every tool, including those whose REST route ignores unknown query parameters. - Arguments are typed JSON. Send numbers and booleans as such (`"min_rating": 4`, `"private_equity": true`), not as the strings a query string carries. - Three arguments are named or shaped differently from REST. `search_care_sites` takes `types` as an array (`["nursing_home", "hospice"]`) where REST takes a comma-separated `type`. `get_drug_spending` takes a boolean `by_manufacturer` where REST takes `manufacturers=true`. `get_medicare_payers` takes `county_fips` as an argument where REST has it in the path, and it cannot be combined with `state`, `parent` or `limit`. - `section` arguments are checked. On `get_hospital_intel`, `domain` is accepted only with `section: "measures"`, and `limit` and `offset` only with `section: "drgs"`. On `get_care_site`, `equity_only`, `limit` and `offset` are accepted only with `section: "owners"`. - `limit` defaults to 25. The maximum is 200, except 100 for `search_procedures`, `get_medicare_payers`, `search_ma_plans`, `search_acos` and `search_experts`. Two tools differ: `get_aco` returns 200 participants by default and up to 500, and `get_care_site` with `section: "owners"` returns 50 by default. - `offset` pages through results, up to 100,000. On the care site, plan, ACO and expert tools the maximum is 10,000. - The values, ranges and caveats of each argument are those of the matching REST parameter. The linked reference pages describe them. - `run_sql` and `get_schema` were removed. Calling either is an unknown-tool error (`-32602`). - [Exports](https://openpipe.health/docs/api/exports.md) are not available over MCP. Use the REST API, with the `id` that `ask` returns. - `ask` shares the workspace's limit of 10 questions a minute with `POST /api/ask`. - Every tool is marked read-only. ### Results A successful tool call returns the same object as the REST endpoint, twice: as JSON text in `content[0].text`, and parsed in `structuredContent`. It includes `sql` (a read-only [receipt](https://openpipe.health/docs/receipts.md)), `sources` and the [usage object](https://openpipe.health/docs/credits.md#the-usage-object). ### The `ask` result `ask` returns the same document as [JSON mode](https://openpipe.health/docs/api/ask.md#json-mode): `id`, `question`, `title`, `summary`, `followups`, `model`, `tiles`, `failed`, `sources`, `ms` and `usage`. Each tile also has `row_count`. The charge follows the same rules: once, when a plan exists, and nothing if the model cannot plan. The answer is stored as a dashboard. `id` opens it again for free at [`GET /api/dashboards/:id`](https://openpipe.health/docs/api/saved.md#open-a-dashboard). A dashboard can be larger than one tool result. When it is, every tile is kept and its rows are cut to the same smaller number (100, then 50, 25, 10, 5, 1) until the result fits. A cut tile has `rows_truncated: true`, `row_count` still gives the full count, and the result says where the rest is: ```json "response_truncated": { "reason": "Tiles are cut to 25 rows to fit the response size limit. The stored dashboard has every row.", "dashboard": "/api/dashboards/df706628-076f-4fa8-9797-c5f6028915ab" } ``` Calls made over MCP appear in [`GET /api/usage`](https://openpipe.health/docs/api/account.md#list-usage) with `meta.via` set to `mcp` and `meta.tool` set to the tool name. ## Errors There are two kinds, and they arrive differently. ### Tool errors A tool that fails still returns HTTP `200` and a normal JSON-RPC result, with `isError` set to `true` and the message as text. This is so the model can read the message and correct itself. ```json { "jsonrpc": "2.0", "id": 3, "result": { "content": [{ "type": "text", "text": "NPI must be 10 digits." }], "isError": true } } ``` Tool errors cover: - Invalid arguments: `Invalid arguments. state: must be a two-letter USPS state code` - A record that does not exist: `No provider with NPI 1234567893.` - An argument that does not fit the section: `domain applies only to section=measures.` - A question that could not be planned: `The model could not plan an answer for that question. Nothing was charged.` - Too many questions: `Too many questions. A workspace can ask 10 a minute; try again in 41s. Nothing was charged.` - A dataset that does not exist: `No dataset named "accounts". Datasets: …` - Out of credits: `Out of credits: 100 of 100 used this month, this call costs 1.` Paid tools check the balance for their own price before doing any work, so `ask` needs 25 credits left. `list_datasets` and `describe_data` keep working. - A result too large to return even after trimming. - An unexpected failure: `Internal error.` ### Protocol and transport errors These use a JSON-RPC `error` object, `{ "jsonrpc": "2.0", "id": null, "error": { "code": -32001, "message": "…" } }`, and the HTTP status tells you what went wrong. | Status | JSON-RPC code | Cause | |---|---|---| | `401` | `-32001` | No key, or an unknown or revoked key. The response has a `WWW-Authenticate: Bearer realm="Openpipe Health"` header, with `error="invalid_token"` added when a key was sent but not accepted. | | `405` | `-32000` | Any method other than `POST` (or a CORS `OPTIONS`). `GET` does not open a stream and `DELETE` has no session to end. The response has `Allow: POST, OPTIONS`. | | `415` | `-32000` | `Content-Type` is not `application/json` | | `406` | `-32000` | An `Accept` header that allows neither `application/json` nor a wildcard | | `413` | `-32000` | Request body larger than 256 KB | | `400` | `-32700` | The body is not valid JSON | | `400` | `-32600` | Not a JSON-RPC 2.0 object, a bad `id`, or a batch. Batches are not supported: send one message per `POST`. | | `400` | `-32000` | Unsupported `MCP-Protocol-Version` header | | `200` | `-32601` | Unknown method | | `200` | `-32602` | Unknown tool name, or `params` that is not an object | | `429` | none | Rate limited. See below. | | `500` | `-32603` | `Internal error.` | The key is checked before the body is read, so a request without a valid key gets `401` whatever it contains. ## Limits | Limit | Value | |---|---| | Requests | 120 per minute, counted per API key and client address together | | Request body | 256 KB | | Tool result | About 100 KB | | `ask` | 10 questions per minute per workspace, counted together with `POST /api/ask` | | `ask` question | 5 to 500 characters | **Rate limit.** Responses carry the `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers described under [Rate limits](https://openpipe.health/docs/api/errors.md#rate-limits). Past the limit the server returns `429` with a `Retry-After` header. This one response is not JSON-RPC. It has the REST error shape: ```json { "error": "Too many requests. Try again in 23s.", "code": "RATE_LIMITED" } ``` The limit is checked before the key is, so requests with a bad key count too. **Result size.** When a search or lookup result is too large, the server drops rows from the end of its largest array until it fits, and adds a `response_truncated` field that says what was cut: ```json "response_truncated": { "fields": { "rows": { "returned": 212, "of": 1000 } }, "reason": "Result exceeded the response size limit. Narrow the search with a filter, or page with limit/offset." } ``` If the result cannot be made to fit, the tool returns an error instead. Either way the call has already run and is charged, so keep `limit` modest on wide searches. An `ask` result is trimmed [per tile](#the-ask-result) instead. --- # Ask URL: https://openpipe.health/docs/api/ask/ Markdown: https://openpipe.health/docs/api/ask.md > Ask a question in plain English and receive a dashboard of up to four tiles, as one JSON document or a live event stream. ## Ask a question ```http POST /api/ask ``` Turns a question into two to four tiles, runs them in parallel and returns a small dashboard. Costs 25 credits. Common questions can cost 5 credits through [`POST /api/ask2/ask`](https://openpipe.health/docs/api/ask2.md), which answers as a stream of UI patches. [Which Ask to call](https://openpipe.health/docs/api/ask2.md#which-ask-to-call) compares the two. There are two ways to receive the answer. The price, the limits and what is stored are the same for both. | Mode | Ask for it with | You get | |---|---|---| | JSON | `Accept: application/json`, or `?stream=false` | One JSON document when the answer is finished, usually after 5 to 30 seconds | | Event stream (default) | Nothing, or `Accept: text/event-stream`, or `?stream=true` | Server-sent events: each tile as soon as it is ready | An `Accept` header that names both `application/json` and `text/event-stream` gets the stream. The `stream` parameter wins over the header. ### Body ```json { "question": "Who are the highest-volume TAVR operators in Florida?" } ``` `question` must be at least 5 characters. Anything past 500 characters is cut off. Nothing else in the body is read. ## JSON mode ```sh curl "$OPH_API/api/ask" \ -H "Authorization: Bearer $OPH_KEY" \ -H "Content-Type: application/json" -H "Accept: application/json" \ -d '{"question": "Who are the highest-volume TAVR operators in Florida?"}' ``` ```json { "id": "df706628-076f-4fa8-9797-c5f6028915ab", "question": "Who are the highest-volume TAVR operators in Florida?", "title": "Highest-volume TAVR operators in Florida", "summary": "Ranks Florida clinicians by Medicare fee-for-service TAVR services. Counts under 11 patients are withheld by CMS.", "followups": ["Which Florida hospitals do the most TAVR?"], "model": "claude-haiku-4-5", "tiles": [ { "index": 0, "type": "leaderboard", "title": "TAVR volume by operator, Florida", "x": "name", "y": "services", "format": "number", "sql": "SELECT s.npi, ... LIMIT 25", "columns": ["npi", "name", "city", "state", "services"], "rows": [{ "npi": "1234567893", "name": "Jane Example", "city": "Miami", "state": "FL", "services": 212 }], "sources": ["medicare_service", "medicare_provider"], "engine": "postgres", "ms": 41 } ], "failed": [], "sources": ["medicare_provider", "medicare_service"], "ms": 9120, "usage": { "credits": 25, "creditsUsed": 51, "creditsLimit": 100, "txid": "81260" } } ``` | Field | Meaning | |---|---| | `id` | The stored dashboard. [`GET /api/dashboards/:id`](https://openpipe.health/docs/api/saved.md#open-a-dashboard) opens it again for free, and it is what an [export](https://openpipe.health/docs/api/exports.md#export-a-tile-of-an-answer) refers to. `null` only if the answer was computed but could not be stored. | | `title`, `summary` | How the question was read, and any limit on the answer, such as Medicare-only volumes. Show the summary. | | `followups` | Up to three suggested next questions | | `tiles` | The tiles that succeeded, in planned order. `index` is the tile's position in the plan. See [tile types](#tile-types). | | `tiles[].sql` | The statement the model wrote for the tile. A [receipt](https://openpipe.health/docs/receipts.md): it shows how the numbers were computed. Nothing accepts it back. | | `failed` | Tiles whose statement was rejected or failed: `index`, `title`, `error`, `sql`. They are kept in the stored dashboard, so a free [refresh](https://openpipe.health/docs/api/saved.md#refresh-a-dashboard) retries them. | | `sources` | Every dataset the answer read | | `ms` | Total time, planning included | | `usage` | The [usage object](https://openpipe.health/docs/credits.md#the-usage-object) for this call | If the model cannot produce a plan, the response is `502`, nothing is charged and nothing is stored: ```json { "error": "The model could not plan an answer for that question. Nothing was charged.", "code": "ASK_FAILED", "charged": false } ``` ## Event stream Without a JSON `Accept` header the response is a `text/event-stream`. Events arrive in this order: | Event | Count | Data | |---|---|---| | `usage` | 1 | The [usage object](https://openpipe.health/docs/credits.md#the-usage-object) for this call. It arrives once the model has a plan, just before `plan`, so the first event can take several seconds. | | `plan` | 1 | `title`, `summary`, `followups` (up to 3 suggested next questions), `model`, `ms`, and `tiles` (each tile's `type`, `title`, `x`, `y`, `format`, without its SQL) | | `tile` | 0 to 4 | One finished tile. Arrives in completion order, so use `index` to place it. | | `tile_error` | 0 to 4 | A tile whose statement failed: `index`, `title`, `sql`, `error` | | `done` | 1 | `tiles` (planned), `failed`, `ms` (total) and `id`, the stored dashboard (`null` only if it could not be stored) | | `error` | 0 or 1 | `error`. Sent in place of everything else when the answer cannot start; the stream then ends without `done`. See [errors inside the stream](#errors-inside-the-stream). | ### A tile event ``` event: tile data: {"index":0,"tile":{"type":"bar","title":"TAVR volume by operator, Florida","sql":"SELECT ... LIMIT 15","x":"name","y":"services","format":"number","position":0},"columns":["name","services"],"rows":[{"name":"Jane Example","services":212}],"ms":41,"sources":["medicare_service","medicare_provider"],"engine":"postgres"} ``` Each tile carries its own [receipt](https://openpipe.health/docs/receipts.md): the SQL inside `tile.sql`, the `sources` it read and the `engine` that ran it. In the stream the tile's fields sit under `tile`; in JSON mode they are flattened into the tile object. ```sh curl -N "$OPH_API/api/ask" \ -H "Authorization: Bearer $OPH_KEY" -H "Content-Type: application/json" \ -d '{"question": "Who are the highest-volume TAVR operators in Florida?"}' ``` `-N` turns off curl's buffering so events print as they arrive. For a browser or Node client, see [Stream Ask in JavaScript](https://openpipe.health/docs/guides/stream-ask.md). ### Errors inside the stream Once the stream has started, the HTTP status is already `200`. A failure arrives as one `error` event and the stream ends: | Data | Meaning | |---|---| | `{ "error": "The model could not plan …", "code": "ASK_FAILED", "charged": false }` | No plan could be made. Nothing was charged or stored. | | `{ "error": "Out of credits: …", "status": 402 }` | The balance was spent by another call between the first check and the charge. Nothing was charged and no tile ran. | | `{ "error": "The answer could not be finished." }` | An unexpected failure after the charge | ## Tile types | `type` | Shape | How to draw it | |---|---|---| | `stat` | One row | Show the value in column `y` as a headline number. Other columns in the row are supporting figures. | | `leaderboard` | A ranking of named clinicians, hospitals or groups | `x` is the name column, `y` the metric it is ranked by. Rows include an `npi`, `ccn` or `group_pac_id` you can pass to a lookup endpoint. | | `map` | One row per state | `x` is `state` (a two-letter code), `y` the numeric column | | `bar` | Ranked categories | `x` is the label column, `y` the numeric column | | `line` | Ordered series | `x` and `y` as for `bar` | | `table` | A detailed list | Show `columns` as headers. `x` and `y` are `null`. | `format` is `number`, `usd`, `percent` or `null`, and says how to display `y`. A `table` tile carries at most 50 rows and any other tile at most 100. The model is asked for fewer (about 15 for a bar, 25 for a leaderboard or table), but those are instructions to the model, not limits the API enforces. ## When you are charged, and what is stored The same four steps run in both modes, in this order: 1. **Checks before any work.** The request is rate limited (10 asks a minute per workspace, shared with the MCP [`ask` tool](https://openpipe.health/docs/mcp.md#tools)) and the balance must cover 25 credits, or the answer is `429` or `402`. 2. **The model plans.** If it cannot produce a plan, the call ends: nothing is charged, nothing is stored. 3. **The workspace is charged, once.** This happens when a plan exists and before any tile runs. If the balance was spent in the meantime the call ends with `402`: no tile runs and nothing is stored. 4. **Tiles run and one dashboard is stored.** Exactly one, whether or not you are still connected. If your connection drops, the answer is still finished, charged and stored; find it with [`GET /api/dashboards`](https://openpipe.health/docs/api/saved.md#list-dashboards) instead of asking again. Things to know: - **A planned tile is not a guaranteed tile.** The model writes the SQL, and each statement is [checked](https://openpipe.health/docs/receipts.md#how-model-written-sql-is-checked) before it runs. One that fails is reported (`failed` in JSON mode, `tile_error` in the stream) and the others still arrive. The call is still charged. - **The planner is shown the tables your question needs, not all of them.** A fast classifier picks the table groups (procedures, prescribing, hospitals, care sites, payers and so on) before the model plans; if a statement then reads a table that was left out, that table is added and the statement is rewritten once. Naming the thing you mean ("hospices", "Medicare Advantage", "trial investigators") helps the right tables get picked. - **A tile that would double count is rewritten or withheld.** Before a statement runs it is checked for a sum over a one-to-many join (a facility's payment repeated once per owner) and for procedure volume picked by a loose text match. The model is asked to rewrite it. If the double count is still there, the tile is reported as failed with an `error` that starts with `Withheld:` and no figure is shown. - **A failed tile can be retried for free.** It is stored with the dashboard, and [refresh](https://openpipe.health/docs/api/saved.md#refresh-a-dashboard) runs every tile's stored statement again without calling the model. - **Tiles hold a page, not everything.** A `table` tile carries at most 50 rows and any other tile at most 100. For every row a tile's statement returns, [export the tile](https://openpipe.health/docs/api/exports.md#export-a-tile-of-an-answer). - **Answers are kept as recent dashboards.** A workspace keeps its newest 50 unsaved answers; a signed-in person can [save](https://openpipe.health/docs/api/saved.md#save-unsave-or-rename-a-dashboard) one to keep it. - **Opening a stored answer is free.** [`GET /api/dashboards/:id`](https://openpipe.health/docs/api/saved.md#open-a-dashboard) returns the stored rows. - **There is no way to send your own SQL.** `sql` fields are receipts. To change what a tile computes, ask a different question. ## Errors These arrive as an ordinary JSON error, in either mode, before any answer starts: | Status | Message | |---|---| | `400` | `Body must be {"question": "..."}.` | | `402` | `Out of credits: …` | | `429` | `Too many requests. Try again in 23s.` | In JSON mode two more can follow: `502` with `code: "ASK_FAILED"` when no plan could be made, and `402` when the balance was spent between the first check and the charge. In the stream the same two arrive as an [`error` event](#errors-inside-the-stream). --- # Exports URL: https://openpipe.health/docs/api/exports/ Markdown: https://openpipe.health/docs/api/exports.md > Write every row of a list search, or of one tile of an answer, to a CSV of up to 500,000 rows and get a download link. ## Create an export ```http POST /api/exports ``` Writes a full result to a CSV file and returns a link to it. Costs 10 credits. An export is made by reference. You name something the server can already build or already holds, and the server runs the statement. The body takes one of two shapes: | Shape | Exports | |---|---| | `{ "list": …, "params": { … } }` | Every row of a [list search](#export-a-list), not just a page | | `{ "dashboard": "", "tile": }` | Every row of [one tile of a stored answer](#export-a-tile-of-an-answer) | **No SQL is accepted.** The body is validated strictly: any field that is not listed on this page, including `sql`, is a `400`. ### Export a list ```sh curl "$OPH_API/api/exports" \ -H "Authorization: Bearer $OPH_KEY" -H "Content-Type: application/json" \ -d '{"list": "providers", "params": {"hcpcs": "27447", "state": "TX", "min_services": 50}}' ``` `list` is `providers`, `facilities` or `groups`. `params` takes the filters of the matching search endpoint, without `limit` and `offset`, and the server builds the statement with the same code as the search. The CSV has the columns the search returns. | `list` | `params` | Same as | |---|---|---| | `providers` | `q`, `state`, `city`, `specialty`, `entity` (`"I"` or `"O"`), `hcpcs`, `min_services` (number), `sort` (`payment`, `patients` or `services`) | [`GET /api/providers`](https://openpipe.health/docs/api/providers.md) | | `facilities` | `q`, `state`, `city`, `min_beds` (integer), `ownership` (`proprietary` or `non-profit`), `private_equity` (boolean), `sort` (`beds`, `revenue` or `discharges`) | [`GET /api/facilities`](https://openpipe.health/docs/api/facilities.md) | | `groups` | `q`, `state`, `min_members` (integer), `specialty` | [`GET /api/groups`](https://openpipe.health/docs/api/groups.md) | Unlike the search endpoints, which take everything as query-string text, `params` is typed JSON: numbers are numbers, `private_equity` is `true` or `false`, `state` is two letters and `hcpcs` is five characters. A wrong type or an unknown filter is a `400`, not an empty result. `params` may be left out or empty, which exports the whole list up to the row limit. ### Export a tile of an answer ```sh curl "$OPH_API/api/exports" \ -H "Authorization: Bearer $OPH_KEY" -H "Content-Type: application/json" \ -d '{"dashboard": "df706628-076f-4fa8-9797-c5f6028915ab", "tile": 0}' ``` | Field | Meaning | |---|---| | `dashboard` | The id of a stored answer in this workspace: `id` from [Ask](https://openpipe.health/docs/api/ask.md#json-mode) or from [`GET /api/dashboards`](https://openpipe.health/docs/api/saved.md#list-dashboards) | | `tile` | The tile's position in the dashboard's `tiles` array, from 0 to 7 | The server runs the statement stored for that tile when the question was asked, through the same [checks](https://openpipe.health/docs/receipts.md#how-model-written-sql-is-checked) as any model-written SQL, with the export's limits in place of the tile's. A tile shows at most 50 or 100 rows; the export has every row the statement returns. If the statement itself ends in a `LIMIT`, as a ranking usually does, the export stops there too. An id that does not exist, an id from another workspace and a tile index the dashboard does not have all answer `404` with the same message. ### Response Returns `201`. ```json { "id": "2f0c6c0e-6d5b-4b55-9d0b-1f3c9d2a7e11", "source": { "list": "providers", "params": { "hcpcs": "27447", "state": "TX", "min_services": 50 } }, "rows": 1384, "bytes": 92140, "truncated": false, "engine": "postgres", "ms": 180, "url": "https://…/2f0c6c0e-….csv?X-Amz-Signature=…", "expiresIn": 3600, "usage": { "credits": 10, "creditsUsed": 25, "creditsLimit": 100, "txid": "81250" } } ``` | Field | Meaning | |---|---| | `source` | What was exported: `{ list, params }`, or `{ dashboard, tile, title }` | | `url` | A signed download link. Anyone with the link can download the file until it expires. | | `expiresIn` | Seconds until `url` stops working. Always 3600. | | `truncated` | `true` if more than 500,000 rows matched and the rest were left out | | `bytes` | Size of the CSV | | `engine` | `postgres` or `duckdb`. See [which engine ran](https://openpipe.health/docs/receipts.md#which-engine-ran). | The file is UTF-8 CSV with a header row. Each export gets a new file; nothing is overwritten. ### Limits and charging | Limit | Value | |---|---| | Rows | 500,000 | | Time | 30 seconds | | Exports | 10 per minute per workspace | | Price | 10 credits | - The balance must cover 10 credits before anything runs, or the answer is `402`. - The charge is made after the statement has run. An export that is rejected, fails or times out is free. ### Errors | Status | Message | Cause | |---|---|---| | `400` | `Exports do not accept SQL. Send {"dashboard": …} … or {"list": …} …` | The body has a `sql` field | | `400` | `Send {"dashboard": "", "tile": } … or {"list": …, "params": {...}} …` | Neither shape, or both at once | | `400` | `Invalid export request. params.state: must be a two-letter USPS state code` | A field of the wrong type or value, or an unknown filter | | `400` | `"list" must be "providers", "facilities" or "groups".` | | | `400` | `The export exceeded the 30s time limit. Narrow the list with a filter.` | | | `400` | The statement's own error | A tile whose stored statement no longer runs | | `404` | `No stored answer with that id and tile in this workspace.` | The id is unknown, belongs to another workspace, or the dashboard has no tile at that index | | `409` | `This tile has no result to export yet. Refresh the answer … and export it once the tile has rows.` | The tile failed when the question was asked and has never returned rows. [Refresh the dashboard](https://openpipe.health/docs/api/saved.md#refresh-a-dashboard) (free) first | | `402`, `429` | | See [Credits](https://openpipe.health/docs/credits.md#running-out) and [Rate limits](https://openpipe.health/docs/api/errors.md#rate-limits) | ## List exports ```http GET /api/exports ``` Returns your 20 most recent exports, newest first, each with a fresh one-hour link. Not metered. ```json { "rows": [ { "id": "2f0c6c0e-…", "rows": 1384, "bytes": 92140, "createdAt": "2026-12-05T02:14:09.000Z", "url": "https://…" } ] } ``` If a link has expired, call this endpoint for a new one. You are not charged again. --- # Tables URL: https://openpipe.health/docs/data/tables/ Markdown: https://openpipe.health/docs/data/tables.md > The tables behind every answer, what one row is, and what every column means. These 45 tables hold everything the API answers from. You do not query them yourself: the [search and lookup endpoints](https://openpipe.health/docs/api/providers.md) and [Ask](https://openpipe.health/docs/api/ask.md) read them for you, and each response shows the SQL it ran as a [receipt](https://openpipe.health/docs/receipts.md). Use this page to understand the columns in a result and to word a question. The same descriptions feed the data catalog in the workspace, the schema the model is given when it plans an answer, and the MCP `describe_data` tool. The notes under each table are written for whoever writes the SQL, which is the model. Read [Caveats](https://openpipe.health/docs/data/caveats.md) before quoting a number. ## Clinicians ### `medicare_provider` Medicare Part B activity per clinician or organization: patients, services and dollars for the year. One row is one clinician or organization that billed Medicare Part B, per year. Key: `(npi, year)`. How it is read: - Display name is trim(coalesce(first_name || ' ', '') || last_org_name). - Some provider_type values: 'Orthopedic Surgery', 'Cardiology', 'Internal Medicine', 'Nurse Practitioner', 'Dermatology', 'Ophthalmology', 'Urology', 'Gastroenterology', 'Diagnostic Radiology', 'Family Practice'. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the rendering clinician or organization. | | `year` | smallint | Calendar year the figures cover. | | `last_org_name` | text | Last name of an individual, or the organization name when entity_type is 'O'. Mixed case. | | `first_name` | text | First name of an individual. NULL for organizations. | | `credentials` | text | Credentials of an individual, for example M.D. NULL for organizations. | | `entity_type` | char(1) | Whether the NPI belongs to a person or an organization. `I` individual, `O` organization. | | `city` | text | City of the provider's practice address. | | `state` | char(2) | Two-letter USPS state code of the provider. | | `zip5` | char(5) | Five-digit ZIP code of the provider. | | `provider_type` | text | Medicare specialty: the specialty code on the provider's claims, or the one with the most services when there are several. | | `tot_hcpcs_codes` | integer, codes | Number of distinct HCPCS procedure codes the provider billed. | | `tot_benes` | integer, patients | Distinct Medicare patients the provider saw. | | `tot_srvcs` | double precision, services | Services provided. Can be fractional, because some services are counted in units. | | `tot_charges` | double precision, USD | Total charges the provider submitted. Charges are list prices and are usually far above what Medicare allows or pays. | | `tot_allowed` | double precision, USD | Total Medicare allowed amount: what Medicare paid plus the patient's deductible and coinsurance and any third-party share. | | `tot_payment` | double precision, USD | Total amount Medicare paid, after the deductible and coinsurance were subtracted. | | `drug_tot_payment` | double precision, USD | Part of tot_payment paid for Part B drug services. | | `med_tot_payment` | double precision, USD | Part of tot_payment paid for medical (non-drug) services. | | `avg_age` | double precision, years | Average age of the provider's Medicare patients. | | `dual_benes` | integer, patients | Patients entitled to both Medicare and Medicaid. | | `avg_risk_score` | double precision, score | Average HCC risk score of the provider's patients. 1.0 is the Medicare average; higher means sicker patients. | Indexed on `(state, provider_type, tot_payment)`. Joins: `medicare_service` on `medicare_provider.npi = medicare_service.npi`; `providers` on `medicare_provider.npi = providers.npi`; `partd_provider` on `medicare_provider.npi = partd_provider.npi`; `partd_drug` on `medicare_provider.npi = partd_drug.npi`; `hospitals` on `medicare_provider.npi = hospitals.npi`; `group_members` on `medicare_provider.npi = group_members.npi`; `open_payments` on `medicare_provider.npi = open_payments.npi`; `clinician_facilities` on `medicare_provider.npi = clinician_facilities.npi`; `facilities` on `medicare_provider.npi = facilities.npi`; `trial_investigators` on `medicare_provider.npi = trial_investigators.npi`; `nih_grants` on `medicare_provider.npi = nih_grants.npi`. Know before you use it: - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. - CMS withholds any figure based on fewer than 11 patients. A withheld value is NULL, which means hidden, not zero. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. - Specialty is the Medicare specialty name (Cardiology), which differs from the NUCC classification in providers.specialty. ### `medicare_service` Procedure volume per clinician: how often each provider billed each HCPCS code to Medicare Part B, split by place of service. One row is one clinician, one HCPCS procedure code and one place of service, per year. Key: `(npi, year, hcpcs_code, place_of_service)`. How it is read: - About 9.8M rows; ALWAYS filter by hcpcs_code. - Medicare payment for a row = avg_payment * tot_srvcs. - Join to medicare_provider on (npi, year) for names and cities, and to hcpcs on hcpcs_code = hcpcs.code for the description. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the rendering clinician or organization. | | `year` | smallint | Calendar year the figures cover. | | `hcpcs_code` | text | HCPCS procedure code billed, for example 27447 (total knee replacement). Described in hcpcs. | | `place_of_service` | char(1) | Where the service was delivered. `F` facility, such as a hospital or surgery center, `O` office or other non-facility setting. | | `state` | char(2) | Two-letter USPS state code of the provider. | | `specialty` | text | Medicare specialty of the provider, same values as medicare_provider.provider_type. | | `tot_benes` | integer, patients | Distinct Medicare patients who received this service from this provider. | | `tot_srvcs` | double precision, services | Number of times the service was provided. Can be fractional. | | `tot_bene_day_srvcs` | integer, services | Distinct patient-per-day services: the same service given to one patient more than once in a day counts once. | | `avg_charge` | double precision, USD per service | Average charge the provider submitted for the service. | | `avg_allowed` | double precision, USD per service | Average Medicare allowed amount: Medicare's payment plus the patient's deductible and coinsurance. | | `avg_payment` | double precision, USD per service | Average amount Medicare paid per service, after the deductible and coinsurance. | Indexed on `(hcpcs_code, state, tot_srvcs)`. Joins: `medicare_provider` on `medicare_service.npi = medicare_provider.npi`; `providers` on `medicare_service.npi = providers.npi`; `partd_provider` on `medicare_service.npi = partd_provider.npi`; `partd_drug` on `medicare_service.npi = partd_drug.npi`; `hospitals` on `medicare_service.npi = hospitals.npi`; `group_members` on `medicare_service.npi = group_members.npi`; `open_payments` on `medicare_service.npi = open_payments.npi`; `clinician_facilities` on `medicare_service.npi = clinician_facilities.npi`; `facilities` on `medicare_service.npi = facilities.npi`; `trial_investigators` on `medicare_service.npi = trial_investigators.npi`; `nih_grants` on `medicare_service.npi = nih_grants.npi`; `hcpcs` on `medicare_service.hcpcs_code = hcpcs.code`; `rollup_hcpcs_state` on `medicare_service.hcpcs_code = rollup_hcpcs_state.hcpcs_code`; `drug_spending` on `medicare_service.hcpcs_code = drug_spending.hcpcs_code`. Know before you use it: - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. - A clinician who performed a procedure on fewer than 11 Medicare patients has no row for it, so sums over many small providers undercount. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. - Specialty is the Medicare specialty name (Cardiology), which differs from the NUCC classification in providers.specialty. ### `hcpcs` The procedure code dictionary: every HCPCS code that appears in medicare_service, with its description and national volume. One row is one HCPCS procedure code. Key: `code`. How it is read: - If unsure of a code, look it up by description with ILIKE. | Column | Type | Meaning | |---|---|---| | `code` | text | HCPCS code: a five-character CPT or HCPCS Level II code. | | `description` | text | CMS description of the code. | | `is_drug` | boolean | True when CMS flags the code as a Part B drug (it is on the Medicare Average Sales Price drug list). | | `providers` | integer, providers | Distinct clinicians and organizations that billed the code. | | `tot_srvcs` | double precision, services | Services billed under the code nationally, summed over medicare_service. | Joins: `medicare_service` on `hcpcs.code = medicare_service.hcpcs_code`; `rollup_hcpcs_state` on `hcpcs.code = rollup_hcpcs_state.hcpcs_code`; `drug_spending` on `hcpcs.code = drug_spending.hcpcs_code`. Know before you use it: - Only codes billed to Medicare Part B in 2024 by at least one provider above the 11-patient threshold. It is not the full HCPCS code set. - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. ### `providers` The national NPI registry (NPPES): every active clinician and healthcare organization that holds a National Provider Identifier. One row is one active NPI, either a person or an organization. Key: `npi`. How it is read: - About 9.5M rows. Names, cities and addresses are UPPERCASE. Only use for lookups by npi or joined on npi, or filter by state and specialty (indexed). | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the clinician or organization. | | `entity_type` | char(1) | Whether the NPI belongs to a person or an organization. `I` individual, `O` organization. | | `name` | text | Display name: first and last name for a person, legal business name for an organization. UPPERCASE. A handful of registry rows have no legal name; they fall back to the other organization name, then to 'NPI '. | | `first_name` | text | First name of an individual. NULL for organizations. | | `last_name` | text | Legal last name of an individual. NULL for organizations. | | `org_name` | text | Legal business name of an organization. NULL for individuals. | | `credentials` | text | Credential text as the provider typed it, for example MD, M.D. or LCSW. Not standardized. | | `sex` | char(1) | Sex code of an individual as recorded in the registry. NULL for organizations. `F` female, `M` male. A small share of records carry other codes (X, U), kept as published. | | `taxonomy_code` | text | NUCC taxonomy code the provider marked as primary (the first listed code when none is marked). | | `specialty` | text | NUCC classification of the primary taxonomy code, for example Internal Medicine, Nurse Practitioner or Dentist. | | `subspecialty` | text | NUCC specialization of the primary taxonomy code, for example Cardiovascular Disease. NULL when the code has none. | | `address1` | text | First line of the business practice location address. | | `address2` | text | Second line of the business practice location address. | | `city` | text | City of the business practice location. UPPERCASE. | | `state` | char(2) | Two-letter USPS state code of the business practice location. | | `zip5` | char(5) | Five-digit ZIP code of the business practice location. | | `phone` | text | Telephone number of the business practice location, digits only. | | `enumeration_date` | date | Date the NPI was assigned. | | `last_updated` | date | Date the registry record was last updated. | Indexed on `(state, specialty)`, `name` for substring search, `zip5`. Joins: `medicare_provider` on `providers.npi = medicare_provider.npi`; `medicare_service` on `providers.npi = medicare_service.npi`; `partd_provider` on `providers.npi = partd_provider.npi`; `partd_drug` on `providers.npi = partd_drug.npi`; `hospitals` on `providers.npi = hospitals.npi`; `group_members` on `providers.npi = group_members.npi`; `open_payments` on `providers.npi = open_payments.npi`; `clinician_facilities` on `providers.npi = clinician_facilities.npi`; `facilities` on `providers.npi = facilities.npi`; `trial_investigators` on `providers.npi = trial_investigators.npi`; `nih_grants` on `providers.npi = nih_grants.npi`. Know before you use it: - A registry snapshot, newer than the 2024 Medicare tables. Details are self-reported by each provider and can be out of date. - specialty is the NUCC taxonomy classification, which differs from the Medicare specialty names in medicare_provider.provider_type. - Holding an NPI does not mean billing Medicare. Join to medicare_provider to find clinicians with activity. ### `clinician_facilities` Which facilities each clinician works at: hospital affiliations plus nursing homes, home health agencies, hospices, dialysis, rehabilitation and long-term care facilities. One row is one clinician and one facility they are affiliated with. Key: `(npi, ccn)`. How it is read: - Hospital medical staff: WHERE ccn = '...' AND facility_type = 'Hospital'. Join npi to providers for name and specialty, or to medicare_provider for Medicare volume. - Count clinicians per hospital with count(*): (npi, ccn) is unique. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the clinician. | | `ccn` | char(6) | CMS Certification Number of the facility. Joins to hospitals.ccn for hospital-type rows. | | `facility_type` | text | Kind of facility: Hospital, Home health agency, Hospice, Nursing home, Dialysis facility, Inpatient rehabilitation facility or Long-term care hospital. | | `parent_ccn` | char(6) | CCN of the parent hospital when the facility is a unit inside one. NULL otherwise. | Indexed on `ccn`. Joins: `medicare_provider` on `clinician_facilities.npi = medicare_provider.npi`; `medicare_service` on `clinician_facilities.npi = medicare_service.npi`; `providers` on `clinician_facilities.npi = providers.npi`; `partd_provider` on `clinician_facilities.npi = partd_provider.npi`; `partd_drug` on `clinician_facilities.npi = partd_drug.npi`; `hospitals` on `clinician_facilities.npi = hospitals.npi`; `group_members` on `clinician_facilities.npi = group_members.npi`; `open_payments` on `clinician_facilities.npi = open_payments.npi`; `facilities` on `clinician_facilities.npi = facilities.npi`; `trial_investigators` on `clinician_facilities.npi = trial_investigators.npi`; `nih_grants` on `clinician_facilities.npi = nih_grants.npi`; `hospitals` on `clinician_facilities.ccn = hospitals.ccn`; `hospital_owners` on `clinician_facilities.ccn = hospital_owners.ccn`; `hospital_quality` on `clinician_facilities.ccn = hospital_quality.ccn`; `hospital_measures` on `clinician_facilities.ccn = hospital_measures.ccn`; `hospital_ehr` on `clinician_facilities.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `clinician_facilities.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `clinician_facilities.ccn = hospital_systems.ccn`; `hospital_drgs` on `clinician_facilities.ccn = hospital_drgs.ccn`; `facilities` on `clinician_facilities.ccn = facilities.hospital_ccn`. Know before you use it: - From Medicare claims: CMS lists a facility when the clinician billed for services to patients there in recent months. It shows where a clinician practices, not employment, admitting privileges or a full medical-staff roster. - Only clinicians in Medicare's Doctors and Clinicians directory. Those who see no Medicare patients, and most residents, are absent. - November 2026 release. CMS lists at most five hospitals per clinician, so the busiest multi-hospital clinicians are truncated. - ccn joins to hospitals only for facility_type 'Hospital', 'Long-term care hospital' and 'Inpatient rehabilitation facility'. For nursing homes, home health agencies, hospices and dialysis facilities it equals facilities.facility_id (about 9 in 10 nursing home rows and nearly all of the others match). ## Prescribing ### `partd_provider` Medicare Part D prescribing totals per prescriber: claims, cost, patients, and the brand, generic and opioid split. One row is one prescriber, per year. Key: `(npi, year)`. How it is read: - No name columns. For prescriber names: LEFT JOIN providers p ON p.npi = d.npi and select p.name. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the prescriber. | | `year` | smallint | Calendar year the figures cover. | | `state` | char(2) | Two-letter USPS state code of the prescriber. | | `specialty` | text | Specialty of the prescriber as CMS reports it: the Medicare specialty from their Part B claims, or their registry taxonomy when they have none. | | `tot_claims` | integer, claims | Part D prescription claims, original fills and refills together. | | `tot_30day_fills` | double precision, fills | Claims standardized to 30-day fills: a 90-day prescription counts as three. | | `tot_drug_cost` | double precision, USD | Total drug cost of all claims: ingredient cost, dispensing fee and sales tax, whoever paid it. Includes what the plan, the patient and government subsidies paid. Manufacturer rebates are not subtracted. | | `tot_day_supply` | bigint, days | Total days of medication supplied across all claims. | | `tot_benes` | integer, patients | Distinct Medicare patients with at least one claim from this prescriber. | | `brand_claims` | integer, claims | Claims for brand-name drugs. | | `brand_cost` | double precision, USD | Drug cost of brand-name claims. | | `generic_claims` | integer, claims | Claims for generic drugs. | | `generic_cost` | double precision, USD | Drug cost of generic claims. | | `opioid_claims` | integer, claims | Claims for opioid drugs. | | `opioid_rate` | double precision, percent | Opioid claims as a percentage of all the prescriber's claims, 0 to 100. | Joins: `medicare_provider` on `partd_provider.npi = medicare_provider.npi`; `medicare_service` on `partd_provider.npi = medicare_service.npi`; `providers` on `partd_provider.npi = providers.npi`; `partd_drug` on `partd_provider.npi = partd_drug.npi`; `hospitals` on `partd_provider.npi = hospitals.npi`; `group_members` on `partd_provider.npi = group_members.npi`; `open_payments` on `partd_provider.npi = open_payments.npi`; `clinician_facilities` on `partd_provider.npi = clinician_facilities.npi`; `facilities` on `partd_provider.npi = facilities.npi`; `trial_investigators` on `partd_provider.npi = trial_investigators.npi`; `nih_grants` on `partd_provider.npi = nih_grants.npi`. Know before you use it: - Medicare Part D only: prescriptions paid through a Part D plan. Drugs given in a clinic (Part B) and other payers are not counted. - CMS withholds any figure based on fewer than 11 patients. A withheld value is NULL, which means hidden, not zero. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. ### `partd_drug` Medicare Part D prescribing per prescriber and drug: who writes how much of what. One row is one prescriber and one drug (brand name plus generic name), per year. Key: `(npi, year, brand_name, generic_name)`. Lake only: stored as Parquet and scanned by the analytics engine. It is not in Postgres and has no indexes. How it is read: - 28M rows, columnar (fast to aggregate). Always filter by generic_name or brand_name. - Drug names are title case and exact: brand_name 'Eliquis', generic_name 'Apixaban'. Prefer generic_name to cover all brands. - No name columns. For prescriber names: LEFT JOIN providers p ON p.npi = d.npi and select p.name. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the prescriber. | | `year` | smallint | Calendar year the figures cover. | | `brand_name` | text | Brand name of the drug, title case, for example Eliquis. For a generic it repeats the generic name. | | `generic_name` | text | Generic (ingredient) name of the drug, title case, for example Apixaban. | | `state` | char(2) | Two-letter USPS state code of the prescriber. | | `specialty` | text | Specialty of the prescriber as CMS reports it: the Medicare specialty from their Part B claims, or their registry taxonomy when they have none. | | `tot_claims` | integer, claims | Part D prescription claims for this drug, original fills and refills together. | | `tot_30day_fills` | double precision, fills | Claims standardized to 30-day fills: a 90-day prescription counts as three. | | `tot_day_supply` | integer, days | Total days of this drug supplied. | | `tot_drug_cost` | double precision, USD | Total drug cost of these claims: ingredient cost, dispensing fee and sales tax, whoever paid it. Rebates are not subtracted. | | `tot_benes` | integer, patients | Distinct Medicare patients who filled this drug from this prescriber. NULL when fewer than 11. | Joins: `medicare_provider` on `partd_drug.npi = medicare_provider.npi`; `medicare_service` on `partd_drug.npi = medicare_service.npi`; `providers` on `partd_drug.npi = providers.npi`; `partd_provider` on `partd_drug.npi = partd_provider.npi`; `hospitals` on `partd_drug.npi = hospitals.npi`; `group_members` on `partd_drug.npi = group_members.npi`; `open_payments` on `partd_drug.npi = open_payments.npi`; `clinician_facilities` on `partd_drug.npi = clinician_facilities.npi`; `facilities` on `partd_drug.npi = facilities.npi`; `trial_investigators` on `partd_drug.npi = trial_investigators.npi`; `nih_grants` on `partd_drug.npi = nih_grants.npi`. Know before you use it: - Medicare Part D only: prescriptions paid through a Part D plan. Drugs given in a clinic (Part B) and other payers are not counted. - A prescriber and drug pair with fewer than 11 claims has no row. tot_benes is NULL when fewer than 11 patients, which is more than half the rows. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. - Lake only: stored as Parquet and scanned by the analytics engine. It has no indexes and cannot be joined to on Postgres. ## Hospitals ### `hospitals` Every Medicare-enrolled hospital: identity and type from its enrollment record, size and financials from its latest cost report, and an ownership summary. One row is one hospital, identified by its CMS Certification Number (CCN). Key: `ccn`. How it is read: - Names are UPPERCASE. Filter out NULL beds or revenue before ranking by them. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number: the six-character Medicare provider number of the hospital. | | `npi` | bigint | National Provider Identifier on the hospital's Medicare enrollment. NULL when the hospital is known only from a cost report. | | `name` | text | Hospital name: the doing-business-as name when there is one, otherwise the legal organization name. UPPERCASE. | | `dba` | text | Legal organization name on the Medicare enrollment. Despite the column name, this is the legal name; the doing-business-as name, when there is one, is in name. | | `address` | text | Street address of the hospital. | | `city` | text | City of the hospital. UPPERCASE. | | `state` | char(2) | Two-letter USPS state code of the hospital. | | `zip5` | char(5) | Five-digit ZIP code of the hospital. | | `org_structure` | text | Legal structure on the enrollment record, for example CORPORATION, LLC or GOVERNMENT. | | `ownership` | text | For-profit status on the enrollment record. `proprietary` for-profit, `non-profit` non-profit. NULL when the enrollment record does not say. | | `control_type` | text | Type of control code from the cost report (who runs the hospital). `1` voluntary non-profit, church, `2` voluntary non-profit, other, `3` proprietary, individual, `4` proprietary, corporation, `5` proprietary, partnership, `6` proprietary, other, `7` governmental, federal, `8` governmental, city-county, `9` governmental, county, `10` governmental, state, `11` governmental, hospital district, `12` governmental, city, `13` governmental, other. | | `facility_type` | text | CMS facility type code from the cost report. `STH` short-term acute care, `CAH` critical access, `PH` psychiatric, `RH` rehabilitation, `LTCH` long-term care, `CH` children's, `RNMHC` religious non-medical health care institution. Two more codes, ORD and TC, appear on fewer than ten hospitals. | | `is_acute_care` | boolean | True when the enrollment lists an acute care subgroup. | | `is_critical_access` | boolean | True when the cost report facility type is CAH (critical access hospital). NULL without a cost report. | | `is_childrens` | boolean | True when the enrollment lists a children's subgroup. | | `is_psychiatric` | boolean | True when the enrollment lists a psychiatric subgroup. | | `is_rehabilitation` | boolean | True when the enrollment lists a rehabilitation subgroup. | | `is_long_term` | boolean | True when the enrollment lists a long-term care subgroup. | | `rural_urban` | text | Rural or urban designation from the cost report. `R` rural, `U` urban, `NA` not reported. | | `beds` | integer, beds | Number of beds reported on the cost report. | | `discharges` | integer, discharges | Total discharges for the fiscal year, all payers (Medicare, Medicaid and everyone else). | | `fte` | double precision, FTE | Full-time-equivalent employees on payroll. | | `net_patient_revenue` | double precision, USD | Net patient revenue for the fiscal year: patient charges less contractual allowances and discounts. | | `total_costs` | double precision, USD | Total costs for the fiscal year. | | `net_income` | double precision, USD | Net income for the fiscal year. Negative means a loss. | | `fiscal_year_end` | date | Last day of the fiscal year the cost report covers. | | `owner_count` | integer, records | Number of owner and managing-party records disclosed for the hospital (rows in hospital_owners). | | `has_private_equity_owner` | boolean | True when any disclosed owner is flagged as a private equity company. | | `top_owner` | text | Name of the party with the largest disclosed ownership percentage. NULL when nobody reports a share above zero. Can be a person. Officers and directors report 0% and are never the top owner. | Indexed on `(state, beds)`, `name` for substring search. Joins: `hospital_owners` on `hospitals.ccn = hospital_owners.ccn`; `hospital_quality` on `hospitals.ccn = hospital_quality.ccn`; `hospital_measures` on `hospitals.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospitals.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospitals.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospitals.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospitals.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospitals.ccn = clinician_facilities.ccn`; `facilities` on `hospitals.ccn = facilities.hospital_ccn`; `medicare_provider` on `hospitals.npi = medicare_provider.npi`; `medicare_service` on `hospitals.npi = medicare_service.npi`; `providers` on `hospitals.npi = providers.npi`; `partd_provider` on `hospitals.npi = partd_provider.npi`; `partd_drug` on `hospitals.npi = partd_drug.npi`; `group_members` on `hospitals.npi = group_members.npi`; `open_payments` on `hospitals.npi = open_payments.npi`; `clinician_facilities` on `hospitals.npi = clinician_facilities.npi`; `facilities` on `hospitals.npi = facilities.npi`; `trial_investigators` on `hospitals.npi = trial_investigators.npi`; `nih_grants` on `hospitals.npi = nih_grants.npi`. Know before you use it: - Beds, discharges, staffing and financials are self-reported on the hospital's Medicare cost report for the fiscal year ending fiscal_year_end. About a third of hospitals have no cost report on file, and those columns are NULL for them. - Private-equity and owner fields come from the ownership disclosures hospitals file with CMS. They reflect what was disclosed, and CMS has said the reporting is incomplete. - Enrollment and ownership are a late-2026 snapshot; cost reports are fiscal year 2024. ### `hospital_owners` Every owner and managing party a hospital disclosed to CMS: companies and people, their role and their ownership share. One row is one owner or managing party in one role at one hospital. Key: `id`. How it is read: - Join to hospitals on ccn. | Column | Type | Meaning | |---|---|---| | `id` | bigint | Row number assigned when the table is loaded. Not stable between loads. | | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `owner_name` | text | Name of the owner or managing party: an organization name, or a person's first and last name. UPPERCASE. | | `owner_type` | char(1) | Whether the party is a person or an organization. `I` individual, `O` organization. | | `role` | text | The party's role, for example CORPORATE DIRECTOR or 5% OR GREATER DIRECT OWNERSHIP INTEREST. | | `title` | text | Job title as the hospital entered it, for example BOARD MEMBER or CEO. Free text. | | `association_date` | date | Date the party took up this role with the hospital. Typed in by the filer; a few dates are implausibly old. | | `pct_ownership` | double precision, percent | Ownership share the party holds, 0 to 100. Officers and directors report 0 or leave it blank (NULL). | | `is_private_equity` | boolean | True when an organization owner is flagged as a private equity company. NULL for individuals. | | `is_reit` | boolean | True when an organization owner is flagged as a real estate investment trust. NULL for individuals. | | `is_holding_company` | boolean | True when an organization owner is flagged as a holding company. NULL for individuals. | | `is_for_profit` | boolean | True when an organization owner is flagged as a for-profit entity. NULL for individuals. | Indexed on `ccn`. Joins: `hospitals` on `hospital_owners.ccn = hospitals.ccn`; `hospital_quality` on `hospital_owners.ccn = hospital_quality.ccn`; `hospital_measures` on `hospital_owners.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospital_owners.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospital_owners.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospital_owners.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospital_owners.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_owners.ccn = clinician_facilities.ccn`; `facilities` on `hospital_owners.ccn = facilities.hospital_ccn`. Know before you use it: - Self-disclosed to CMS, and CMS has said the reporting is incomplete. The private-equity, REIT and holding-company flags are the filer's own answers. - Most rows are directors, officers and managing employees with a 0% share, not equity owners. Filter on pct_ownership or role to find owners. - id is a row number assigned at load time. It changes when the data is reloaded, so do not store it. ### `hospital_quality` CMS Care Compare quality scorecard per hospital: overall star rating, patient-survey stars, readmission, mortality, infection, emergency-department and spending headlines. One row is one hospital in Care Compare, identified by its CCN. Key: `ccn`. How it is read: - Join to hospitals on ccn for name, state, beds and revenue. - Lower is better for readmission_rate, mortality_rate, psi_90, the *_sir columns, ed_median_minutes and left_without_being_seen_pct. Higher is better for star ratings, recommend_pct and sepsis_care_pct. - The full list of measures per hospital is in hospital_measures. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `hospital_type` | text | Care Compare hospital type, for example Acute Care Hospitals or Critical Access Hospitals. | | `ownership_type` | text | Care Compare ownership category, for example Voluntary non-profit - Private, Proprietary or Government - Local. | | `has_emergency_services` | boolean | True when the hospital has an emergency department. | | `is_birthing_friendly` | boolean | True when the hospital meets the CMS Birthing-Friendly designation. NULL otherwise. | | `overall_rating` | smallint, stars | CMS overall hospital quality star rating, 1 (worst) to 5 (best). | | `mortality_measures_better` | smallint, measures | Mortality measures on which the hospital is better than the national rate. | | `mortality_measures_worse` | smallint, measures | Mortality measures on which the hospital is worse than the national rate. | | `safety_measures_better` | smallint, measures | Safety-of-care measures better than the national rate. | | `safety_measures_worse` | smallint, measures | Safety-of-care measures worse than the national rate. | | `readmission_measures_better` | smallint, measures | Readmission measures better than the national rate. | | `readmission_measures_worse` | smallint, measures | Readmission measures worse than the national rate. | | `hcahps_star` | smallint, stars | HCAHPS patient-survey summary star rating, 1 to 5. | | `hcahps_surveys` | integer, surveys | Completed patient surveys behind the HCAHPS figures. | | `hcahps_response_rate` | double precision, percent | Share of surveyed patients who responded. | | `recommend_pct` | double precision, percent | Patients who would definitely recommend the hospital. | | `rating_9_10_pct` | double precision, percent | Patients who rated the hospital 9 or 10 out of 10. | | `readmission_rate` | double precision, percent | Hospital-wide 30-day unplanned readmission rate, risk-standardized. Lower is better. | | `mortality_rate` | double precision, percent | Hospital-wide 30-day mortality rate, risk-standardized. Lower is better. | | `psi_90` | double precision, ratio | PSI 90 patient-safety and adverse-events composite. About 1 is average; lower is better. | | `clabsi_sir` | double precision, ratio | Central-line bloodstream infection standardized infection ratio. Below 1 is better than predicted. | | `cauti_sir` | double precision, ratio | Catheter-associated urinary tract infection standardized infection ratio. | | `mrsa_sir` | double precision, ratio | MRSA bloodstream infection standardized infection ratio. | | `cdiff_sir` | double precision, ratio | C. difficile infection standardized infection ratio. | | `ed_volume` | text | Emergency department volume band. `low` under 20,000 visits a year, `medium` 20,000 to 39,999, `high` 40,000 to 59,999, `very high` 60,000 or more. | | `ed_median_minutes` | double precision, minutes | Median minutes patients spend in the emergency department before being sent home (OP-18b). Lower is better. | | `left_without_being_seen_pct` | double precision, percent | Emergency patients who left without being seen (OP-22). | | `sepsis_care_pct` | double precision, percent | Patients who received appropriate care for severe sepsis and septic shock (SEP-1). | | `spending_ratio` | double precision, ratio | Medicare spending per beneficiary relative to the national median (MSPB). 1.0 is the median; lower is cheaper. | Joins: `hospitals` on `hospital_quality.ccn = hospitals.ccn`; `hospital_owners` on `hospital_quality.ccn = hospital_owners.ccn`; `hospital_measures` on `hospital_quality.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospital_quality.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospital_quality.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospital_quality.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospital_quality.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_quality.ccn = clinician_facilities.ccn`; `facilities` on `hospital_quality.ccn = facilities.hospital_ccn`. Know before you use it: - Care Compare release of November 2026. Each figure has its own measurement period (most are 2024 or 2025; readmission and mortality cover July 2024 to June 2025); hospital_measures gives the period per measure. - NULL means CMS published no value: too few cases, not reported, or not applicable to that hospital type. It never means zero. About 40% of hospitals have no overall star rating, mostly critical access, psychiatric and federal hospitals. - Includes about 170 Veterans Affairs and Department of Defense hospitals (CCN ending in F) that are not in hospitals. - is_birthing_friendly is true or NULL: CMS lists only the hospitals that meet the designation. - Readmission and mortality are the hospital-wide hybrid measures, risk-standardized by CMS. Infection ratios compare observed to predicted cases: below 1 is better than predicted. ### `hospital_measures` Every scored CMS Care Compare measure per hospital in one long table: mortality, patient safety, readmissions, infections, timely and effective care, patient survey and spending. One row is one hospital and one measure that CMS published a score for. Key: `(ccn, measure_id)`. How it is read: - Always filter to one measure_id. Common ones: 'Hybrid_HWR' hospital-wide readmission rate; 'Hybrid_HWM' hospital-wide mortality; 'MORT_30_AMI', 'MORT_30_HF', 'MORT_30_PN', 'MORT_30_STK', 'MORT_30_COPD', 'MORT_30_CABG' 30-day death rates; 'READM_30_HF', 'READM_30_PN', 'READM_30_HIP_KNEE', 'READM_30_AMI', 'READM_30_COPD', 'READM_30_CABG' readmission rates; 'COMP_HIP_KNEE' hip/knee complications; 'PSI_90' safety composite; 'HAI_1_SIR' CLABSI, 'HAI_2_SIR' CAUTI, 'HAI_3_SIR' colon surgical-site, 'HAI_5_SIR' MRSA, 'HAI_6_SIR' C. diff; 'OP_18b' ED minutes; 'OP_22' left without being seen; 'SEP_1' sepsis care; 'MSPB-1' spending ratio; 'H_STAR_RATING' survey summary stars; 'H_RECMND_DY' would recommend; 'H_HSP_RATING_9_10' rated 9-10. - The headline figures are already one row per hospital in hospital_quality. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `measure_id` | text | CMS measure identifier, for example READM_30_HF or HAI_1_SIR. | | `measure_name` | text | CMS name of the measure. | | `domain` | text | Quality area the measure belongs to. `mortality` death rates, `safety` complications and patient-safety indicators, `readmission` readmissions and unplanned return visits, `infection` healthcare-associated infection ratios, `timely_care` timely and effective care, `patient_experience` HCAHPS patient survey, `spending` Medicare spending per beneficiary. | | `score` | double precision | The hospital's score, in the unit the measure defines (rate, percent, minutes, ratio or stars). | | `compared_to_national` | text | CMS's comparison with the national rate or benchmark, where published. `better` statistically better, `no different` no different, `worse` statistically worse. | | `denominator` | integer, cases | Cases, patients or completed surveys the score is based on. NULL where CMS publishes none. | | `period_start` | date | First day of the measurement period. | | `period_end` | date | Last day of the measurement period. | Indexed on `(measure_id, score)`. Joins: `hospitals` on `hospital_measures.ccn = hospitals.ccn`; `hospital_owners` on `hospital_measures.ccn = hospital_owners.ccn`; `hospital_quality` on `hospital_measures.ccn = hospital_quality.ccn`; `hospital_ehr` on `hospital_measures.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospital_measures.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospital_measures.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospital_measures.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_measures.ccn = clinician_facilities.ccn`; `facilities` on `hospital_measures.ccn = facilities.hospital_ccn`. Know before you use it: - Care Compare release of November 2026. Measurement periods differ by measure; use period_start and period_end. - A hospital with no row for a measure was not scored on it (too few cases, not reported or not applicable). Missing is not zero, so average only over the rows present. - Scores are not on one scale: rates, percentages, minutes, ratios and star ratings share the score column. Never compare or average scores across different measure_id values. - From the infection file only the standardized infection ratio (HAI_n_SIR) is kept, and from the patient survey only star ratings and top-box percentages. - compared_to_national is published only for some measures; CMS left it blank for the mortality measures in this release. ### `hospital_ehr` The electronic health record (EHR) system each hospital runs: vendor, product and whether the vendor changed since the year before. One row is one hospital, from its latest Medicare Promoting Interoperability attestation that names certified products. Key: `ccn`. How it is read: - Filter on vendor, a short label: 'Epic', 'Oracle Health (Cerner)', 'MEDITECH', 'TruBridge (CPSI)', 'Altera (Allscripts)', 'MEDHOST', 'athenahealth'. Cerner is 'Oracle Health (Cerner)'. - Join to hospitals on ccn. Every attested product is in hospital_ehr_products. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `year` | smallint | Promoting Interoperability program year of the attestation. | | `vendor` | text | Short name of the primary EHR vendor, for example Epic or Oracle Health (Cerner). | | `developer` | text | Developer name exactly as the Certified Health IT Product List has it. | | `product` | text | Core inpatient EHR product attested, for example EpicCare Inpatient Base. NULL when basis is most_products. | | `basis` | text | How the primary vendor was chosen. `core_product` developer of the one core inpatient EHR product, `multiple_core_products` two core EHR developers attested, the larger bundle chosen; ambiguous, `most_products` no core product found, developer with the most products chosen; weak. | | `developer_count` | smallint, developers | Distinct developers on the hospital's attestation. | | `product_count` | smallint, products | Distinct certified products on the hospital's attestation. | | `other_vendors` | text | Other vendors on the same attestation, separated by '; ', largest bundle first. | | `previous_vendor` | text | Primary vendor the year before. NULL when that year has no decodable attestation. | | `vendor_changed` | boolean | True when the primary vendor differs from the year before. NULL when not comparable. | | `cehrt_id` | text | CMS EHR Certification ID the hospital attested with. | | `source` | text | Where the row comes from, including the program year. | Indexed on `vendor`. Joins: `hospitals` on `hospital_ehr.ccn = hospitals.ccn`; `hospital_owners` on `hospital_ehr.ccn = hospital_owners.ccn`; `hospital_quality` on `hospital_ehr.ccn = hospital_quality.ccn`; `hospital_measures` on `hospital_ehr.ccn = hospital_measures.ccn`; `hospital_ehr_products` on `hospital_ehr.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospital_ehr.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospital_ehr.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_ehr.ccn = clinician_facilities.ccn`; `facilities` on `hospital_ehr.ccn = facilities.hospital_ccn`. Know before you use it: - Program year 2024 for most hospitals (2023 where 2024 is missing): what the hospital attested to CMS, decoded by ONC against the Certified Health IT Product List. Published January 2026, so a go-live since 2024 is not reflected. - Covers hospitals in the Medicare Promoting Interoperability program that filed a certification ID: about 4,200, which is 85% of acute care hospitals. Psychiatric, rehabilitation, long-term, children's and federal hospitals are mostly absent. No row means unknown, not 'no EHR'. - A hospital attests to a bundle of products from several developers. vendor is the developer of the core inpatient EHR product (basis = 'core_product', 97% of rows). About 50 hospitals attest core products from two developers, usually mid-migration (basis = 'multiple_core_products'; the second is in other_vendors), and about 50 have no recognisable core product (basis = 'most_products'): treat both as uncertain. - vendor_changed compares program years 2023 and 2024 and is NULL unless basis is 'core_product' in both. A hospital that attests under a new parent system's ID can show as changed. ### `hospital_ehr_products` Every certified health IT product each hospital attested to for Medicare Promoting Interoperability: the EHR plus portals, labs, e-prescribing, messaging, surveillance and quality-reporting tools. One row is one hospital, one program year, one developer and one product. Key: `(ccn, year, developer, product)`. How it is read: - Filter year = 2024 for the current picture. vendor uses the same short labels as hospital_ehr.vendor; is_core_ehr marks the inpatient EHR itself. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `year` | smallint | Promoting Interoperability program year. | | `vendor` | text | Short vendor name, for example Epic or Oracle Health (Cerner); the developer name when there is no short form. | | `developer` | text | Developer name as the Certified Health IT Product List has it. | | `product` | text | Certified product name. | | `is_core_ehr` | boolean | True when the product is an inpatient EHR system rather than an add-on module or tool. | | `listings` | integer, listings | Certified versions of the product on the hospital's attestation. | | `cehrt_id` | text | CMS EHR Certification ID the hospital attested with. | Indexed on `(vendor, year)`. Joins: `hospitals` on `hospital_ehr_products.ccn = hospitals.ccn`; `hospital_owners` on `hospital_ehr_products.ccn = hospital_owners.ccn`; `hospital_quality` on `hospital_ehr_products.ccn = hospital_quality.ccn`; `hospital_measures` on `hospital_ehr_products.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospital_ehr_products.ccn = hospital_ehr.ccn`; `hospital_systems` on `hospital_ehr_products.ccn = hospital_systems.ccn`; `hospital_drgs` on `hospital_ehr_products.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_ehr_products.ccn = clinician_facilities.ccn`; `facilities` on `hospital_ehr_products.ccn = facilities.hospital_ccn`. Know before you use it: - Program years 2023 and 2024, published by ONC in January 2026 from CMS attestations and the Certified Health IT Product List. - Lists certified products only. Software that is not ONC-certified (most revenue-cycle, ERP, imaging and analytics tools) never appears, so this is not a full technology stack. - A product is listed because the hospital's certification ID includes it, which is strong but not perfect evidence of daily use. - Two years per hospital: filter on year, or counts double. ### `hospital_systems` The health system (chain or integrated delivery network) each hospital belongs to, from the home office it names on its Medicare cost report. One row is one hospital that reports being part of a chain organization. Key: `ccn`. How it is read: - Search with system_name ILIKE '%hca%'. Names are UPPERCASE. Group by system_id, not by name. - Join to hospitals on ccn. A hospital with no row here is independent or unknown: use LEFT JOIN. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `system_id` | text | Identifier of the health system: its CMS home office number, or 'N:' plus a cleaned name. | | `system_name` | text | Name of the health system, the most common spelling its hospitals report. UPPERCASE. | | `system_hospitals` | integer, hospitals | Hospitals resolved to the same system in this table. | | `reported_name` | text | Home office name exactly as this hospital reported it. UPPERCASE. | | `reported_number` | text | Home office number as this hospital reported it, before resolution. | | `home_office_city` | text | City of the system's home office. UPPERCASE. | | `home_office_state` | char(2) | Two-letter USPS state code of the system's home office. | | `fiscal_year_end` | date | Last day of the cost-report fiscal year the affiliation was read from. | Indexed on `system_id`. Joins: `hospitals` on `hospital_systems.ccn = hospitals.ccn`; `hospital_owners` on `hospital_systems.ccn = hospital_owners.ccn`; `hospital_quality` on `hospital_systems.ccn = hospital_quality.ccn`; `hospital_measures` on `hospital_systems.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospital_systems.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospital_systems.ccn = hospital_ehr_products.ccn`; `hospital_drgs` on `hospital_systems.ccn = hospital_drgs.ccn`; `clinician_facilities` on `hospital_systems.ccn = clinician_facilities.ccn`; `facilities` on `hospital_systems.ccn = facilities.hospital_ccn`. Know before you use it: - Self-reported on Medicare cost reports for fiscal year 2024 (worksheet S-2, lines 140 to 143). Hospitals that report no chain, or filed no 2024 cost report, have no row: no row means independent or unknown. - Names are typed by each hospital, so system_id and system_name are resolved by us from the home office number and name spellings. Most systems resolve cleanly; a few are split (a regional division reporting its own home office, such as Dignity Health within CommonSpirit) and system_hospitals undercounts those. - The home office is the legal or operating parent as reported for Medicare, which can differ from the consumer brand. Physician groups, clinics and other non-hospital sites of a system are not here. - system_id is a CMS home office number where one was reported, otherwise 'N:' followed by the cleaned name. Treat it as stable only within one load. ### `hospital_drgs` Medicare inpatient volume and payment per hospital and diagnosis-related group (MS-DRG): which service lines a hospital actually runs. One row is one hospital and one MS-DRG, per year. Key: `(ccn, drg_code)`. How it is read: - drg_code is three characters with leading zeros ('470', '003'). Examples: '470' major hip and knee joint replacement without MCC, '871' sepsis with MCC, '291' heart failure with MCC, '246' and '247' coronary stent, '460' spinal fusion, '266' and '267' transcatheter valve. Search drg_description ILIKE for others; descriptions are UPPERCASE. - Join to hospitals on ccn. | Column | Type | Meaning | |---|---|---| | `ccn` | char(6) | CMS Certification Number of the hospital. Joins to hospitals.ccn. | | `year` | smallint | Calendar year the figures cover. | | `drg_code` | char(3) | MS-DRG code, three characters with leading zeros. | | `drg_description` | text | MS-DRG description. UPPERCASE. | | `discharges` | integer, discharges | Medicare fee-for-service discharges in the DRG. Always 11 or more. | | `avg_covered_charges` | double precision, USD | Average charges the hospital billed per discharge. | | `avg_total_payment` | double precision, USD | Average total payment per discharge, including patient and third-party shares. | | `avg_medicare_payment` | double precision, USD | Average amount Medicare itself paid per discharge. | Indexed on `(drg_code, discharges)`. Joins: `hospitals` on `hospital_drgs.ccn = hospitals.ccn`; `hospital_owners` on `hospital_drgs.ccn = hospital_owners.ccn`; `hospital_quality` on `hospital_drgs.ccn = hospital_quality.ccn`; `hospital_measures` on `hospital_drgs.ccn = hospital_measures.ccn`; `hospital_ehr` on `hospital_drgs.ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `hospital_drgs.ccn = hospital_ehr_products.ccn`; `hospital_systems` on `hospital_drgs.ccn = hospital_systems.ccn`; `clinician_facilities` on `hospital_drgs.ccn = clinician_facilities.ccn`; `facilities` on `hospital_drgs.ccn = facilities.hospital_ccn`. Know before you use it: - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. - CMS leaves out any hospital and DRG with fewer than 11 discharges, so small programs are missing and a hospital's rows do not add up to its total Medicare discharges. - Calendar year 2024. Covers about 2,900 hospitals paid under the inpatient prospective payment system; critical access hospitals and Maryland hospitals are not included. - Payments are averages per discharge. Multiply by discharges for totals. Charges are list prices, far above what is paid. ## Groups ### `groups` Group practices, built from the list of clinicians who reassign their Medicare billing to a group. One row is one group practice, identified by its PECOS Associate Control ID. Key: `group_pac_id`. | Column | Type | Meaning | |---|---|---| | `group_pac_id` | bigint | PECOS Associate Control ID of the group: its enrollment identifier in Medicare. | | `name` | text | Legal business name of the group. UPPERCASE. A solo practice can carry its owner's name. | | `state` | char(2) | Two-letter USPS state code of the group. | | `member_count` | integer, clinicians | Distinct clinicians who reassign their Medicare benefits to the group. | | `top_specialty` | text | Most common specialty among the group's clinicians. | Indexed on `(state, member_count)`, `name` for substring search. Joins: `group_members` on `groups.group_pac_id = group_members.group_pac_id`; `aco_participants` on `groups.group_pac_id = aco_participants.group_pac_id`. Know before you use it: - member_count counts clinicians who reassign Medicare benefits to the group, not everyone who works there. - A late-2026 snapshot. One health system often enrolls as several groups. - Names are UPPERCASE legal business names. ### `group_members` Which clinician belongs to which group practice. One row is one clinician in one group practice. Key: `(group_pac_id, npi)`. How it is read: - Indexed on npi, so finding the groups a clinician is in is fast. Join to groups on group_pac_id and to providers on npi. | Column | Type | Meaning | |---|---|---| | `group_pac_id` | bigint | PECOS Associate Control ID of the group. Joins to groups.group_pac_id. | | `npi` | bigint | National Provider Identifier of the clinician. | | `specialty` | text | The clinician's specialty as listed on the reassignment record. | Indexed on `npi`. Joins: `groups` on `group_members.group_pac_id = groups.group_pac_id`; `aco_participants` on `group_members.group_pac_id = aco_participants.group_pac_id`; `medicare_provider` on `group_members.npi = medicare_provider.npi`; `medicare_service` on `group_members.npi = medicare_service.npi`; `providers` on `group_members.npi = providers.npi`; `partd_provider` on `group_members.npi = partd_provider.npi`; `partd_drug` on `group_members.npi = partd_drug.npi`; `hospitals` on `group_members.npi = hospitals.npi`; `open_payments` on `group_members.npi = open_payments.npi`; `clinician_facilities` on `group_members.npi = clinician_facilities.npi`; `facilities` on `group_members.npi = facilities.npi`; `trial_investigators` on `group_members.npi = trial_investigators.npi`; `nih_grants` on `group_members.npi = nih_grants.npi`. Know before you use it: - A clinician can belong to several groups. - A late-2026 snapshot of Medicare benefit reassignments, not an employment record. ## Industry payments ### `open_payments` Payments from drug and device companies to clinicians (Open Payments), totalled per clinician and company. One row is one clinician and one paying company, per year. Key: `(npi, year, company)`. How it is read: - Company names are exact and mixed in case as reported, for example 'PFIZER INC.' and 'Lilly USA, LLC'. Match with ILIKE. | Column | Type | Meaning | |---|---|---| | `npi` | bigint | National Provider Identifier of the clinician who received the payments. | | `year` | smallint | Program year the payments were made in. | | `company` | text | Name of the manufacturer or group purchasing organization that made the payments, as reported. | | `total_amount` | double precision, USD | Total value of the company's payments to the clinician in the year. | | `payment_count` | integer, payments | Number of payments included in the total. | | `top_nature` | text | Most common nature of payment across the records, for example Food and Beverage or Consulting Fee. | Indexed on `(company, total_amount)`. Joins: `medicare_provider` on `open_payments.npi = medicare_provider.npi`; `medicare_service` on `open_payments.npi = medicare_service.npi`; `providers` on `open_payments.npi = providers.npi`; `partd_provider` on `open_payments.npi = partd_provider.npi`; `partd_drug` on `open_payments.npi = partd_drug.npi`; `hospitals` on `open_payments.npi = hospitals.npi`; `group_members` on `open_payments.npi = group_members.npi`; `clinician_facilities` on `open_payments.npi = clinician_facilities.npi`; `facilities` on `open_payments.npi = facilities.npi`; `trial_investigators` on `open_payments.npi = trial_investigators.npi`; `nih_grants` on `open_payments.npi = nih_grants.npi`. Know before you use it: - General payments only: meals, travel, consulting, speaking and the like. Research payments and ownership interests are not included. - Aggregated: one row holds the year's total for a clinician and company, not individual payments. - Only payments to recipients with an NPI. Payments to teaching hospitals are not included. - Program year 2024, as reported by the companies. ## Rollups ### `rollup_specialty_state` Medicare Part B activity totalled by specialty and state. Built from medicare_provider. One row is one Medicare specialty in one state, per year. Key: `(specialty, state, year)`. How it is read: - PREFER for specialty and state totals: small and answers in milliseconds. | Column | Type | Meaning | |---|---|---| | `specialty` | text | Medicare specialty, same values as medicare_provider.provider_type. | | `state` | char(2) | Two-letter USPS state code of the providers. | | `year` | smallint | Calendar year the figures cover. | | `providers` | integer, providers | Clinicians and organizations of this specialty in the state that billed Medicare. | | `benes` | bigint, patients | Sum of each provider's patient count. Patients seen by more than one provider are counted more than once. | | `services` | double precision, services | Total services provided. | | `payment` | double precision, USD | Total amount Medicare paid. | Know before you use it: - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. - benes adds up each clinician's patient count, so a patient seen by two clinicians is counted twice. Withheld (NULL) counts add nothing. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. ### `rollup_hcpcs_state` Procedure volume totalled by HCPCS code and state. Built from medicare_service. One row is one HCPCS procedure code in one state, per year. Key: `(hcpcs_code, state, year)`. How it is read: - PREFER for "by state" procedure questions: small and answers in milliseconds. | Column | Type | Meaning | |---|---|---| | `hcpcs_code` | text | HCPCS procedure code. Described in hcpcs. | | `state` | char(2) | Two-letter USPS state code of the providers. | | `year` | smallint | Calendar year the figures cover. | | `providers` | integer, providers | Distinct clinicians and organizations in the state that billed the code. | | `benes` | bigint, patients | Sum of each provider's patient count for the code. Patients seen by more than one provider are counted more than once. | | `services` | double precision, services | Total times the service was provided. | | `payment` | double precision, USD | Estimated Medicare payment: the sum of avg_payment * tot_srvcs over the underlying rows. | Joins: `medicare_service` on `rollup_hcpcs_state.hcpcs_code = medicare_service.hcpcs_code`; `hcpcs` on `rollup_hcpcs_state.hcpcs_code = hcpcs.code`; `drug_spending` on `rollup_hcpcs_state.hcpcs_code = drug_spending.hcpcs_code`. Know before you use it: - Medicare fee-for-service only. Commercial insurance, Medicare Advantage, Medicaid and self-pay are not counted, so volumes are a floor, not a total. - Built only from clinicians above the 11-patient threshold for the code, so totals undercount. benes counts a patient once per clinician. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. ## Facilities ### `facilities` Every non-hospital care facility in one table: nursing homes, home health agencies, hospices, dialysis facilities, surgery centers, rehab and long-term care hospitals, rural health clinics, FQHCs, HRSA health center sites and the smaller certified types. One row is one facility that is certified by Medicare or Medicaid today, or one active HRSA health center site. Key: `facility_id`. How it is read: - ALWAYS filter by facility_type. Names, cities and chain names are UPPERCASE; match with ILIKE. - Most measures are NULL for many rows (unrated, not published). Never COALESCE a rating, bed count or payment to 0: averages and sums skip NULL on their own. Sort with DESC NULLS LAST. - For totals over facilities with a private equity or REIT owner, filter has_private_equity_owner or has_reit_owner here. Do not join facility_owners and then SUM a facilities column: the join repeats a facility once per owner row. - Detail tables join on facility_id: nursing_homes, home_health_agencies, hospices, dialysis_facilities, surgery_centers, health_center_sites. Owners: facility_owners.facility_id. - Examples of chain_name: 'THE ENSIGN GROUP', 'GENESIS HEALTHCARE' (nursing homes); 'DAVITA', 'FRESENIUS MEDICAL CARE' (dialysis). For health center sites it is the parent health center. - When listing facilities select facility_id; it is the id column. Rank nursing homes by beds, hospices and home health by medicare_payment or medicare_patients, dialysis by stations, surgery centers by operating_rooms. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | Facility identifier: the CMS Certification Number, or the HRSA site number for health center sites. | | `facility_type` | text | Kind of facility. `nursing_home` skilled nursing facility or nursing facility, `home_health_agency` home health agency, `hospice` hospice, `dialysis_facility` dialysis (ESRD) facility, `ambulatory_surgery_center` ambulatory surgery center, `inpatient_rehab_facility` inpatient rehabilitation hospital or hospital unit, `long_term_care_hospital` long-term care hospital, `rural_health_clinic` rural health clinic, `fqhc` federally qualified health center certified by CMS, `health_center_site` HRSA health center or look-alike service site, `intermediate_care_facility_iid` intermediate care facility for intellectual disabilities, `outpatient_therapy_provider` outpatient physical therapy or speech pathology provider, `portable_xray_supplier` portable X-ray supplier, `psychiatric_residential_treatment_facility` psychiatric residential treatment facility, `outpatient_rehab_facility` comprehensive outpatient rehabilitation facility, `community_mental_health_center` community mental health center, `organ_procurement_organization` organ procurement organization. | | `hospital_ccn` | char(6) | For rehab facilities and long-term care hospitals: the hospitals.ccn of the hospital itself or, for a unit, its parent. | | `fqhc_facility_id` | text | For a health center site: facility_id of the CMS-certified fqhc row for the same clinic, when HRSA publishes its Medicare number. Several sites can share one FQHC's number. | | `npi` | bigint | National Provider Identifier from the Medicare enrollment, quality listing or HRSA record. NULL when none is published. One organization can enroll several facilities under one NPI, so it is not unique here. | | `name` | text | Facility name as listed. UPPERCASE. | | `legal_name` | text | Legal business name on the Medicare enrollment. UPPERCASE. | | `address` | text | Street address. UPPERCASE. | | `city` | text | City. UPPERCASE. | | `state` | char(2) | Two-letter USPS state code of the facility. | | `zip5` | char(5) | Five-digit ZIP code. | | `county_fips` | char(5) | Five-digit county FIPS code. | | `phone` | text | Telephone number, ten digits. | | `ownership_type` | text | Who runs the facility, normalized across sources. `for_profit` for-profit, `non_profit` non-profit, `government` federal, state, local or tribal government, `other` published as other. A combined government and non-profit operator counts as government. Falls back to the for-profit flag on the Medicare enrollment when the listing has no ownership. | | `ownership_detail` | text | Ownership or control type in the publisher's own words. | | `chain_name` | text | Chain or parent organization where published (nursing homes, dialysis, health center sites). UPPERCASE. | | `beds` | integer, beds | Certified or total beds, for facility types that have beds. | | `stations` | integer, stations | Dialysis stations. | | `operating_rooms` | integer, rooms | Operating rooms in a surgery center. | | `star_rating` | double precision, stars | CMS star rating, 1 to 5; its meaning depends on facility_type. | | `avg_daily_census` | double precision, patients per day | Average patients per day: nursing home residents or hospice patients. | | `medicare_patients` | integer, patients | Distinct Medicare fee-for-service patients in 2024. | | `medicare_service_days` | integer, days | Medicare-covered days of care in 2024 (post-acute types only). | | `medicare_payment` | double precision, USD | Medicare fee-for-service payment in 2024. | | `certified_date` | date | Date first certified for Medicare or Medicaid; for health center sites, date added to the HRSA grant. | | `ownership_change_date` | date | Date of the most recent change of ownership on record. NULL when none. | | `rural_urban` | char(1) | Rural or urban location. `R` rural, `U` urban. | | `latitude` | double precision, degrees | Latitude (nursing homes and health center sites only). | | `longitude` | double precision, degrees | Longitude (nursing homes and health center sites only). | | `owner_count` | integer, records | Owner and managing-party records disclosed (rows in facility_owners). | | `has_private_equity_owner` | boolean | True when any disclosed owner is flagged as a private equity company. | | `has_reit_owner` | boolean | True when any disclosed owner is flagged as a real estate investment trust. | | `top_owner` | text | Party with the largest disclosed ownership share. Can be a person. | | `source` | text | Where the listing came from. `cms_care_compare` a CMS Care Compare listing, `cms_pos` Provider of Services file only, `hrsa` HRSA health center sites. | Indexed on `(facility_type, state, city)`, `name` for substring search, `chain_name` for substring search, `npi`, `zip5`. Joins: `facility_owners` on `facilities.facility_id = facility_owners.facility_id`; `nursing_homes` on `facilities.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `facilities.facility_id = home_health_agencies.facility_id`; `hospices` on `facilities.facility_id = hospices.facility_id`; `dialysis_facilities` on `facilities.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `facilities.facility_id = surgery_centers.facility_id`; `health_center_sites` on `facilities.facility_id = health_center_sites.facility_id`; `hospitals` on `facilities.hospital_ccn = hospitals.ccn`; `hospital_owners` on `facilities.hospital_ccn = hospital_owners.ccn`; `hospital_quality` on `facilities.hospital_ccn = hospital_quality.ccn`; `hospital_measures` on `facilities.hospital_ccn = hospital_measures.ccn`; `hospital_ehr` on `facilities.hospital_ccn = hospital_ehr.ccn`; `hospital_ehr_products` on `facilities.hospital_ccn = hospital_ehr_products.ccn`; `hospital_systems` on `facilities.hospital_ccn = hospital_systems.ccn`; `hospital_drgs` on `facilities.hospital_ccn = hospital_drgs.ccn`; `clinician_facilities` on `facilities.hospital_ccn = clinician_facilities.ccn`; `medicare_provider` on `facilities.npi = medicare_provider.npi`; `medicare_service` on `facilities.npi = medicare_service.npi`; `providers` on `facilities.npi = providers.npi`; `partd_provider` on `facilities.npi = partd_provider.npi`; `partd_drug` on `facilities.npi = partd_drug.npi`; `hospitals` on `facilities.npi = hospitals.npi`; `group_members` on `facilities.npi = group_members.npi`; `open_payments` on `facilities.npi = open_payments.npi`; `clinician_facilities` on `facilities.npi = clinician_facilities.npi`; `trial_investigators` on `facilities.npi = trial_investigators.npi`; `nih_grants` on `facilities.npi = nih_grants.npi`; `ma_enrollment_county` on `facilities.county_fips = ma_enrollment_county.county_fips`; `medicare_enrollment_county` on `facilities.county_fips = medicare_enrollment_county.county_fips`. Know before you use it: - Acute-care hospitals are not here; they are in hospitals. Inpatient rehab facilities and long-term care hospitals appear in both: hospital_ccn points at their hospitals row. - facility_id is the CMS Certification Number (six characters; ten for surgery centers and portable X-ray suppliers), except for facility_type 'health_center_site', where it is HRSA's BPHC assigned site number (for example BPS-H80-015078). HRSA sites and CMS-certified FQHCs are two registries of largely the same clinics: a health_center_site row carries the facility_id of its fqhc row in fqhc_facility_id when HRSA publishes it (about 40%), so count one type or the other, not both. - A facility Care Compare still lists but the Provider of Services file marks terminated is left out. - star_rating means something different per type: nursing home overall rating, home health quality-of-patient-care rating (half stars), dialysis five-star rating, hospice family caregiver survey rating. Other types have none. Compare within one type only. - medicare_patients, medicare_service_days and medicare_payment are Medicare fee-for-service only, 2024: Part A stays for nursing homes (short rehab stays, not long-term residents), episodes for home health and hospice, Part B facility claims billed under the NPI for surgery centers. NULL means no published figure, not zero. An inpatient rehab unit carries the figures of its whole unit, reported under the parent hospital. - beds is certified beds (nursing homes, intermediate care facilities) or total beds (long-term care hospitals, psychiatric residential treatment). A few counts in the source are typing errors and are NULL. - Owner fields come from ownership disclosures filed with CMS (facility_owners) and exist only for nursing homes, home health agencies, hospices, FQHCs and rural health clinics. NULL elsewhere. - Certification data is the third quarter of 2026; listings and ratings are September to November 2026; HRSA sites are December 2026. ### `facility_owners` Owners and managing parties of nursing homes, home health agencies, hospices, FQHCs and rural health clinics: companies and people, their role, share and investor flags. One row is one owner or managing party in one role at one facility. Key: `id`. How it is read: - Join to facilities on facility_id. owner_associate_id identifies the same owner across facilities: group by it to size a portfolio. - A facility has many owner rows, and one owner can hold several roles at it. Count facilities with count(DISTINCT facility_id). To add up a facilities column per owner, first reduce to distinct (owner_associate_id, owner_name, facility_id), then join and sum. Several funds of one firm own the same facilities, so do not add their totals together. - Roles include '5% OR GREATER DIRECT OWNERSHIP INTEREST', '5% OR GREATER INDIRECT OWNERSHIP INTEREST', 'OPERATIONAL/MANAGERIAL CONTROL', 'CORPORATE OFFICER'. | Column | Type | Meaning | |---|---|---| | `id` | bigint | Row number assigned when the table is loaded. Not stable between loads. | | `facility_id` | text | Facility the party owns or manages. Joins to facilities.facility_id. | | `facility_type` | text | Type of that facility, same values as facilities.facility_type. | | `owner_name` | text | Organization name, or a person's first and last name. UPPERCASE. | | `owner_type` | char(1) | Whether the party is a person or an organization. `I` individual, `O` organization. | | `owner_associate_id` | text | CMS enrollment-system identifier of the owner, the same wherever that owner appears. | | `role` | text | The party's role, for example 5% OR GREATER DIRECT OWNERSHIP INTEREST or CORPORATE OFFICER. | | `title` | text | Job title as the facility entered it. Free text. | | `association_date` | date | Date the party took up this role. | | `pct_ownership` | double precision, percent | Ownership share, 0 to 100. Blank (NULL) or 0 for officers and directors. | | `is_private_equity` | boolean | True when an organization owner is flagged as a private equity company. NULL for individuals. | | `is_reit` | boolean | True when flagged as a real estate investment trust. NULL for individuals. | | `is_holding_company` | boolean | True when flagged as a holding company. NULL for individuals. | | `is_management_company` | boolean | True when flagged as a management services company. NULL for individuals. | | `is_chain_home_office` | boolean | True when flagged as a chain home office. NULL for individuals. | | `is_for_profit` | boolean | True when flagged as a for-profit entity. NULL for individuals. | | `source` | text | File the row came from. `pecos` CMS All Owners file, `care_compare` Care Compare nursing home ownership. | Indexed on `facility_id`, `owner_associate_id`, `owner_name` for substring search. Joins: `facilities` on `facility_owners.facility_id = facilities.facility_id`; `nursing_homes` on `facility_owners.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `facility_owners.facility_id = home_health_agencies.facility_id`; `hospices` on `facility_owners.facility_id = hospices.facility_id`; `dialysis_facilities` on `facility_owners.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `facility_owners.facility_id = surgery_centers.facility_id`; `health_center_sites` on `facility_owners.facility_id = health_center_sites.facility_id`. Know before you use it: - Self-disclosed to CMS. The private-equity, REIT, holding-company and management-company flags are the filer's own answers, and CMS has said the reporting is incomplete. - Most rows are directors, officers and managing employees with a 0% or blank share. Filter on pct_ownership or role to find equity owners. - About 4% of rows have no owner name in the source and read 'UNKNOWN'. - 166 Medicaid-only nursing homes have no Medicare enrollment; their rows come from the Care Compare ownership file (source 'care_compare'), which has no investor flags and no owner_associate_id. - Owners of an enrollment whose CCN is not a certified facility of that type are left out. Dialysis facilities, surgery centers and the other types have no owner data. - id is a row number assigned at load time. It changes when the data is reloaded, so do not store it. ### `nursing_homes` Nursing home detail: the five-star rating components, occupancy, nurse staffing and turnover, inspection results and penalties. One row is one nursing home listed on Care Compare. Key: `facility_id`. How it is read: - Join to facilities on facility_id for name, address, chain_name, state and Medicare volume. - Ratings are NULL when CMS has not rated a home. Average them as they are; never COALESCE to 0. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | CMS Certification Number. Joins to facilities.facility_id. | | `program_participation` | text | Programs the home is certified for: 'Medicare and Medicaid', 'Medicare' or 'Medicaid'. | | `in_hospital` | boolean | True when the nursing home is inside a hospital. | | `is_ccrc` | boolean | True when part of a continuing care retirement community. | | `special_focus_status` | text | Special Focus Facility program status for persistently poor quality. `SFF` in the program, `SFF Candidate` candidate. | | `abuse_icon` | boolean | True when CMS flags the home for an abuse citation. | | `changed_ownership_12mo` | boolean | True when ownership changed in the last 12 months. | | `chain_id` | text | CMS identifier of the chain. NULL for independent homes. | | `chain_facilities` | integer, facilities | Number of nursing homes in the chain. | | `chain_avg_overall_rating` | double precision, stars | Average overall star rating across the chain. | | `certified_beds` | integer, beds | Federally certified beds. | | `avg_residents_per_day` | double precision, residents | Average residents per day. | | `occupancy_pct` | double precision, percent | Residents per day as a share of certified beds. | | `overall_rating` | smallint, stars | Overall five-star rating, 1 to 5. | | `health_inspection_rating` | smallint, stars | Health inspection star rating, 1 to 5. | | `staffing_rating` | smallint, stars | Staffing star rating, 1 to 5. | | `quality_rating` | smallint, stars | Quality measure star rating, 1 to 5. | | `long_stay_quality_rating` | smallint, stars | Quality star rating for long-stay residents. | | `short_stay_quality_rating` | smallint, stars | Quality star rating for short-stay (rehab) patients. | | `rn_hours_per_resident_day` | double precision, hours | Registered nurse hours per resident per day. | | `lpn_hours_per_resident_day` | double precision, hours | Licensed practical nurse hours per resident per day. | | `aide_hours_per_resident_day` | double precision, hours | Nurse aide hours per resident per day. | | `total_nurse_hours_per_resident_day` | double precision, hours | Total nurse staffing hours per resident per day. | | `weekend_nurse_hours_per_resident_day` | double precision, hours | Total nurse staffing hours per resident per day on weekends. | | `pt_hours_per_resident_day` | double precision, hours | Physical therapist hours per resident per day. | | `nurse_turnover_pct` | double precision, percent | Share of nursing staff who left within a year. | | `rn_turnover_pct` | double precision, percent | Share of registered nurses who left within a year. | | `administrator_departures` | integer, people | Administrators who left within a year. | | `last_inspection_date` | date | Date of the most recent standard health inspection. | | `health_deficiencies` | integer, citations | Health deficiencies cited in the most recent inspection cycle. | | `infection_control_citations` | integer, citations | Citations from infection control inspections. | | `fines` | integer, fines | Fines in the last three years. | | `fines_amount` | double precision, USD | Total amount of those fines. | | `payment_denials` | integer, denials | Medicare payment denials in the last three years. | | `penalties` | integer, penalties | Fines plus payment denials. | Joins: `facilities` on `nursing_homes.facility_id = facilities.facility_id`; `facility_owners` on `nursing_homes.facility_id = facility_owners.facility_id`; `home_health_agencies` on `nursing_homes.facility_id = home_health_agencies.facility_id`; `hospices` on `nursing_homes.facility_id = hospices.facility_id`; `dialysis_facilities` on `nursing_homes.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `nursing_homes.facility_id = surgery_centers.facility_id`; `health_center_sites` on `nursing_homes.facility_id = health_center_sites.facility_id`. Know before you use it: - Care Compare, November 2026. Staffing comes from payroll data for one quarter; turnover covers a year; fines and penalties cover the last three years. - A rating is NULL when CMS footnotes it (too new, or data not available). 16 certified nursing homes in facilities are not on Care Compare and have no row here. - occupancy_pct is residents per day over certified beds. It is NULL for 48 homes whose residents exceed beds by more than 10%, because the bed count is stale. ### `home_health_agencies` Home health agency detail: services offered, the quality star rating and outcome measures. One row is one home health agency listed on Care Compare. Key: `facility_id`. How it is read: - Join to facilities on facility_id for name, address, ownership and Medicare volume. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | CMS Certification Number. Joins to facilities.facility_id. | | `offers_nursing` | boolean | True when the agency offers nursing care. | | `offers_physical_therapy` | boolean | True when it offers physical therapy. | | `offers_occupational_therapy` | boolean | True when it offers occupational therapy. | | `offers_speech_pathology` | boolean | True when it offers speech pathology. | | `offers_medical_social` | boolean | True when it offers medical social services. | | `offers_home_health_aide` | boolean | True when it offers home health aide services. | | `quality_star_rating` | double precision, stars | Quality of patient care star rating, 1 to 5 in half stars. | | `timely_care_pct` | double precision, percent | How often care began in a timely manner. | | `improved_walking_pct` | double precision, percent | How often patients got better at walking or moving around. | | `improved_bathing_pct` | double precision, percent | How often patients got better at bathing. | | `discharge_to_community_rate` | double precision, percent | Risk-standardized rate of discharge to the community. | | `discharge_to_community_category` | text | That rate against the national rate: Better Than, Same As or Worse Than National Rate. | | `preventable_readmission_rate` | double precision, percent | Risk-standardized potentially preventable 30-day readmission rate. | | `preventable_readmission_category` | text | That rate against the national rate. | | `preventable_hospitalization_rate` | double precision, percent | Risk-standardized potentially preventable hospitalization rate during home health. | | `preventable_hospitalization_category` | text | That rate against the national rate. | | `medicare_spend_ratio` | double precision, ratio | Medicare spending per episode relative to the national average (1.0). | | `spend_episodes` | integer, episodes | Episodes behind the spending ratio. | Joins: `facilities` on `home_health_agencies.facility_id = facilities.facility_id`; `facility_owners` on `home_health_agencies.facility_id = facility_owners.facility_id`; `nursing_homes` on `home_health_agencies.facility_id = nursing_homes.facility_id`; `hospices` on `home_health_agencies.facility_id = hospices.facility_id`; `dialysis_facilities` on `home_health_agencies.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `home_health_agencies.facility_id = surgery_centers.facility_id`; `health_center_sites` on `home_health_agencies.facility_id = health_center_sites.facility_id`. Know before you use it: - Care Compare, October 2026. A third of agencies are too small or too new for a star rating or outcome rates; those are NULL. - 388 certified agencies in facilities are not on Care Compare and have no row here. - medicare_spend_ratio compares the agency with the national average: 1.0 is average, above 1 costs Medicare more per episode. ### `hospices` Hospice detail: daily census, where care is delivered, diagnosis mix, the Hospice Care Index and the family caregiver survey. One row is one hospice listed on Care Compare. Key: `facility_id`. How it is read: - Join to facilities on facility_id for name, address, ownership and Medicare volume. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | CMS Certification Number. Joins to facilities.facility_id. | | `avg_daily_census` | double precision, patients per day | Average patients on service per day. | | `care_home_pct` | double precision, percent | Share of care days delivered at home. | | `care_assisted_living_pct` | double precision, percent | Share of care days in assisted living facilities. | | `care_nursing_facility_pct` | double precision, percent | Share of care days in long-term nursing facilities. | | `care_skilled_nursing_pct` | double precision, percent | Share of care days in skilled nursing facilities. | | `care_inpatient_hospice_pct` | double precision, percent | Share of care days in inpatient hospice facilities. | | `care_inpatient_hospital_pct` | double precision, percent | Share of care days in inpatient hospitals. | | `patients_cancer_pct` | double precision, percent | Share of patients with a primary diagnosis of cancer. | | `patients_dementia_pct` | double precision, percent | Share of patients with dementia. | | `patients_heart_disease_pct` | double precision, percent | Share of patients with circulatory or heart disease. | | `patients_respiratory_pct` | double precision, percent | Share of patients with respiratory disease. | | `patients_stroke_pct` | double precision, percent | Share of patients with stroke. | | `hospice_care_index` | double precision, score | Hospice Care Index, 0 to 10: how many of ten claims-based quality indicators the hospice met. | | `spending_per_beneficiary` | double precision, USD | Medicare spending per beneficiary. | | `visits_last_days_pct` | double precision, percent | Patients visited by a nurse or social worker on two of their last three days of life. | | `comprehensive_assessment_pct` | double precision, percent | Patients who got all seven admission care processes. | | `family_survey_star_rating` | smallint, stars | Family caregiver survey star rating, 1 to 5. | | `rated_9_or_10_pct` | double precision, percent | Caregivers who rated the hospice 9 or 10 out of 10. | | `would_recommend_pct` | double precision, percent | Caregivers who would definitely recommend the hospice. | Joins: `facilities` on `hospices.facility_id = facilities.facility_id`; `facility_owners` on `hospices.facility_id = facility_owners.facility_id`; `nursing_homes` on `hospices.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `hospices.facility_id = home_health_agencies.facility_id`; `dialysis_facilities` on `hospices.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `hospices.facility_id = surgery_centers.facility_id`; `health_center_sites` on `hospices.facility_id = health_center_sites.facility_id`. Know before you use it: - Care Compare, November 2026. Measures are NULL when CMS marks them not available (small or new hospices). Only a third of hospices have enough survey responses for a star rating. - 98 certified hospices in facilities are not on Care Compare and have no row here. - The care_*_pct columns split a hospice's days of care by setting and sum to about 100. The patients_*_pct columns split its patients by primary diagnosis. ### `dialysis_facilities` Dialysis facility detail: chain, stations, modalities offered, patient counts and outcome measures. One row is one dialysis facility listed on Care Compare. Key: `facility_id`. How it is read: - Join to facilities on facility_id. chain_organization values: 'DaVita', 'Fresenius Medical Care', 'US Renal Care, Inc.', 'Dialysis Clinic, Inc.', 'American Renal Associates', 'Independent'. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | CMS Certification Number. Joins to facilities.facility_id. | | `esrd_network` | smallint | ESRD Network number (1 to 18) that oversees the facility. | | `chain_owned` | boolean | True when the facility belongs to a chain. | | `chain_organization` | text | Chain name in mixed case, 'Independent' or 'Other'. | | `stations` | integer, stations | Dialysis stations. | | `late_shift` | boolean | True when the facility offers a shift starting at 5 pm or later. | | `offers_in_center_hemodialysis` | boolean | True when it offers in-center hemodialysis. | | `offers_peritoneal_dialysis` | boolean | True when it offers peritoneal dialysis. | | `offers_home_hemodialysis_training` | boolean | True when it offers home hemodialysis training. | | `five_star` | smallint, stars | CMS five-star quality rating, 1 to 5. | | `patients` | integer, patients | Medicare dialysis patients in the hospitalization measure, 2025. | | `survival_patients` | integer, patients | Patients in the four-year survival measure. | | `mortality_rate` | double precision, per 100 patient-years | Deaths per 100 patient-years. | | `survival_category` | text | Survival against expectation: Better than Expected, As Expected or Worse than Expected. | | `hospitalization_rate` | double precision, per 100 patient-years | Hospital admissions per 100 patient-years. | | `hospitalization_category` | text | Hospitalization against expectation. | | `readmission_rate` | double precision, percent | Share of hospital discharges followed by a readmission within 30 days. | | `transfusion_rate` | double precision, per 100 patient-years | Transfusions per 100 patient-years. | | `fistula_rate` | double precision, percent | Share of hemodialysis patients using an arteriovenous fistula. | | `transplant_waitlist_pct` | double precision, percent | Share of patients on a kidney transplant waitlist. | | `adult_hemodialysis_patients` | integer, patients | Adult hemodialysis patients in the adequacy measure. | | `adult_peritoneal_patients` | integer, patients | Adult peritoneal dialysis patients in the adequacy measure. | Joins: `facilities` on `dialysis_facilities.facility_id = facilities.facility_id`; `facility_owners` on `dialysis_facilities.facility_id = facility_owners.facility_id`; `nursing_homes` on `dialysis_facilities.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `dialysis_facilities.facility_id = home_health_agencies.facility_id`; `hospices` on `dialysis_facilities.facility_id = hospices.facility_id`; `surgery_centers` on `dialysis_facilities.facility_id = surgery_centers.facility_id`; `health_center_sites` on `dialysis_facilities.facility_id = health_center_sites.facility_id`. Know before you use it: - Care Compare, October 2026; outcome measures cover calendar 2025 (mortality 2022 to 2025). - 88 certified dialysis facilities in facilities are not on Care Compare and have no row here. - patients is the number of Medicare dialysis patients in the 2025 hospitalization measure, the closest published figure to a census. It undercounts facilities with many non-Medicare patients. - Rates are per 100 patient-years (mortality, hospitalization, transfusion) or percentages, as CMS publishes them. NULL when CMS withholds a small number. ### `surgery_centers` Ambulatory surgery center detail: operating rooms, procedure rooms and the surgical specialties performed. One row is one Medicare-certified ambulatory surgery center. Key: `facility_id`. How it is read: - Join to facilities on facility_id for name, address, ownership and Medicare volume. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | CMS Certification Number (ten characters). Joins to facilities.facility_id. | | `operating_rooms` | integer, rooms | Operating rooms. | | `procedure_rooms` | integer, rooms | Procedure rooms. | | `began_service_date` | date | Date the center began providing surgical services. | | `does_orthopedic` | boolean | True when it performs orthopedic surgery. | | `does_ophthalmology` | boolean | True when it performs eye surgery. | | `does_endoscopy` | boolean | True when it performs endoscopy. | | `does_pain` | boolean | True when it performs pain management procedures. | | `does_ent` | boolean | True when it performs ear, nose and throat surgery. | | `does_plastic` | boolean | True when it performs plastic surgery. | | `does_foot` | boolean | True when it performs foot surgery. | | `does_ob_gyn` | boolean | True when it performs obstetric or gynecologic surgery. | | `does_dental` | boolean | True when it performs dental surgery. | | `does_other` | boolean | True when it performs other kinds of surgery. | Joins: `facilities` on `surgery_centers.facility_id = facilities.facility_id`; `facility_owners` on `surgery_centers.facility_id = facility_owners.facility_id`; `nursing_homes` on `surgery_centers.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `surgery_centers.facility_id = home_health_agencies.facility_id`; `hospices` on `surgery_centers.facility_id = hospices.facility_id`; `dialysis_facilities` on `surgery_centers.facility_id = dialysis_facilities.facility_id`; `health_center_sites` on `surgery_centers.facility_id = health_center_sites.facility_id`. Know before you use it: - From the Provider of Services file, third quarter of 2026: what each center reported at its last certification survey, which can be several years old. - Specialty flags are NULL for about 440 centers that reported none. 45 surgery centers in facilities are known only from the quality file and have no row here. - No case volumes: for Medicare volume use facilities.medicare_patients and medicare_payment, or join facilities.npi to medicare_service for procedure codes. ### `health_center_sites` HRSA health center site detail: the parent health center, look-alike status, site type, hours and website. One row is one active HRSA Health Center Program or look-alike service delivery site. Key: `facility_id`. How it is read: - Join to facilities on facility_id (facility_type = 'health_center_site') for name, address and coordinates. Group by health_center_number to count sites per organization. | Column | Type | Meaning | |---|---|---| | `facility_id` | text | HRSA BPHC assigned site number. Joins to facilities.facility_id. | | `health_center_number` | text | HRSA grant or look-alike number of the parent health center. | | `health_center_name` | text | Name of the parent health center organization. | | `is_look_alike` | boolean | True for a look-alike: meets program rules without a federal grant. | | `location_type` | text | Permanent, Seasonal or Mobile. | | `setting` | text | Site setting, for example Freestanding or Co-located with School. | | `operated_by` | text | Who runs the site: the health center, a subrecipient or a contractor. | | `schedule` | text | Full-Time or Part-Time, when reported. | | `hours_per_week` | double precision, hours | Operating hours per week. | | `website` | text | Website of the health center, lowercase. | | `organization_type` | text | Legal form of the parent organization as HRSA records it. | | `organization_city` | text | City of the parent organization's headquarters. | | `organization_state` | char(2) | Two-letter USPS state code of the parent organization. | | `congressional_district` | text | Congressional district of the site, for example NY-15. | Indexed on `health_center_number`. Joins: `facilities` on `health_center_sites.facility_id = facilities.facility_id`; `facility_owners` on `health_center_sites.facility_id = facility_owners.facility_id`; `nursing_homes` on `health_center_sites.facility_id = nursing_homes.facility_id`; `home_health_agencies` on `health_center_sites.facility_id = home_health_agencies.facility_id`; `hospices` on `health_center_sites.facility_id = hospices.facility_id`; `dialysis_facilities` on `health_center_sites.facility_id = dialysis_facilities.facility_id`; `surgery_centers` on `health_center_sites.facility_id = surgery_centers.facility_id`. Know before you use it: - HRSA data warehouse, 4 December 2026. Sites are self-reported by the health center. - Includes seasonal school-based sites and mobile vans, which have no fixed address. - schedule is published for about a quarter of sites. ## Drug markets ### `rollup_drug_state` Medicare Part D volume per drug and state. POPULATION: Medicare Part D only (PDP and MA-PD plans together); no commercial, no Medicaid. One row is one drug (brand name plus generic name) in one state, per year. Key: `(brand_name, generic_name, state, year)`. How it is read: - PREFER for any Part D drug total or by-state question: milliseconds, where partd_drug takes seconds. Use total_claims and total_drug_cost for market size; sum over states for a national figure. - total_* is NULL for a few pseudo-states: ALWAYS write ORDER BY ... DESC NULLS LAST, and add total_claims IS NOT NULL for a ranking. - Same drug names as partd_drug: brand_name 'Eliquis', generic_name 'Apixaban'. Filter generic_name to cover every brand. - For Medicare Part D next to Medicaid, join rollup_medicaid_drug_state on brand_name, generic_name and state; pick ONE Medicaid year. | Column | Type | Meaning | |---|---|---| | `brand_name` | text | Brand name, title case, same spelling as partd_drug. | | `generic_name` | text | Generic (ingredient) name, title case. | | `state` | char(2) | Two-letter USPS state code of the prescribers. | | `year` | smallint | Calendar year the figures cover. | | `prescribers` | integer, prescribers | Prescribers with 11+ claims of the drug (from partd_drug). | | `claims` | bigint, claims | Claims from those prescribers only; undercounts. | | `fills_30day` | double precision, fills | 30-day-equivalent fills from those prescribers only. | | `drug_cost` | double precision, USD | Drug cost from those prescribers only; undercounts. | | `total_prescribers` | integer, prescribers | All prescribers of the drug in the state (CMS state total). | | `total_claims` | bigint, claims | All Part D claims for the drug in the state (CMS state total). | | `total_drug_cost` | double precision, USD | All Part D drug cost in the state, before rebates (CMS state total). | | `total_benes` | integer, patients | Medicare patients who filled the drug in the state. NULL when under 11. | Indexed on `(generic_name, state)`, `state`. Know before you use it: - Medicare Part D only: prescriptions paid through a Part D plan. Drugs given in a clinic (Part B) and other payers are not counted. - Two sets of figures. prescribers, claims, fills_30day and drug_cost are summed from partd_drug, which leaves out any prescriber with 10 or fewer claims of the drug, so they undercount. total_* are CMS's own state totals over every prescriber (Medicare Part D Prescribers by Geography and Drug): use them for market size. - total_* is NULL for the pseudo-states CMS has no state total for (XX, ZZ, AA, AE, AP) and where CMS suppressed the cell. claims is NULL where no prescriber in the state reached 11 claims. - Calendar year 2024. Registry, group and ownership tables are newer snapshots, so a clinician who moved since shows a different city there. ### `medicaid_drug_state` Medicaid outpatient drug utilization per state, quarter and NDC. POPULATION: Medicaid only (fee-for-service and managed care), all ages; no Medicare, no commercial. One row is one 11-digit NDC in one state, quarter and delivery system (fee-for-service or managed care). Key: `(state, year, quarter, utilization_type, ndc)`. Lake only: stored as Parquet and scanned by the analytics engine. It is not in Postgres and has no indexes. How it is read: - 10M rows. Only for questions by quarter, NDC or labeler. For totals by drug and state use rollup_medicaid_drug_state. - Always filter year (2024 or 2025) and brand_name or generic_name. Sums ignore suppressed cells. | Column | Type | Meaning | |---|---|---| | `state` | char(2) | Two-letter USPS state code of the Medicaid program. | | `year` | smallint | Calendar year the prescriptions were paid. | | `quarter` | smallint | Calendar quarter, 1 to 4. | | `utilization_type` | text | Delivery system that paid. `FFS` fee-for-service Medicaid, `MCO` Medicaid managed care plan. | | `ndc` | char(11) | 11-digit National Drug Code: labeler (5), product (4), package (2). | | `product_name` | text | Product name as the source gives it, cut to 10 characters. | | `brand_name` | text | Full product name; partd_drug spelling when name_source is 'partd'. | | `generic_name` | text | Generic name; partd_drug spelling when name_source is 'partd'. NULL when unknown. | | `name_source` | text | Where the names came from. `partd` matched to a Part D drug name, `fda` FDA NDC Directory name, `sdud` truncated source name. | | `labeler` | text | Company that labels the product (manufacturer, repackager or distributor), from the FDA NDC Directory. | | `suppressed` | boolean | True when CMS withheld the figures (fewer than 11 prescriptions). | | `prescriptions` | bigint, prescriptions | Prescriptions reimbursed. NULL when suppressed. | | `units` | double precision, units | Units reimbursed (tablets, mL, grams, by product). NULL when suppressed. | | `total_reimbursed` | double precision, USD | Total paid to pharmacies, Medicaid plus other payers, before rebates. | | `medicaid_reimbursed` | double precision, USD | Part of total_reimbursed paid by Medicaid. | | `non_medicaid_reimbursed` | double precision, USD | Part of total_reimbursed paid by other payers. | Know before you use it: - Medicaid State Drug Utilization Data, calendar years 2024 and 2025. Covers outpatient drugs states report for the Medicaid Drug Rebate Program; drugs not in that program are missing. No prescriber or pharmacy is identified. - A cell with fewer than 11 prescriptions is suppressed: the row exists with suppressed = true and NULL figures, which means hidden, not zero. About half the rows are suppressed, though they hold little volume. - Amounts are what Medicaid and other payers reimbursed pharmacies, before manufacturer rebates, which are large in Medicaid. Do not read them as net spending. - The source cuts product names to 10 characters. brand_name and generic_name come from the FDA NDC Directory and are spelled like partd_drug when the drug exists there (name_source = 'partd': 87% of prescriptions, 94% of dollars in 2025). Otherwise they are FDA names in title case ('fda'), or the truncated source name with no generic ('sdud'). - Lake only: stored as Parquet and scanned by the analytics engine. It has no indexes and cannot be joined to on Postgres. ### `rollup_medicaid_drug_state` Medicaid drug volume per drug, state and year. POPULATION: Medicaid only (fee-for-service plus managed care); no Medicare, no commercial. One row is one drug (brand name plus generic name) in one state, per year. How it is read: - PREFER for Medicaid drug questions. ALWAYS filter year (2025 is newest; 2024 matches the Medicare tables), or two years are added together. - Drug names match partd_drug and rollup_drug_state when in_partd is true: brand_name 'Eliquis', generic_name 'Apixaban'. | Column | Type | Meaning | |---|---|---| | `year` | smallint | Calendar year: 2024 or 2025. | | `brand_name` | text | Product name; partd_drug spelling when in_partd. | | `generic_name` | text | Generic name; partd_drug spelling when in_partd. NULL when unknown. | | `state` | char(2) | Two-letter USPS state code of the Medicaid program. | | `in_partd` | boolean | True when the drug name matches a drug in partd_drug. | | `prescriptions` | bigint, prescriptions | Medicaid prescriptions, fee-for-service plus managed care. | | `units` | double precision, units | Units reimbursed. | | `total_reimbursed` | double precision, USD | Total paid to pharmacies, before rebates. | | `medicaid_reimbursed` | double precision, USD | Part of total_reimbursed paid by Medicaid. | | `ffs_prescriptions` | bigint, prescriptions | Prescriptions paid by fee-for-service Medicaid. | | `mco_prescriptions` | bigint, prescriptions | Prescriptions paid by Medicaid managed care plans. | | `ffs_reimbursed` | double precision, USD | Amount paid under fee-for-service. | | `mco_reimbursed` | double precision, USD | Amount paid under managed care. | | `ndcs` | integer, NDCs | Distinct NDCs (package sizes and labelers) behind the row. | | `suppressed_cells` | integer, cells | Withheld NDC-quarter cells (under 11 prescriptions each) not in the sums. | Indexed on `(brand_name, state, year)`, `(generic_name, state, year)`, `(state, year)`. Know before you use it: - Built from medicaid_drug_state (Medicaid State Drug Utilization Data), calendar years 2024 and 2025. - Sums leave out suppressed cells (fewer than 11 prescriptions each); suppressed_cells counts them. When every cell is suppressed the figures are NULL, not zero. - Amounts are before manufacturer rebates, which are large in Medicaid. - A different year from the Medicare tables (2024): compare Medicaid 2024 to Part D 2024, or say the years differ. ### `drug_spending` National spending per drug and year, 2020 to 2024, for Medicare Part D, Medicare Part B and Medicaid, with manufacturer and unit price trend. One row is one drug, one manufacturer (or 'Overall') and one program, per year. Key: `id`. How it is read: - For a drug's total ALWAYS filter manufacturer = 'Overall'. For who makes it, filter manufacturer <> 'Overall'. - program is 'part_d', 'part_b' or 'medicaid'. Drug names are spelled like partd_drug ('Eliquis', 'Apixaban'). | Column | Type | Meaning | |---|---|---| | `id` | integer | Row number; no meaning outside this table. | | `program` | text | Which program paid. `part_d` Medicare Part D, `part_b` Medicare Part B fee-for-service, `medicaid` Medicaid. | | `brand_name` | text | Brand name, title case. | | `generic_name` | text | Generic name, title case. | | `manufacturer` | text | Manufacturer as CMS abbreviates it, or 'Overall' for all manufacturers together. | | `manufacturers` | integer, manufacturers | Number of manufacturers of the drug. NULL for Part B. | | `hcpcs_code` | text | HCPCS code of the drug. Part B rows only. | | `year` | smallint | Calendar year the figures cover. | | `total_spending` | double precision, USD | Total spending on the drug, before rebates. | | `dosage_units` | double precision, units | Dosage units dispensed or administered. | | `claims` | double precision, claims | Prescription fills (Part D, Medicaid) or claims (Part B). | | `benes` | double precision, patients | Patients who used the drug. NULL for Medicaid. | | `avg_spend_per_unit` | double precision, USD per unit | Average spending per dosage unit, weighted by volume. | | `avg_spend_per_claim` | double precision, USD per claim | Average spending per claim. | | `avg_spend_per_bene` | double precision, USD per patient | Average spending per patient. NULL for Medicaid. | | `outlier` | boolean | True when CMS flags the year's figures as an outlier. | | `unit_price_change_1y` | double precision, fraction | Change in average spending per unit, 2023 to 2024, as a fraction (0.05 = +5%). Same on every year's row. | | `unit_price_cagr` | double precision, fraction | Annual growth rate of average spending per unit, 2020 to 2024, as a fraction. Same on every year's row. | Indexed on `(brand_name, program, year)`, `(generic_name, program, year)`, `(program, year, manufacturer)`. Joins: `medicare_service` on `drug_spending.hcpcs_code = medicare_service.hcpcs_code`; `hcpcs` on `drug_spending.hcpcs_code = hcpcs.code`; `rollup_hcpcs_state` on `drug_spending.hcpcs_code = rollup_hcpcs_state.hcpcs_code`. Know before you use it: - CMS Drug Spending dashboards. National only: no state or prescriber. Three populations, in the program column: Medicare Part D, Medicare Part B fee-for-service, Medicaid. No commercial. - Part D and Medicaid list each drug once per manufacturer and once more as manufacturer = 'Overall'. Adding all rows of a drug doubles it. - Spending is gross, before manufacturer rebates. Part B rows are per HCPCS code and have no manufacturer. - A drug with no spending in a year has no row for that year. Medicaid has no patient counts. ## Payers ### `ma_plans` Every Medicare private plan with its insurer and parent company: Medicare Advantage, cost and PACE plans, and stand-alone Part D plans. POPULATION: Medicare beneficiaries in private plans; no commercial or Medicaid plans. One row is one plan (contract ID plus plan ID) in the November 2026 CMS enrollment file. How it is read: - plan_category: 'MA' Medicare Advantage, 'PDP' stand-alone drug plan, 'OTHER' cost, PACE and demonstration plans. Filter plan_category = 'MA' for Medicare Advantage. - Match parent_organization with ILIKE '%unitedhealth%'. For enrollment by state use ma_enrollment_state; by county join ma_enrollment_county on contract_id and plan_id. | Column | Type | Meaning | |---|---|---| | `contract_id` | text | CMS contract number, for example H1234. | | `plan_id` | text | Plan number within the contract, three digits. | | `plan_category` | text | Kind of plan. `MA` Medicare Advantage, `PDP` stand-alone Part D drug plan, `OTHER` cost, PACE or demonstration plan. | | `organization_type` | text | Contract type as CMS names it. | | `plan_type` | text | Plan type: HMO/HMOPOS, Local PPO, Regional PPO, PFFS, MSA, PDP and others. | | `offers_part_d` | boolean | True when the plan includes drug coverage. | | `is_snp` | boolean | True for a Special Needs Plan. | | `is_employer_plan` | boolean | True for an employer or union group plan. | | `organization_name` | text | Legal name of the organization holding the contract. | | `marketing_name` | text | Name the organization markets under. | | `plan_name` | text | Name of the plan. | | `parent_organization` | text | Parent company of the contract. | | `contract_effective_date` | date | Date the contract with CMS began. | | `enrollment` | integer, enrollees | Enrollees, summed over published counties. NULL when no county is published. | | `counties` | integer, counties | Counties with a published enrollment figure. | | `suppressed_counties` | integer, counties | Counties withheld (10 or fewer enrollees). | Indexed on `(contract_id, plan_id)`, `parent_organization`. Joins: `ma_enrollment_county` on `ma_plans.contract_id = ma_enrollment_county.contract_id`. Know before you use it: - CMS Monthly Enrollment by Contract/Plan/State/County, November 2026. Medicare plans only: employer commercial insurance, exchange plans and Medicaid managed care are not here. - enrollment is the sum of the plan's county rows. CMS withholds counties with 10 or fewer enrollees, so it is slightly low; suppressed_counties counts what was withheld. - Five cost contracts are listed without a plan (plan_id NULL) and have no enrollment rows. - parent_organization is the name CMS records ('UnitedHealth Group, Inc.', 'Humana Inc.', 'CVS Health Corporation' for Aetna, 'Elevance Health, Inc.' for Anthem). ### `ma_enrollment_county` Enrollment in each Medicare private plan per county of residence. POPULATION: Medicare beneficiaries in private plans (Medicare Advantage, cost, PACE, stand-alone Part D). One row is one plan in one county, November 2026. Key: `(contract_id, plan_id, ssa_code)`. How it is read: - 3.4M rows. Filter state or county_fips. Join ma_plans p ON p.contract_id = e.contract_id AND p.plan_id = e.plan_id for insurer and plan type. - county_fips joins medicare_enrollment_county for total Medicare population. For state totals by insurer use ma_enrollment_state. | Column | Type | Meaning | |---|---|---| | `contract_id` | text | CMS contract number; joins ma_plans. | | `plan_id` | text | Plan number within the contract; joins ma_plans. | | `ssa_code` | char(5) | Social Security state-county code of the county. | | `county_fips` | char(5) | Five-digit county FIPS code. NULL when CMS did not map the county. | | `state` | char(2) | Two-letter USPS state code of the county. | | `county` | text | County name. | | `enrollment` | integer, enrollees | Enrollees living in the county. NULL when 10 or fewer. | Indexed on `county_fips`, `state`. Joins: `ma_plans` on `ma_enrollment_county.contract_id = ma_plans.contract_id`; `facilities` on `ma_enrollment_county.county_fips = facilities.county_fips`; `medicare_enrollment_county` on `ma_enrollment_county.county_fips = medicare_enrollment_county.county_fips`. Know before you use it: - CMS withholds any plan-county cell with 10 or fewer enrollees: enrollment is NULL, which means 1 to 10, not zero. 94% of rows are withheld (mostly a handful of members living outside the plan's service area); the published rows hold almost all enrollees. - County is where the enrollee lives. About 3,500 rows have no state and 10,000 no county_fips, because CMS did not map their SSA county code. - Includes stand-alone Part D plans. Join ma_plans and filter plan_category = 'MA' for Medicare Advantage only, or drug-plan members are counted as MA. ### `ma_enrollment_state` Medicare private-plan enrollment per state and parent company. POPULATION: Medicare beneficiaries in private plans, split into Medicare Advantage, stand-alone Part D and other. One row is one parent company and one plan category in one state, November 2026. Key: `(state, parent_organization, plan_category)`. How it is read: - PREFER for payer market share by state. Filter plan_category = 'MA' for Medicare Advantage; without it stand-alone drug plans are mixed in. - This table is NOT the Medicare population. For the share of a state's Medicare beneficiaries in Medicare Advantage (MA penetration) use medicare_enrollment_state.ma_share (year = 2026), never a ratio within this table. - Share = enrollment / sum(enrollment) over the state. Match insurers with ILIKE: '%unitedhealth%', '%humana%', '%cvs%' (Aetna), '%elevance%' (Anthem), '%kaiser%'. | Column | Type | Meaning | |---|---|---| | `state` | char(2) | Two-letter USPS state code of the enrollees. | | `parent_organization` | text | Parent company of the plans. | | `plan_category` | text | Kind of plan. `MA` Medicare Advantage, `PDP` stand-alone Part D drug plan, `OTHER` cost, PACE or demonstration plan. | | `contracts` | integer, contracts | Contracts with enrollees in the state. | | `plans` | integer, plans | Plans with enrollees in the state. | | `enrollment` | integer, enrollees | Enrollees living in the state, published cells only. | | `snp_enrollment` | integer, enrollees | Part of enrollment in Special Needs Plans. | | `suppressed_cells` | integer, cells | Withheld plan-county cells (1 to 10 enrollees each) not in the sum. | Indexed on `parent_organization`. Know before you use it: - Built from ma_enrollment_county and ma_plans. Withheld county cells (10 or fewer enrollees) are not in the sum: the true figure lies between enrollment and enrollment + 10 x suppressed_cells. - Medicare only. An insurer's commercial and Medicaid members are not counted. ### `medicare_enrollment_state` People with Medicare per state and year, split into Original Medicare (fee-for-service) and Medicare Advantage. The denominator for every fee-for-service table: it says what share of a state's Medicare population those tables can see. One row is one state, per year. Key: `(state, year)`. How it is read: - To caveat or scale a 2024 fee-for-service figure, join on state and year = 2024: FFS share = original_medicare_benes / total_benes. - Never add years together. For 'now' use year = 2026. | Column | Type | Meaning | |---|---|---| | `state` | char(2) | Two-letter USPS state code of the beneficiaries. | | `year` | smallint | Calendar year. | | `month` | smallint | NULL for a yearly figure; the month number when the row is a single month (the newest year). | | `total_benes` | bigint, people | People with Medicare Part A or B. | | `original_medicare_benes` | bigint, people | People in Original Medicare (fee-for-service). | | `ma_other_benes` | bigint, people | People in Medicare Advantage and other health plans. | | `ma_share` | double precision, fraction | ma_other_benes / total_benes, 0 to 1. | | `aged_benes` | bigint, people | People entitled by age (65+). | | `disabled_benes` | bigint, people | People entitled by disability (under 65). | | `dual_benes` | bigint, people | People with both Medicare and Medicaid. | | `part_d_benes` | bigint, people | People with Part D drug coverage. | | `pdp_benes` | bigint, people | Part D enrollees in stand-alone drug plans. | | `mapd_benes` | bigint, people | Part D enrollees in Medicare Advantage drug plans. | Know before you use it: - CMS Medicare Monthly Enrollment. Years 2013 to 2025 are CMS's yearly figure (month is NULL); 2026 is the latest month published, August (month = 8). - The claims tables (medicare_provider, medicare_service, hospitals) cover only original_medicare_benes. Where ma_share is high (over half in many states) they see under half of Medicare patients. - States, DC and territories. The national row and CMS's 'foreign' and 'unknown' rows are left out, so states add up to slightly less than the US total. ### `medicare_enrollment_county` People with Medicare per county and year, split into Original Medicare (fee-for-service) and Medicare Advantage. One row is one county, per year. Key: `(county_fips, year)`. How it is read: - Never add years together: filter year. county_fips joins ma_enrollment_county. | Column | Type | Meaning | |---|---|---| | `county_fips` | char(5) | Five-digit county FIPS code. | | `state` | char(2) | Two-letter USPS state code of the county. | | `county` | text | County name. | | `year` | smallint | Calendar year. | | `month` | smallint | NULL for a yearly figure; the month number for the newest year. | | `total_benes` | bigint, people | People with Medicare Part A or B. | | `original_medicare_benes` | bigint, people | People in Original Medicare (fee-for-service). | | `ma_other_benes` | bigint, people | People in Medicare Advantage and other health plans. | | `ma_share` | double precision, fraction | ma_other_benes / total_benes, 0 to 1. | | `dual_benes` | bigint, people | People with both Medicare and Medicaid. | | `part_d_benes` | bigint, people | People with Part D drug coverage. | Indexed on `(state, year)`. Joins: `facilities` on `medicare_enrollment_county.county_fips = facilities.county_fips`; `ma_enrollment_county` on `medicare_enrollment_county.county_fips = ma_enrollment_county.county_fips`. Know before you use it: - CMS Medicare Monthly Enrollment. Years 2013 to 2025 are CMS's yearly figure (month is NULL); 2026 is the latest month published, August (month = 8). - A figure based on fewer than 11 people is NULL. Each state also has an 'Unknown' county row (county_fips ending 999). ## ACOs ### `acos` Medicare Shared Savings Program accountable care organizations: track, size, savings and quality, with the ACO's published executive contact. One row is one ACO. Key: `aco_id`. How it is read: - state is the ACO's office; service_area lists every state it operates in ('AZ, NV'): match it with ILIKE '%TX%'. - Members are in aco_participants (join on aco_id), which links to groups and, through group_members, to clinicians. | Column | Type | Meaning | |---|---|---| | `aco_id` | text | CMS ACO identifier, for example A1033. | | `name` | text | Name of the ACO. | | `participating` | boolean | True when the ACO is in the program in 2026. | | `service_area` | text | States the ACO operates in, comma-separated USPS codes. | | `state` | char(2) | Two-letter USPS state code of the ACO's office. | | `city` | text | City of the ACO's office. | | `zip5` | char(5) | ZIP code of the ACO's office. | | `address` | text | Office address as published. | | `track` | text | Risk track of the ACO. `BASIC` BASIC track (levels A to E; A and B carry no downside risk), `ENHANCED` ENHANCED track, highest risk and reward. | | `basic_track_level` | text | Level A to E within the BASIC track. | | `revenue_class` | text | CMS revenue class. `high` high revenue, typically hospital-led, `low` low revenue, typically physician-led. | | `assignment` | text | How patients are assigned: prospective or retrospective. | | `agreement_period` | smallint | Number of the ACO's current agreement period. | | `initial_start_date` | date | Date the ACO first joined the program. | | `current_start_date` | date | Start of the current agreement period. | | `snf_waiver` | boolean | True when the ACO holds the skilled-nursing 3-day rule waiver. | | `website` | text | Public reporting website of the ACO. | | `executive_name` | text | ACO executive, as published. | | `executive_email` | text | Executive's published e-mail address. | | `executive_phone` | text | Executive's published phone number. | | `medical_director_name` | text | ACO medical director, as published. | | `participants` | integer, participants | Participant organizations listed for 2026. | | `results_year` | smallint | Performance year of the result columns (2025). NULL when none. | | `assigned_benes` | integer, patients | Medicare patients assigned to the ACO in the results year. | | `benchmark` | double precision, USD | Total benchmark expenditure the ACO was measured against. | | `expenditures` | double precision, USD | Total actual expenditure for assigned patients. | | `generated_savings` | double precision, USD | Benchmark minus expenditures; negative is a loss. | | `earned_savings` | double precision, USD | Shared savings paid to the ACO; negative is a loss owed. | | `savings_rate` | double precision, fraction | generated_savings / benchmark, as a fraction. | | `quality_score` | double precision, score | Quality score, 0 to 1. | Indexed on `state`, `name` for substring search. Joins: `aco_participants` on `acos.aco_id = aco_participants.aco_id`. Know before you use it: - Medicare Shared Savings Program only. ACO REACH, Medicare Advantage and commercial ACO contracts are not included. - Organization details are performance year 2026. Results (assigned_benes through quality_score) are performance year 2025, the latest CMS has published: an ACO new in 2026 has none, and an ACO that left after 2025 is kept with participating = false. - Assigned beneficiaries are Original Medicare patients attributed to the ACO's clinicians, not members who enrolled. - Contact names, e-mail addresses and phone numbers are the ones each ACO must publish through CMS. ### `aco_participants` The organizations taking part in each Medicare Shared Savings Program ACO in 2026: practices, hospitals and clinics, by legal business name. One row is one participant organization in one ACO. Key: `id`. How it is read: - Clinicians in an ACO: aco_participants ap JOIN group_members gm ON gm.group_pac_id = ap.group_pac_id, then medicare_provider or providers on npi. - Is a group in an ACO: filter group_pac_id. Join acos on aco_id for the ACO's name, track and results. | Column | Type | Meaning | |---|---|---| | `id` | integer | Row number; no meaning outside this table. | | `aco_id` | text | ACO identifier; joins acos. | | `participant_name` | text | Legal business name of the participant, as published. | | `entries` | integer, entries | Times the name is listed for the ACO (separate tax IDs with one name). | | `group_pac_id` | bigint | Matched group practice in groups. NULL when not matched. | Indexed on `aco_id`, `group_pac_id`, `participant_name` for substring search. Joins: `acos` on `aco_participants.aco_id = acos.aco_id`; `groups` on `aco_participants.group_pac_id = groups.group_pac_id`; `group_members` on `aco_participants.group_pac_id = group_members.group_pac_id`. Know before you use it: - CMS publishes participant names only: no tax ID and no NPI. - group_pac_id is our own link, made only when the name equals exactly one group practice in the ACO's service-area states. 75% of rows are linked; solo practitioners listed under a person's name and ambiguous names are not. - A participant's clinicians are found through the group link (group_members), which covers clinicians who bill through that group. It is not CMS's official ACO provider list. ## Experts ### `trials` Clinical trials: every interventional study registered on ClinicalTrials.gov with at least one US site, with condition, sponsor, phase and status. One row is one study (NCT number). Key: `nct_id`. How it is read: - conditions and interventions are '; '-separated free text: match with ILIKE '%heart failure%'. - status: RECRUITING, NOT_YET_RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, TERMINATED, WITHDRAWN. sponsor_class 'INDUSTRY' is a company; 'NIH', 'OTHER' is mostly academic. - Sites are in trial_sites and people in trial_investigators, both joined on nct_id. | Column | Type | Meaning | |---|---|---| | `nct_id` | text | ClinicalTrials.gov identifier, for example NCT04224961. | | `title` | text | Brief title of the study. | | `status` | text | Overall recruitment status. | | `phase` | text | Phase: PHASE1, PHASE2, PHASE3, PHASE4, combinations like PHASE1/PHASE2, or NA for device and behavioral studies. | | `start_date` | date | Study start date (may be an estimate). | | `primary_completion_date` | date | Primary completion date (may be an estimate). | | `last_update_date` | date | Date the record was last updated. | | `enrollment` | integer, participants | Participants enrolled or planned. | | `conditions` | text | Conditions studied, '; '-separated free text. | | `intervention_types` | text | Kinds of intervention: DRUG, DEVICE, BIOLOGICAL, PROCEDURE, BEHAVIORAL and others, '; '-separated. | | `interventions` | text | Intervention names (drug or device), '; '-separated, at most 12. | | `sponsor` | text | Lead sponsor. | | `sponsor_class` | text | Kind of sponsor. `INDUSTRY` company, `NIH` NIH, `FED` other federal agency, `OTHER` university, hospital or other. | | `us_sites` | integer, sites | Number of US sites listed. | | `us_states` | integer, states | Number of US states with a site. | Indexed on `sponsor`, `start_date`, `conditions` for substring search. Joins: `trial_sites` on `trials.nct_id = trial_sites.nct_id`; `trial_investigators` on `trials.nct_id = trial_investigators.nct_id`. Know before you use it: - ClinicalTrials.gov as downloaded 2026-12-05. Interventional studies with a US site only: observational studies and studies with no US site are not included. - Entered by sponsors: conditions and interventions are free text, not coded, and dates can be estimates or wrong (a few start dates are far in the future). ### `trial_sites` The US sites of each clinical trial: facility name and location as the sponsor entered them. One row is one US site of one study. Key: `id`. How it is read: - 1.4M rows. Filter state (and city) or nct_id. Count trials with count(DISTINCT nct_id). Match a hospital with facility ILIKE '%mayo clinic%'. | Column | Type | Meaning | |---|---|---| | `id` | integer | Row number; no meaning outside this table. | | `nct_id` | text | Study identifier; joins trials. | | `facility` | text | Site name as entered by the sponsor. | | `city` | text | City of the site. | | `state` | char(2) | Two-letter USPS state code of the site. | | `zip5` | char(5) | ZIP code of the site. | | `recruitment_status` | text | Recruitment status of this site, when the study is still recruiting. | Indexed on `nct_id`, `(state, city)`. Joins: `trials` on `trial_sites.nct_id = trials.nct_id`; `trial_investigators` on `trial_sites.nct_id = trial_investigators.nct_id`. Know before you use it: - Facility names are free text typed by sponsors: the same hospital appears under several spellings and is not linked to hospitals.ccn. - Some industry studies hide the facility name ('Research Site'), so facility is missing or generic for about 6% of rows. ### `trial_investigators` The people named on clinical trials: principal investigators, study chairs and directors, and site investigators, linked to an NPI where the name is unambiguous. A signal of who the clinical experts are. One row is one named person in one role on one study (and one site, for site investigators). Key: `id`. How it is read: - For clinicians, filter npi IS NOT NULL and join providers or medicare_provider on npi. Count trials per person with count(DISTINCT nct_id). - Join trials on nct_id for condition, sponsor, phase and status. role 'PRINCIPAL_INVESTIGATOR' is the main one. | Column | Type | Meaning | |---|---|---| | `id` | integer | Row number; no meaning outside this table. | | `nct_id` | text | Study identifier; joins trials. | | `source` | text | Where the person is listed. `overall_official` study-level official, `site` investigator at one site. | | `role` | text | Role: PRINCIPAL_INVESTIGATOR, SUB_INVESTIGATOR, STUDY_CHAIR or STUDY_DIRECTOR. | | `name` | text | Name as published, often with degrees. | | `affiliation` | text | Affiliation of a study-level official, as published. | | `facility` | text | Site the person is attached to, when known. | | `city` | text | City of that site. | | `state` | char(2) | Two-letter USPS state code where the person was placed. NULL when it cannot be told. | | `zip5` | char(5) | ZIP code of that site. | | `state_basis` | text | How the state was decided. `site` the person's own site, `affiliation_is_site` the affiliation is one of the study's sites, `only_state` every US site of the study is in this state. | | `npi` | bigint | Linked National Provider Identifier. NULL when not linked. | | `match_confidence` | text | Strength of the NPI link. `high` unique name in the state, same city or ZIP, `medium` unique name in the state only. | Indexed on `npi`, `nct_id`, `state`. Joins: `trials` on `trial_investigators.nct_id = trials.nct_id`; `trial_sites` on `trial_investigators.nct_id = trial_sites.nct_id`; `medicare_provider` on `trial_investigators.npi = medicare_provider.npi`; `medicare_service` on `trial_investigators.npi = medicare_service.npi`; `providers` on `trial_investigators.npi = providers.npi`; `partd_provider` on `trial_investigators.npi = partd_provider.npi`; `partd_drug` on `trial_investigators.npi = partd_drug.npi`; `hospitals` on `trial_investigators.npi = hospitals.npi`; `group_members` on `trial_investigators.npi = group_members.npi`; `open_payments` on `trial_investigators.npi = open_payments.npi`; `clinician_facilities` on `trial_investigators.npi = clinician_facilities.npi`; `facilities` on `trial_investigators.npi = facilities.npi`; `nih_grants` on `trial_investigators.npi = nih_grants.npi`. Know before you use it: - ClinicalTrials.gov publishes names without NPIs. npi is our own link, made only when the name parses as one person, the investigator can be placed in a state, exactly one person in the NPI registry has that first and last name in that state, and that person is a doctoral-level clinician. 45% of rows are linked (67% of site principal investigators). - match_confidence 'high' means the registry address is in the investigator's city or ZIP; 'medium' means same state only. A name match can still be a different person: treat 'medium' as a lead to verify. - No npi means not linked, not that the person is no clinician: common names, non-clinician scientists, sponsor staff ('Medical Director') and multi-state studies whose official cannot be placed stay unlinked. - Site investigators are published only while a site is recruiting, so older studies list just the study-level officials. ### `nih_grants` NIH research funding: funded projects with their principal investigators, organization and award, fiscal years 2024 to 2026, linked to an NPI where the name is unambiguous. One row is one principal investigator on one funded project, per fiscal year. Key: `id`. How it is read: - Money: sum(award_amount) with is_contact_pi AND NOT is_subproject, and filter fiscal_year, or dollars are counted several times. - Funded clinicians: npi IS NOT NULL, joined to providers or medicare_provider on npi. activity_code 'R01' is the standard research grant; 'K' codes are career awards. | Column | Type | Meaning | |---|---|---| | `id` | integer | Row number; no meaning outside this table. | | `application_id` | bigint | NIH application ID: one funded project-year. | | `fiscal_year` | smallint | Federal fiscal year of the award (October to September). | | `project_num` | text | Full project number, for example 5R01CA244947-05. | | `core_project_num` | text | Project number without year and type: the same across a grant's years. | | `activity_code` | text | Grant mechanism: R01, R21, K23, U01, P30 and others. | | `institute` | text | NIH institute administering the award: NCI, NHLBI, NIA and others. | | `title` | text | Project title. | | `organization` | text | Organization receiving the award, upper case. | | `org_city` | text | City of the organization. | | `state` | char(2) | Two-letter USPS state code of the organization. | | `zip5` | char(5) | ZIP code of the organization. | | `organization_type` | text | Kind of organization, for example SCHOOLS OF MEDICINE. | | `pi_name` | text | Principal investigator's name. | | `pi_profile_id` | bigint | NIH's identifier for the investigator, the same across projects. | | `pi_title` | text | Investigator's position title as recorded by NIH. | | `is_contact_pi` | boolean | True for the project's contact investigator (exactly one per project). | | `pi_count` | smallint, people | Number of principal investigators on the project. | | `is_subproject` | boolean | True for a subproject of a larger center or program grant. | | `award_amount` | double precision, USD | Total award for the project-year, repeated on each investigator's row. | | `direct_cost` | double precision, USD | Direct costs of the award. | | `indirect_cost` | double precision, USD | Indirect (overhead) costs of the award. | | `project_start_date` | date | Start of the whole project. | | `project_end_date` | date | Planned end of the whole project. | | `npi` | bigint | Linked National Provider Identifier. NULL when not linked. | | `match_confidence` | text | Strength of the NPI link. `high` unique name in the state, same city, `medium` unique name in the state only. | Indexed on `npi`, `(state, fiscal_year)`, `application_id`, `organization`. Joins: `medicare_provider` on `nih_grants.npi = medicare_provider.npi`; `medicare_service` on `nih_grants.npi = medicare_service.npi`; `providers` on `nih_grants.npi = providers.npi`; `partd_provider` on `nih_grants.npi = partd_provider.npi`; `partd_drug` on `nih_grants.npi = partd_drug.npi`; `hospitals` on `nih_grants.npi = hospitals.npi`; `group_members` on `nih_grants.npi = group_members.npi`; `open_payments` on `nih_grants.npi = open_payments.npi`; `clinician_facilities` on `nih_grants.npi = clinician_facilities.npi`; `facilities` on `nih_grants.npi = facilities.npi`; `trial_investigators` on `nih_grants.npi = trial_investigators.npi`. Know before you use it: - NIH RePORTER, fiscal years 2024 to 2026, organizations in US states and territories. About 4% of FY2024 and FY2025 projects have no state in RePORTER and are not included. FY2026 was downloaded 2026-12-05 and may still gain late awards. - A project with several principal investigators has one row each, and every row repeats the project's award_amount. Subprojects of center grants are rows too, and their money is already inside the parent award. - RePORTER has no NPI. npi is our own link: exactly one doctoral-level clinician in the NPI registry with that first and last name in the organization's state. 21% of rows are linked, because most NIH investigators are scientists without an NPI. 'medium' links (same state, different city) need verifying. ## Catalog ### `sources` The receipt behind every number: which file each table was built from, its version, and when it was loaded. One row is one loaded dataset (one table). Key: `dataset`. Postgres only: it has no copy in the lake. | Column | Type | Meaning | |---|---|---| | `dataset` | text | Dataset name, the same as the table it loads. | | `title` | text | Title of the source file as the publisher names it. | | `publisher` | text | Who published the source file. | | `url` | text | Download link of the exact file version that was loaded. | | `version` | text | Publisher's release or version label. | | `data_year` | smallint | Year the data describes. | | `table_name` | text | Table the dataset is loaded into. | | `row_count` | bigint, rows | Rows in the table after the last load. | | `raw_keys` | text[] | Object Storage keys of the files exactly as published. | | `parquet_key` | text | Object Storage key of the cleaned Parquet file in the lake. | | `in_postgres` | boolean | True when the table is also loaded into Postgres. False means lake only. | | `parquet_bytes` | bigint, bytes | Size of the Parquet file. | | `loaded_at` | timestamp with time zone | When the table was last loaded. | Know before you use it: - Written by the pipeline at load time. Postgres only: it has no copy in the lake. ### `catalog_columns` Profile statistics for every column of every dataset: how full it is, how many distinct values it has, its range and its most common values. One row is one column of one dataset. Key: `(dataset, column_name)`. Postgres only: it has no copy in the lake. | Column | Type | Meaning | |---|---|---| | `dataset` | text | Table the column belongs to. | | `column_name` | text | Name of the column. | | `ordinal` | integer | Position of the column in its table, starting at 1. | | `null_pct` | double precision, percent | Share of rows where the column is NULL, 0 to 100. | | `distinct_count` | bigint, values | Number of distinct non-NULL values. Exact for tables up to 50 million rows, approximate above. | | `min` | text | Smallest value, as text. Numbers and dates only. | | `max` | text | Largest value, as text. Numbers and dates only. | | `median` | double precision | Median value. Numeric columns only. | | `top_values` | jsonb | Most common values with their row counts, as a JSON array of {v, n}. Only for category columns with at most 10,000 distinct values. | | `profiled_at` | timestamp with time zone | When the statistics were computed. | Know before you use it: - Computed from the Parquet files when the pipeline runs, so it describes the data as of profiled_at. - Identifier, name, address and phone columns carry only null_pct and distinct_count. Their min, max, median and top_values are always NULL. --- # Caveats URL: https://openpipe.health/docs/data/caveats/ Markdown: https://openpipe.health/docs/data/caveats.md > What the data does not show. Read this before quoting a number. ## Volumes are Medicare fee-for-service only Every service, patient and payment count comes from traditional Medicare Part B and Part D claims. It leaves out: - Commercial insurance - Medicare Advantage - Medicaid - Self-pay A surgeon's `services` is therefore a floor, not their total volume. The share that Medicare fee-for-service represents varies a lot by specialty and region: it is high for cataract surgery and joint replacement, and close to nothing for paediatrics and obstetrics. Use the numbers to **rank and compare** clinicians within a specialty. Do not present them as total procedure counts. The same scope applies to hospital DRG volumes (`hospital_drgs`) and to the Medicare patients, days and payments on care sites (`facilities`). To see how much of an area's Medicare population fee-for-service covers, read `ma_share` on [`GET /api/market/payers`](https://openpipe.health/docs/api/payers-acos.md#get-medicare-payers-in-a-state-or-the-nation): where it is above one half, these tables see under half of Medicare patients. A few datasets cover other populations, and each says so in its response: Medicare Part D plans, Medicaid, and Medicare private-plan enrollment. See [Drug markets, payers and ACOs](#drug-markets-payers-and-acos). None of the data is commercial insurance. ## Small cells are suppressed CMS withholds any figure based on fewer than 11 patients. In the Medicare files those rows are missing or the value is `NULL`. - A clinician who performed a procedure on 10 Medicare patients does not appear for that procedure. - Sums over many small rows undercount. - `NULL` means "withheld", not zero. Sorts put `NULL` last. The threshold differs a little by source: | Data | Withheld when | |---|---| | Medicare Part B and Part D by clinician | Fewer than 11 patients | | Hospital DRG volume | Fewer than 11 discharges for that hospital and DRG | | Medicaid drug utilization | Fewer than 11 prescriptions in a cell | | Medicare Advantage and Part D enrollment | 10 or fewer enrollees in a plan-county cell | | Medicare enrollment by county | Fewer than 11 people | ## Utilization is from 2024 Medicare and Part D data describe calendar year 2024. Registry, group and ownership data are from late 2026. A clinician who moved in 2025 shows their new address in `providers` and their old city in `medicare_provider`. ## Specialty names differ between tables `medicare_provider.provider_type` uses Medicare specialty names (`Cardiology`). `providers.specialty` uses the NUCC taxonomy (`Internal Medicine` with subspecialty `Cardiovascular Disease`). Read a specialty against the table it came from: a result's `sources` says which. ## Names are stored as published Registry and hospital names are UPPERCASE. Medicare names are mixed case. Substring filters in the search endpoints ignore case. ## Hospital financials come from cost reports Revenue, cost and income are self-reported by each hospital on its Medicare cost report for the fiscal year ending in `fiscal_year_end`. Hospitals that have not filed have `NULL` financials. ## Private-equity flags are CMS's `has_private_equity_owner` and `is_private_equity` come from the ownership disclosures hospitals file with CMS. They reflect what was disclosed, and CMS has said the reporting is incomplete. The same holds for [care sites](https://openpipe.health/docs/api/care-sites.md#owner-flags-are-self-reported). The private-equity, REIT, holding-company and management-company flags in `facility_owners` are the filer's own answers. Owner data exists only for nursing homes, home health agencies, hospices, FQHCs and rural health clinics. ## Open Payments is aggregated `open_payments` holds one row per clinician and company with the year's total, not individual payments. Research payments and ownership interests are not included. ## Hospital quality, EHR and health systems Details and examples are on [Hospitals and systems](https://openpipe.health/docs/api/hospital-intel.md#caveats). - **Quality** (`hospital_quality`, `hospital_measures`) is the Care Compare release of November 2026. Each measure has its own measurement period. `NULL` means CMS published no value, and about 40% of hospitals have no overall star rating. Scores are not on one scale, so do not average across measures. - **EHR** (`hospital_ehr`, `hospital_ehr_products`) is what each hospital attested to CMS for program year 2024 (2023 where 2024 is missing), published by ONC in January 2026. It covers about 4,200 hospitals, 85% of acute care hospitals. No row means unknown, not "no EHR", and a go-live since 2024 is not reflected. Only ONC-certified products are listed. - **Health systems** (`hospital_systems`) are derived from the home office each hospital names on its fiscal year 2024 Medicare cost report. No row means independent or unknown. `system_id` is stable only within one load of the data. - **DRG volume** (`hospital_drgs`) is calendar year 2024 for about 2,900 hospitals paid under the inpatient prospective payment system. Critical access hospitals and Maryland hospitals are not included. ## Clinician affiliations come from claims `clinician_facilities` is the CMS Doctors and Clinicians release of November 2026. CMS lists a facility when the clinician billed Medicare for patients there in recent months. It is not employment, admitting privileges or a medical-staff roster. CMS publishes at most five hospitals per clinician, and clinicians who see no Medicare patients are absent. ## Care sites Details are on [Care sites](https://openpipe.health/docs/api/care-sites.md#caveats). - Acute-care hospitals are in `hospitals`, not `facilities`. - HRSA health center sites and CMS-certified FQHCs are two registries of largely the same clinics. Count one type or the other. - `star_rating` means something different per facility type. Compare within one type. - Certification data is the third quarter of 2026, listings and ratings are September to November 2026, HRSA sites are 4 December 2026, and Medicare volumes are calendar year 2024. ## Drug markets, payers and ACOs Details are on [Drug markets](https://openpipe.health/docs/api/drug-markets.md#caveats) and [Payers and ACOs](https://openpipe.health/docs/api/payers-acos.md#caveats). - **Part D by state** (`rollup_drug_state`) is Medicare Part D only, 2024. The `total_*` columns are CMS's state totals. The others are summed from prescribers and undercount. - **Medicaid** (`medicaid_drug_state`, `rollup_medicaid_drug_state`) is calendar years 2024 and 2025. Amounts are before manufacturer rebates, which are large in Medicaid. Suppressed cells are left out of the sums. - **Drug spending** (`drug_spending`) is national only, 2020 to 2024, before rebates. Part D and Medicaid list each drug once per manufacturer and once as `Overall`. Adding all rows doubles it. - **Plans and enrollment** (`ma_plans`, `ma_enrollment_county`, `ma_enrollment_state`) are Medicare private plans for November 2026. Commercial and Medicaid members are not counted. 94% of plan-county cells are withheld, though they hold few enrollees, so every sum is slightly low. - **Medicare enrollment** (`medicare_enrollment_state`, `medicare_enrollment_county`) is yearly for 2013 to 2025 and August for 2026. - **ACOs** (`acos`, `aco_participants`) are the Medicare Shared Savings Program only. Organization details are performance year 2026 and results are performance year 2025. Participants are linked to group practices by exact name, for about 75% of rows. ## Trials and grants are linked by name ClinicalTrials.gov and NIH RePORTER publish no NPI. The `npi` on `trial_investigators` and `nih_grants` is a link made here, only when exactly one doctoral-level clinician in the NPI registry has that first and last name in that state. - `match_confidence` is `high` when the registry address is in the same city or ZIP, and `medium` when only the state matches. Verify a `medium` link. - 45% of trial investigator rows and 21% of NIH grant rows are linked. No `npi` means not linked. - Trials are interventional studies with a US site, as downloaded on 5 December 2026. Conditions are free text. - NIH grants cover fiscal years 2024 to 2026. A project with several principal investigators repeats its award on each row. More on [Experts](https://openpipe.health/docs/api/experts.md#caveats).