Get price distribution for a billing code
get_code_price_distributionReturns the distribution of every hospital's price for a code_type/code, computed server-side: min/p10/q1/median/q3/p90/max, standard deviation, a histogram, and the real hospital nearest each percentile. Use this instead of paging through list_hospital_code_costs when you want to know how prices spread across hospitals (e.g. "is $12k high for MS-DRG 788?" - pass reference_price to get the number of hospitals priced below it). All figures are in terms of the chosen statistic (default: each hospital's average price). Served from the hospital-prices serving snapshot, which pools exactly (exact medians), so figures can differ slightly from earlier results of this tool. Like those, each figure still combines facility and professional charges (and all settings) into one number; use get_code_provider_price_distribution for a per-billing-class breakdown instead. With statistic MIN/MAX the figure is now the hospital's lowest/highest charge itself, not widened by the filing's per-item minimum/maximum.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code_type": "<code_type>",
"code": "<code>"
},
"name": "get_code_price_distribution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| bin_count | No | Number of histogram bars. Defaults to 16, capped at 200 (larger values are rejected). | |
| code_type | Yes | Code system the billing code belongs to, e.g. APR-DRG, CDM, CPT, HCPCS, MS-DRG, RC. | |
| statistic | No | Which per-hospital figure to distribute: each hospital's average (default), median, lowest filed price, or highest filed price. | |
| methodology | No | Pricing methodology. Omit to aggregate across all methodologies. | |
| reference_price | No | Optional price to place on the distribution. When positive, hospitals_below_reference counts hospitals priced strictly below it. Negative values are rejected. | |
| min_sample_count | No | Minimum pricing sample size: only include hospitals whose price is backed by at least this many billing records (same semantics as list_hospital_code_costs). 0 (default) disables the filter. Negative values are rejected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q1 | No | 25th percentile. | |
| q3 | No | 75th percentile. | |
| max | No | ||
| min | No | ||
| p10 | No | ||
| p90 | No | ||
| mean | No | Mean across hospitals of the request's statistic (a national average). 0 when hospital_count is 0. | |
| median | No | ||
| std_dev | No | Population standard deviation of the per-hospital values. | |
| q1_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| q3_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| histogram_hi | No | Upper edge of the last bar: min(max, 1.35 * p90), or min + 1 when that is not above the minimum. Hospitals priced above this are counted in overflow_count. | |
| histogram_lo | No | Lower edge of the first histogram bar (the minimum). | |
| max_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| min_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| p10_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| p90_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| mean_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| histogram_bins | No | Hospital count per equal-width bar from histogram_lo to histogram_hi; the last bar includes its upper edge. | |
| hospital_count | No | Hospitals with a positive value for the code on their latest revision (and at least min_sample_count samples, if set). 0 means every other field is unset. | |
| overflow_count | No | Hospitals priced above histogram_hi. | |
| median_hospital | No | A real hospital and its price for the code, used to name a hospital at a percentile. Unset (absent or empty hospital_id) when hospital_count is 0. | |
| hospitals_below_reference | No | Hospitals priced strictly below the request's reference_price; 0 when it was not set. |