Healthcare Associated Infections

Getting Started

All communication with the API is done through HTTPS, and errors are communicated through HTTP response codes. Available response types include JSON, XML, and CSV, which are selectable by the "extension" on API requests or by HTTP Accepts headers.

This documentation also includes inline, runable examples. Click on any link that contains a gear symbol next to it to run that example live against the Healthcare Associated Infections API.

App Tokens

All requests should include an app token that identifies your application, and each application should have its own unique app token. A limited number of requests can be made without an app token, but they are subject to much lower throttling limits than request that do include one. If you don't have an app token yet, click the button to the right to sign up for one.

Once you have an app token, you can include it with your request either by using the X-App-Token HTTP header, or by passing it via the $app_token parameter on your URL.

Response Codes

One of the following response codes will be returned with every request:

  1. 200Successful request.
  2. 202Request processing. You can retry your request, and when it's complete, you'll get a 200 instead.
  3. 400Bad request
  4. 401Unauthorized. You're not authorized to access this resource.
  5. 404Not found. The resource requested doesn't exist.
  6. 429Too Many Requests. The client has made too many requests and is currently being rate limited.
  7. 500Server errors. Our bad!

Code Samples

#!/usr/bin/env ruby

require 'net/https'
uri = URI('https://data.medicare.gov/resource/healthcare-associated-infections.json?recall_id=94')

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER

request = Net::HTTP::Get.new(uri.request_uri)
request.add_field('X-App-Token', ARGV[0])

response = http.request(request)
puts response.code
puts response.body
#!/usr/bin/env python

import sys
import requests

r = requests.get('https://data.medicare.gov/resource/healthcare-associated-infections.json?recall_id=94', headers={'X-App-Token': sys.argv[1]})
print r.status_code
print r.text
request = require 'request'
options = uri: 'https://data.medicare.gov/resource/healthcare-associated-infections.json?$$app_token=APP_TOKEN&recall_id=94'
request options, (err, response, body) ->  console.log body
#!/bin/sh 

curl --header "X-App-Token: $1" "https://data.medicare.gov/resource/healthcare-associated-infections.json?recall_id=94"

Fields

The following fields are available on the Healthcare Associated Infections API.

provider_id

Human Name: Provider ID
Type: text

Examples

Retrieve all records with provider_id equal to 670085:

Retrieve all records where provider_id is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(provider_id, 47.598177,-122.33448, 1000)

hospital_name

Human Name: Hospital Name
Type: text

Examples

Retrieve all records with hospital_name equal to ZUNI COMPREHENSIVE COMMUNITY HEALTH CENTER:
Retrieve all records with hospital_name equal to ZUNI COMPREHENSIVE COMMUNITY HEALTH CENTER:

Retrieve all records that are greater than ABBEVILLE AREA MEDICAL CENTER:

Retrieve all records with hospital_name equal to ZUNI COMPREHENSIVE COMMUNITY HEALTH CENTER:

Retrieve all records where hospital_name is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(hospital_name, 47.598177,-122.33448, 1000)

address_1

Human Name: Address 1
Type: text

Examples

Retrieve all records with address_1 equal to WHITEHORSE PIKE AND TOWNSEND AVENUE:
Retrieve all records with address_1 equal to WHITEHORSE PIKE AND TOWNSEND AVENUE:

Retrieve all records that are greater than #1 MEDICAL PARK DRIVE:

Retrieve all records with address_1 equal to WHITEHORSE PIKE AND TOWNSEND AVENUE:

Retrieve all records where address_1 is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(address_1, 47.598177,-122.33448, 1000)

address_2

Human Name: Address 2
Type: text

Examples

Retrieve all records with address_2 equal to {column.cachedContents.largest}:
Retrieve all records with address_2 equal to {column.cachedContents.largest}:

Retrieve all records that are greater than {column.cachedContents.smallest}:

Retrieve all records with address_2 equal to {column.cachedContents.largest}:

Retrieve all records where address_2 is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(address_2, 47.598177,-122.33448, 1000)

address_3

Human Name: Address 3
Type: text

Examples

Retrieve all records with address_3 equal to {column.cachedContents.largest}:
Retrieve all records with address_3 equal to {column.cachedContents.largest}:

