Skip to main content

Plasma Core

The Plasma Core API is provides your core access to healthcare data through a completely standard FHIR API. Build your applications to the Plasma Core API to ensure they meet the FHIR specifications.

FHIR API

FHIR API /api/plasma/fhir

This is the Plasma FHIR API. You can make standard FHIR queries to this API.

Headers

  • x-plasma-project-id (Optional): Used for backend apps
  • x-plasma-environment-id (Optional): Used for backend apps
  • x-plasma-state

Example

const headers = { "x-plasma-state": "your-state" };
const { idToken, fhirUser, error } = await fetch("https://plasma-base-url/api/plasma/fhir/Patient/123", {
{ method: 'GET', headers: headers }
});

SMART-on-FHIR API

Plasma App Launch /api/plasma/sof/launch

This API is used to launch an application for a patient- or clinician-facing workflow via the Plasma Launch. It will redirect the user to the login pages for the environment specified and will redirect back.

The advantages of using the Plasma Launch are that your app will go through the Plasma engine to make sure requests are submitted successfully. You will also have the advantage of having your configuration managed via Plasma.

Query Parameters

  • projectId: ID of the project
  • environmentId: ID of the environment
  • returnToUrl: (Optional) URL to redirect to after authenticating. If not specified, will default the one configured by the project
  • client_id: (Optional) Use this if you want and don't pass in projectId/environmentId
  • scope: (Optional) Use this if you want and don't pass in projectId/environmentId
  • iss: (Optional) Used for EHR launch
  • launch: (Optional) Used for EHR launch

Headers

  • None

Returns

Redirects to the returnToUrl with the following URL parameters:

  • patientId
  • encounterId
  • state

The state is important to track as it will be used as verification when making requests to the Plasma FHIR server.

Example

<a href="https://plasma-base-url/api/plasma/sof/launch?projectId=123&environmentId=456&returnToUrl=https%3A%2F%2Fexample.com%2Fmain">Launch App</a>

SMART-on-FHIR App Launch /api/plasma/sof/launch-smart

This API is used for launching an application for a patient- or clinician-facing workflow via the standard SMART-on-FHIR launch. You can use this to launch any normal SMART-on-FHIR application.

Query Parameters

  • aud: FHIR Server
  • client_id: Client ID
  • redirect_uri: (Optional) Redirect URL
  • scope: (Optional) Use this if you want and don't pass in projectId/environmentId
  • launch: (Optional) Used for EHR launch

Example

Try launching this URL in your browser:

https://plasma.smart-on-fhir.com/api/plasma/sof/launch-smart?aud=https%3A%2F%2Flaunch.smarthealthit.org%2Fv%2Fr4%2Fsim%2FWzMsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMV0%2Ffhir&client_id=abc&scope=openid+fhirUser+profile+offline_access+launch+launch%2Fpatient+patient%2F*.*+user%2F*.*&redirect_uri=https%3A%2F%2Fplasma.smart-on-fhir.com%2Ftoolkit%2Fsof-app-launcher%2Fapp

Backend Connect /api/plasma/sof/backend-connect

This API is used to connect to an environment via a backend workflow. You must specify the Project ID, Environment ID, and Project Secret. The API will return a state that can be used when making requests to the FHIR API.

Query Parameters

  • None

Headers

  • x-plasma-project-id
  • x-plasma-environment-id
  • x-plasma-project-secret

Returns

{
state?: string;
code?: string;
error?: string;
}

Example

const headers = {
"x-plasma-project-id": "123",
"x-plasma-environment-id": "456",
"x-plasma-project-secret": "your-project-secret"
}

const { state, code, error } = await fetch("https://plasma-base-url/api/plasma/sof/backend-connect", {
{ method: 'GET', headers: headers }
});