Claims (Blue Button) Synchronization with Health Cloud and Data Cloud
Setup
Prerequisites:
- Enable access to Salesforce Healthcare Industry APIs. Refer to the guide section here
- A connected application in the Salesforce with Client Credentials Flow enabled and following Custom OAuth Scopes. Refer to the guide section here
user_bundle_write,user_condition_write,user_encounter_write,user_medicationrequest_write,user_practitioner_read,user_practitioner_write,user_procedure_write
- A client application in the Payer system.
- (optional) PatientSyncJob__C custom object in Salesforce to track job status, history, and watermark.Entity Name: PatientSyncJob
Field Label | FIeld API Name | Type | Values | |
---|---|---|---|---|
PatientId | PatientId__c | Text(20) | ||
JobId | JobId__c | Text(50) | ||
StartTime | StartTime__c | Date/Time | ||
Status | Status__c | Picklist | New, InProgress, Completed, Failed, PartiallyCompleted | |
Summary | Summary__c | Long Text Area(32768) | ||
ClaimDataStatus | ClaimDataStatus__c | Picklist | New, InProgress, Completed, Failed, PartiallyCompleted | |
ClaimDataSummary | ClaimDataSummary__c | Long Text Area(32768) |
Data Cloud setup:
- Log in to your Salesforce DataCloud instance.
- Go to Setup and click Data Cloud Setup.
- Click on Ingestion API, and then click New.
- Name the ingestion API
BlueButtonClaim
. - Click SAVE.
- Upload the schema and save it.
- Click on the app launcher, and select Data cloud.
- Click Data Streams and click NEW.
- Select the Ingestion API box and click on Next.
- Select the Ingestion API name from the dropdown (this is the source API name you created in the previous steps), and then select the object names and click Next.
- Select each object one by one:
- For Category, select Profile.
- For Primary Key, select id.
- After all the objects and their fields have been selected, click Next.
- On the next page, verify the details like the Data stream name and object, and then click Deploy.
- Follow this link for setting up a connected app.
Setup:
- Log in to Salesforce and navigate to the Setup page.
- Search for the ‘Integrations Setup’ page.
- Select the Patient Summary - Blue Button Integration application and click the Enable button.
- Enter the application display name, target business group, and environment for deployment, then click Next.
- Enter all necessary configurations that are prompted.
- To add any optional configuration, Click Add Additional parameters and enter the required details. Refer below table for configuration details.
Application property name(Key name) | Sample value | Description | |
---|---|---|---|
1 | https.entryPath | /blue-button/v2/* | Sets the base url of the api. Replace/override as needed when deploying to any environment. Default value is "/blue-button/v2/*" |
2 | bluebuttonapi.host | bluebutton.cms.gov | Payer system API host name |
3 | hcOrg.tokenUrl | https://login.salesforce.com/services/oauth2/token | URL for generating Salesforce access token |
4 | hcOrg.client_id | - | Client Id to be used for generating Salesforce access token |
5 | hcOrg.client_secret | - | Client Secret to be used for generating Salesforce access token |
6 | hcOrg.instanceUrl | https://test.salesforce.com/ | Salesforce instance URL where patient data needs to be loaded |
7 | bundle.host | api.healthcloud.salesforce.com | Salesforce Healthcare API host name |
8 | bluebuttonapi.eobEndpoint.pageCount | 50 | Number of ExplanationOfBenefit records fetched per page.It should ideally be set to 50 to minimise the number of calls to Blue Button API. |
9 | bluebuttonIntegration.batchCount | 5 | Number Of ExplanationOfBenefit pages that are synchronized in parallel for a patient |
10 | bluebuttonIntegration.maxConcurrentSyncMessages | 50 | Maximum number of patient synchronization jobs that can be processed concurrently |
11 | bluebuttonapi.enablePagination | "true" | This flag is used to enable/disable pagination parameter. It is set to "true" by default, should be set to "false" for carin systems |
12 | bluebuttonapi.eobEndpoint.typeFilter | "false" | Flag to enable eob type filter. To be set to 'true' for CMS |
13 | bluebuttonapi.coverageEndpoint.queryParam | "beneficiary" | Query parameter to search for coverage details. It is set to "beneficiary" by default, needs to be updated based on payer system For E.g. set to "patient" in case of Cigna system |
14 | bluebuttonapi.coverageEndpoint.count | Any value between 1-50 | Maximum number of records fetched per page for coverage endpoint |
15 | bluebuttonapi.eobEndpoint.count | Any value between 1-50 | Maximum number of records fetched per page for EOB endpoint |
- Enter the following properties if claim data ingestion has to be enabled. By default, claim data flag will be disabled and will not be inserted in data cloud.
Application property name(Key name) | Sample value | Description | |
---|---|---|---|
1 | claimData.claimDataIngestion | "true" | To enable claim data ingestion into Data cloud. This can be also be sent in the payload. Flag value in the payload will have the precedence. |
2 | claimData.sourceAPI | BlueButtonClaim | Source API name in data cloud |
3 | claimData.cdpConfig.url | https://dsb0000013utp2ae-dev-ed.develop.test1.my.pc-rnd.salesforce.com | Url of the data cloud instance where claim data needs to be uploaded |
4 | claimData.cdpConfig.user | epic.ade7d4580256@salesforce.com | User id to connect to data cloud |
5 | claimData.cdpConfig.password | - | Password to connect to data cloud |
6 | claimData.cdpConfig.client_id | - | Client ID to connect to data cloud |
7 | claimData.cdpConfig.client_secret | - | Client Secret to connect to data cloud |
8 | claimCoverage.payor | "CMS" | Default value for organization name when organization reference is not resolved. Its defaiult value is "CMS", this need to be changed to respective payor system: like "CMS" for cms system and "CIGNA" for cigna system. |
- Click Proceed to deploy the application
Post-Deployment Steps:
Consumption of the Integration application
For consuming the blue button endpoints and consuming patient data, it is required to get consent that gives access to the patient’s clinical data that is present in the Explanation of Benefit(EOB) records returned by the Blue Button 2.0 API. The consumer needs to follow the following sequence of steps to get consent from each patient.
NOTE: https://sandbox.bluebutton.cms.gov has to be replaced with a production endpoint. i.e. https://bluebutton.cms.gov
Create a Connected App in Blue Button
- Login to the blue button portal.
- Click on ADD AN APPLICATION Button. Enter following details
- Application Name : Name of your choice
- OAuth - Client Type: Confidential
- Authorization Grant Type* Authorization code
- Callback URLs / Redirect URIs: The callback URL, that will redirect the authorization information after patient consent is done.
- Does your application need to collect beneficiary demographic information: Yes
- Agree to the terms and conditions and save the application.
- After completing the above step, it generates client_id/client_secret that will be used to generate the code.
Persisting the Consent
After the connected app is created from the patient portal, the patient must be redirected to the Blue Button OAuth flow to get the code
. This code is a kind of OTP to generate the refresh token.
1. Make sure that in your app, the patient is redirected to the following URL:
https://sandbox.bluebutton.cms.gov/v2/o/authorize/?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL
After the patient successfully authorizes with their credentials, the patient is then redirected to the
REDIRECT_URL
, where code is sent as a query parameter.{ "code": "IDzfq8os2EPZAYU67kfW8VkNUzmmBz", "state": "07MNrjGXGX6ZAjq3IL1AXcAxPSlpIU" }
Using this code, another request is sent that retrieves the refresh token, which is then saved in named credentials. This named credential reference will be saved against the patient.
POST /v2/o/token/ HTTP/1.1 Host: sandbox.bluebutton.cms.gov Content-Type: application/x-www-form-urlencoded client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&grant_type=authorization_code&code=<code>
The above request returns the following response upon successful authorization:
{ "access_token": "7PE2ocGbMCtDQpVuhNNEcic4tE8srO", "expires_in": 36000, "token_type": "Bearer", "scope": [ "patient/Coverage.read", "patient/ExplanationOfBenefit.read", "patient/Patient.read", "profile" ], "refresh_token": "jPHU2o1cwndiYIGjEpIt7FOZu6PO2g", "expires_at": 1690248292.6342547 }
The received
refresh_token
can be saved in named credentials.The generated
refresh_token
token can be used to generate the access_token and this access token can be used to trigger the Mulesoft endpoints.POST /v2/o/token/ HTTP/1.1 Host: sandbox.bluebutton.cms.gov Content-Type: application/x-www-form-urlencoded client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&grant_type=refresh_token&refresh_token=<refresh_token>
Along with the generation of an access_token, the above request also returns the new refresh_token that must be updated in the named credentials.
Triggering Mulesoft Endpoints
- Using the generated access token, the Mulesoft endpoints can be triggered as mentioned in the API documentation.