Get Hospital Quality
get_hospital_qualityReturns one hospital's CMS Care Compare quality record by CCN: the overall star rating (1-5) with hospital type / ownership; every Care Compare measure for the hospital (mortality and complication rates, unplanned readmission / ED-return rates, timely and effective care, healthcare-associated infections SIRs, outpatient imaging efficiency, maternal health) with the score, CMS's compared-to-national verdict where published, denominator, confidence bounds and measurement window; the HCAHPS patient-experience summary (summary star + per-dimension star ratings and linear mean scores) for the latest reporting year the hospital has; and the HRRP excess readmission ratios per condition for the latest fiscal year (ratio > 1 = more readmissions than nationally expected). Inputs: ccn (required, 6-char CMS certification number); optional measure_group (alias: measure_source) to get ONE group's measure rows (complications_deaths | unplanned_visits | timely_care | healthcare_assoc_infections | outpatient_imaging_efficiency | maternal_health); optional limit and offset to page the measure rows (default limit 25 once detail is asked for).
THE DEFAULT CALL IS A SUMMARY: ccn alone returns the overall rating, the HCAHPS and HRRP blocks, and the measure GROUPS with a count each (summary.measure_groups: measure_count / available / not_available / vs_national per group) — NOT the ~108 measure rows, which exceed the response budget for a single hospital. Totals are still reported (summary.measure_count) and row_counts.measures names what was withheld; ask again with measure_group, or limit / offset, for the rows.
RETURNS a detail payload: value.summary (facility, overall_rating with status + footnote, hcahps_summary_star, counts, measure_groups, measure_detail_mode, and a blocks map saying which of overall_rating / measures / hcahps / hrrp are available for THIS hospital); value.measures, value.hcahps, value.hrrp row lists. Every row carries status = available | not_available (with the CMS footnote or reason), source_table and source_vintage (asserted_at). Nothing is fabricated: a suppressed or unreported measure is not_available, never a zero; an unrated hospital reports overall_rating null with the CMS footnote. All four sources are read WHERE is_current = true. An unknown CCN returns found=false.
SOURCE: CMS Provider Data Catalog (Care Compare) Hospital General Information, hospital measure files, HCAHPS, and the HRRP hospital file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ccn | Yes | ||
| limit | No | ||
| offset | No | ||
| measure_group | No | ||
| measure_source | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | ||
| as_of | No | ||
| value | Yes | ||
| source | Yes | ||
| status | No | complete | |
| caveats | No | ||
| failure | No | ||
| quality | No | ||
| refusal | No | ||
| vintage | No | as_restated | |
| audit_id | Yes | UUID; ties to medicare_silver.audit_log row. | |
| signature | No | ||
| tenant_id | No | Calling tenant slug, resolved by the binding and stamped via the per-call tenant context. Defaults to the bootstrap 'internal' tenant for local/in-process callers. | |
| timestamp | Yes | ||
| confidence | No | ||
| data_as_of | No | ||
| request_id | Yes | ||
| methodology | No | ||
| snapshot_set | Yes | {table_fqn → iceberg_snapshot_id (int64)}. Per M-2 §2.2. | |
| tool_version | Yes | ||
| response_hash | Yes | SHA-256 of canonicalized form per M-2 §2.4. | |
| result_status | Yes | ||
| vintage_basis | No | default_unmeasured | |
| as_of_asserted | No | ||
| as_of_observed | No | ||
| parse_revision | No | ||
| as_of_effective | No | ||
| freshness_state | No | unknown | |
| methodology_era | No | ||
| confidence_basis | No | ||
| semantic_version | Yes | ||
| invariants_applied | No | ||
| finality_confidence | No | ||
| cms_vintage_sequence | Yes | ||
| parser_artifact_hash | Yes | ||
| methodology_blend_factors | No | ||
| parser_artifact_hash_basis | No | not_evaluated |