Blue Button 2.0 is an API from the Centres for Medicare & Medicaid Services (CMS) that incorporates data for 53 million beneficiaries. It contains four years of data that reveals information about the health of each individual, including the Medicare plan they are on right through to the primary care and medicines they receive.
It is an initiative in the U.S. to link claims data from Medicare and make this available to the consumers – i.e. the people who the claim was about. The Blue Button 2.0 API uses the HL7® FHIR® standard as the format and OAuth 2.0 standard and SMART as the authorisation mechanism.
Developers can integrate with the Blue Button 2.0 API which will help individual patients and healthcare organisations to access and monitor health information in one place.
How to connect to the Blue Button 2.0 API
Let’s look at how to connect to the Blue Button 2.0 API using the SMART client that we discussed in a previous blog. There are 2 things we need to do:
- As an app developer, we need to register our app (in this case the SMART client) to Blue Button2.0 (BB2).
- As a user of the app, we need to register ourselves with BB2 so we can access our own data.
In this blog, we’ll only concern ourselves with registering the app, as there are test logins available. The first thing we need to do is to create a developer account on the BB2 sandbox here.
Once you have an account, you’ll need to register your application. There’s a button on the site and you’ll need to supply the following details:
- Name of the application – ‘myBBapp’ sounds elegant.
- Client type – choose ‘confidential’ – this means we can save a secret and it uses the ‘authorisation code’ grant type that SMART uses.
- Grant type – choose ‘authorisation code’.
- Redirect URIs – assuming you’re using the SMART client that will be https://clinfhir.com/callback.
You can ignore the other fields then check the agreement to the service agreement and save. Once you’ve done that, you get a number of elements provided, of which you’re going to need a couple in particular:
- The client id – uniquely identifies the app (not the user of the app) to BB2 – technically the OAuth server in BB2.
- The secret – because you said that you could keep one when you registered.
Now you’re ready to load these details into the SMART client.
Load the client here, click the ‘Edit Server list’ to the upper right and then click ‘Add’ above the list of servers to add a new one. Here’s the screen you’ll get: