FHIR Subscriptions / Alerts

With 1upHealth, you can "subscribe" to a query using a FHIR Subscription Resource. This means that you can be notified for a creation or update event for any FHIR Resource that matches a FHIR query. You can make the FHIR query anything acceptable by FHRI APIs. Periodically (currently in 5 minute intervals), 1upHealth will check for any new or updated resources matching any FHIR Subscription for a user and post that data to a secure endpoint of your choice.

Here's how you create a FHIR Subscription

First launch an https:// endpoint on your own server at which you can receive POST requests from 1upHealth's servers. This must be a publicly accessible server, so something with localhost will not work. Also our server will only POST to an endpoint with https for security. You can optionally add a Bearer token for user level authentication to secure and indicate the request came from 1upHealth's servers.

After you've lunched your own service to accept responses, you can create a FHIR Subscription. The main parameters to choose are the endpoint, and query. You would post to the subscription endpoint with a request like this

curl -XPOST 'https://api.1up.health/fhir/dstu2/Subscription' \
  -H 'Authorization: Bearer access_token'

An example subscription FHIR resource looks like this:

{
  "resourceType": "Subscription",
  "id": "findjohns",
  "criteria": "Patient?name=john", // the FHIR query you want notifications on
  "contact": [
    {
      "system": "phone",
      "value": "ext 4123"
    }
  ],
  "reason": "Give me all the johns",
  "status": "requested",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://api.1up.health/subscription-test", // your server endpoint
    "payload": "application/json",
    "header": "Authorization: Bearer secret-token-abc-123" // any bearer token accepted for authentication
  }
}

After that resource has been created, any subsequent FHIR resources that are posted or imported into your server will generate a POST request to your endpoint url. Again, we only send to https and any endpoint with localhost will not be accepted. So you must test with a live url or service. We only support REST-hook subscriptions, so email or text is not currently enabled, but you can email us at support@1up.health if thats something you need. Until then, you can take the response to your server and trigger the text or email from there.

You can test this new Subscription out by creating a new Patient resource with the name john and see that the resource you created is posted to your server within the next 5 minutes!

The use cases for FHIR Subscriptions are enormous. Entire health system workflows can be managed by this process. You can build an IFTT (If this then that) type of services all triggered by FHIR subscriptions for alerts you want to send to patients or doctors. We're excited to see how Subscriptions are used!