Retrieve all records that are greater than {column.cachedContents.smallest}:

Retrieve all records with address_3 equal to {column.cachedContents.largest}:

Retrieve all records where address_3 is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(address_3, 47.598177,-122.33448, 1000)

city

Human Name: City
Type: text

Examples

Retrieve all records with city equal to ZUNI:

Retrieve all records where city is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(city, 47.598177,-122.33448, 1000)

state

Human Name: State
Type: text

Examples

Retrieve all records with state equal to WY:

Retrieve all records where state is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(state, 47.598177,-122.33448, 1000)

zip_code

Human Name: ZIP Code
Type: text

Examples

Retrieve all records with zip_code equal to 99929:

Retrieve all records where zip_code is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(zip_code, 47.598177,-122.33448, 1000)

county_name

Human Name: County Name
Type: text

Examples

Retrieve all records with county_name equal to YUMA:

Retrieve all records where county_name is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(county_name, 47.598177,-122.33448, 1000)

phone_number

Human Name: Phone Number
Type: phone

Examples

Retrieve all records with phone_number equal to phone_number: 9898943000:
Retrieve all records with phone_number equal to phone_number: 9898943000:

Retrieve all records where phone_number is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(phone_number, 47.598177,-122.33448, 1000)

measure

Human Name: Measure
Type: text

Examples

Retrieve all records with measure equal to Surgical Site Infection from colon surgery (SSI: Colon):
Retrieve all records with measure equal to Surgical Site Infection from colon surgery (SSI: Colon):

Retrieve all records that occurred before 2012-08-10:

Retrieve all records with measure equal to Surgical Site Infection from colon surgery (SSI: Colon):

Retrieve all records that are greater than C.diff Compared to National:

Retrieve all records with measure equal to Surgical Site Infection from colon surgery (SSI: Colon):

Retrieve all records where measure is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(measure, 47.598177,-122.33448, 1000)

score

Human Name: Score
Type: number

Examples

Retrieve all records with score equal to 319973:

Retrieve all records where score is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(score, 47.598177,-122.33448, 1000)

footnote

Human Name: Footnote
Type: text

Examples

Retrieve all records with footnote equal to This measure does not apply to this hospital for this reporting period:
Retrieve all records with footnote equal to This measure does not apply to this hospital for this reporting period:

Retrieve all records that occurred before 2012-08-10:

Retrieve all records with footnote equal to This measure does not apply to this hospital for this reporting period:

Retrieve all records that are greater than Results are based on a shorter time period than required:

Retrieve all records with footnote equal to This measure does not apply to this hospital for this reporting period:

Retrieve all records where footnote is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(footnote, 47.598177,-122.33448, 1000)

location

Human Name: Location
Type: location

Examples

Retrieve all records with location equal to longitude: -74.91831557399968, latitude: 39.78377011000049, human_address: {"address":"WHITEHORSE PIKE AND TOWNSEND AVENUE","city":"BERLIN","state":"NJ","zip":"08009"}:
Retrieve all records with location equal to longitude: -74.91831557399968, latitude: 39.78377011000049, human_address: {"address":"WHITEHORSE PIKE AND TOWNSEND AVENUE","city":"BERLIN","state":"NJ","zip":"08009"}:

Retrieve all records that occurred before 2012-08-10:

Retrieve all records with location equal to longitude: -74.91831557399968, latitude: 39.78377011000049, human_address: {"address":"WHITEHORSE PIKE AND TOWNSEND AVENUE","city":"BERLIN","state":"NJ","zip":"08009"}:

Retrieve all records that are greater than longitude: -92.58531797299969, latitude: 34.572690786000464, human_address: {"address":"#1 MEDICAL PARK DRIVE","city":"BENTON","state":"AR","zip":"72015"}:

Retrieve all records with location equal to longitude: -74.91831557399968, latitude: 39.78377011000049, human_address: {"address":"WHITEHORSE PIKE AND TOWNSEND AVENUE","city":"BERLIN","state":"NJ","zip":"08009"}:

Retrieve all records where location is within 1 kilometer of Seattle, WA (47.598177,-122.33448):

https://data.medicare.gov/resource/healthcare-associated-infections.json?$where=within_circle(location, 47.598177,-122.33448, 1000)