Skip to main content

Using the FHIR API

FHIR is one of the core standards of LifeOmic's LifeOmic Platform, and the FHIR API supports a variety of operations. To build against the LifeOmic Platform FHIR API, you need to understand some basic concepts of how the LifeOmic Platform structures and works with FHIR data. You also need to know where to find your project and account IDs. You can find this information in the sections below.

You can also consult the FHIR API Reference Documentation.

Service Base URLs

The FHIR specification defines its REST API relative to the "Service Base URL", sometimes referred to as [base] throughout the specification. The Service Base URL for the LifeOmic Platform depends on your account ID and the specification version. If your account id is testaccount and you are using the STU3 specification then the Service Base URL would be https://fhir.us.lifeomic.com/testaccount/dstu3.

If you are using JavaScript, the URL can be constructed like this:

const base = `https://fhir.us.lifeomic.com/${accountid}/dstu3`

To find your Account ID:

  1. From any page, click the logo at the top of the page.
  2. From the home page, click the Account Info tile.
  3. Copy the value from the Account ID field.

Authentication

Requests to the FHIR API need to use authorization in the same manner as requests to the Core API. Each request should include an Authorization header as explained on the Authentication page.

Resource tagging

Every FHIR resource must be associated with a project inside a LifeOmic Platform account. The association between resources and projects is maintained with tags on the FHIR resources.

To find your project's ID, open the project page in the LifeOmic Platform UI and look at the URL. The URL should look something like:

https://apps.us.lifeomic.com/phc/project/projects/project-id

The project-id segment will be UUID and with that, you should define resources with an additional meta.tag attribute, like this:

const resource = {
...resourceAttributes,

// This tag associates the resource with the specified project
meta: {
tag: [
{
system: 'http://lifeomic.com/fhir/dataset',
code: projectId
}
]
}
}

A full example Patient would look like like:

const patient = {
resourceType: 'Patient',

name: [
{
use: 'official',
family: 'Doe',
given: ['John']
}
]

meta: {
tag: [
{
system: 'http://lifeomic.com/fhir/dataset',
code: projectId
}
]
}
}
note

Resource tagging is required for all resource types, and if you attempt to create a resource without a meta.tag attribute, the resource creation will fail.