Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.athelas.com/llms.txt

Use this file to discover all available pages before exploring further.

The Commure EHR FHIR API is a FHIR R4B server that exposes patient health data from Air to authorized third-party applications. It is compliant with US Core 6.1.0 profiles and the ONC (g)(10) Standardized API certification criteria (§170.315(g)(10)). All responses are returned in application/fhir+json format.
Service Base URL: https://onc.api.staging-ehr.athelas.comFHIR Version: R4B (4.0.1)  ·  US Core Version: 6.1.0  ·  Content Type: application/fhir+json

SMART on FHIR Configuration

The server publishes its SMART configuration discovery document at:
GET https://onc.api.staging-ehr.athelas.com/.well-known/smart-configuration
This returns the discovery document with all authorization and token endpoint URLs, supported scopes, and capabilities. The FHIR CapabilityStatement, which lists every supported resource and interaction, is available at:
GET https://onc.api.staging-ehr.athelas.com/metadata

SMART Endpoint Reference

EndpointURL
Authorizationhttps://onc.api.staging-ehr.athelas.com/authorize
Tokenhttps://onc.api.staging-ehr.athelas.com/token
Introspectionhttps://onc.api.staging-ehr.athelas.com/introspect
Revocationhttps://onc.api.staging-ehr.athelas.com/revoke
JWKS URIhttps://cognito-idp.us-east-2.amazonaws.com/us-east-2_KudjXF579/.well-known/jwks.json
Issuerhttps://cognito-idp.us-east-2.amazonaws.com/us-east-2_KudjXF579
SMART Stylehttps://onc.api.staging-ehr.athelas.com/smart-style.json

App Registration

Client applications must be registered in AWS Cognito before they can obtain tokens. Registration provides the application with a client_id and (for confidential clients) a client_secret.
Self-serve registration is planned for a future release. To register a new application today, contact Commure (d/b/a Athelas).
When registering, provide:
  • Organization name and contact
  • Description of the application and which FHIR resources / scopes are needed
  • Whether the app is patient-facing or provider-facing
  • Client type: public (no secret, uses PKCE) or confidential (has secret)
  • Redirect URI
  • SMART Launch URI (if applicable)
Upon approval, you will receive:
  • client_id — used in all OAuth flows
  • client_secret — for confidential clients only

Authorization

The server implements SMART on FHIR v2 (§170.215(a)(3)) using AWS Cognito as the identity provider.

Supported Grant Types

  • authorization_code — Standalone and EHR launch (patient and provider apps)
  • client_credentials — Backend Services Authorization (bulk data, system-level access)
  • refresh_token — Token refresh for offline access

Token Authentication Methods

MethodUse for
nonePublic apps (PKCE required)
client_secret_postConfidential apps, secret in POST body
client_secret_basicConfidential apps, secret in Authorization header
private_key_jwtAsymmetric client auth for Backend Services

SMART Standalone Launch Flow

  1. App redirects the user to GET /authorize with response_type=code, client_id, redirect_uri, scope, state, aud, and PKCE code_challenge.
  2. The server presents a consent page where the user selects which scopes to grant.
  3. After consent, the server redirects to the app’s redirect_uri with an authorization code.
  4. App exchanges the code via POST /token to receive access_token, id_token, and optionally refresh_token.
  5. App includes the access token as Authorization: Bearer <token> on all FHIR API requests.

EHR Launch Flow

  1. EHR initiates launch via GET /launch/{patient_id}?app_launch_url=<url> (optionally with encounter_id). This redirects to the app’s launch URL with a launch parameter.
  2. App redirects to GET /authorize including the launch parameter in addition to the standard OAuth params.
  3. The rest of the flow follows the standalone flow. The resulting token includes patient and optionally encounter launch context claims.

Backend Services Authorization (Bulk Data)

For system-level access (e.g., bulk export):
  1. App generates a signed JWT (client_assertion) using its private key registered with Cognito.
  2. App calls POST /token with:
    • grant_type=client_credentials
    • client_assertion=<signed_jwt>
    • client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
    • scope=system/*.*
  3. The server returns a bearer access token valid for system-level operations.

Token Introspection

POST /introspect
Validates an access token and returns its claims. Request body (form-encoded): token=<access_token>

Token Revocation

POST /revoke
Revokes an access or refresh token. Request body (form-encoded): token=<token>, client_id=<client_id>, optionally client_secret, token_type_hint.

Token Refresh

Include grant_type=refresh_token and refresh_token=<token> in the POST /token body. Note: Refresh tokens are issued only when the offline_access scope is granted. Tokens issued to confidential clients are valid for a minimum of 3 months.

Scopes

The server supports SMART v2 granular scopes. All resource scopes use the .rs (read-search) action.

Context Scopes

ScopePurpose
openidOpenID Connect
profileUser profile
fhirUserResolves the current user as a FHIR resource
offline_accessIssue a refresh token
launchEHR launch context

Patient-Level Resource Scopes

ScopeResource Access Granted
patient/AllergyIntolerance.rsAllergy and intolerance records
patient/CarePlan.rsCare plans
patient/CareTeam.rsCare team members
patient/Condition.rsAll conditions (problems, diagnoses, health concerns)
patient/Coverage.rsInsurance coverage
patient/Device.rsImplantable devices
patient/DiagnosticReport.rsDiagnostic reports (lab, notes)
patient/DocumentReference.rsClinical documents and chart notes
patient/Encounter.rsEncounters and visits
patient/Goal.rsHealth goals
patient/Immunization.rsImmunization records
patient/Location.rsPractice locations
patient/MedicationDispense.rsMedication dispense records
patient/MedicationRequest.rsMedication requests and prescriptions
patient/Observation.rsAll observations (vitals, labs, surveys, SDOH)
patient/Organization.rsOrganizations
patient/Patient.rsPatient demographics
patient/Practitioner.rsPractitioners
patient/PractitionerRole.rsPractitioner roles
patient/Procedure.rsProcedures
patient/Provenance.rsProvenance records
patient/RelatedPerson.rsRelated persons (family, guardians)
patient/ServiceRequest.rsService and referral requests
patient/Specimen.rsSpecimens

Granular Scopes

For Condition and Observation, category-level granular scopes are supported:
patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis
patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item
patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern

patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs
patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory
patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history
patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey
patient/Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh
If a granular scope is granted, the server restricts search results to only that category. For example, a token with patient/Condition.rs?category=encounter-diagnosis cannot read problem-list or health-concern conditions.

USCDI v1 → FHIR Resource Mapping

USCDI Data ElementUS Core ProfileFHIR Resource
Patient DemographicsUS Core Patient ProfilePatient
Assessment and Plan of TreatmentUS Core CarePlan ProfileCarePlan
Care Team MembersUS Core CareTeam ProfileCareTeam
Clinical Notes (Consultation, Discharge, Progress)US Core DocumentReference ProfileDocumentReference
Goals: Patient GoalsUS Core Goal ProfileGoal
Health ConcernsUS Core Condition ProfileCondition
ImmunizationsUS Core Immunization ProfileImmunization
Lab Tests and ResultsUS Core Lab Result Observation Profile, US Core DiagnosticReport for LabObservation, DiagnosticReport
MedicationsUS Core MedicationRequest ProfileMedicationRequest, MedicationDispense
Medication AllergiesUS Core AllergyIntolerance ProfileAllergyIntolerance
ProblemsUS Core Condition ProfileCondition
ProceduresUS Core Procedure ProfileProcedure
ProvenanceUS Core Provenance ProfileProvenance
Smoking StatusUS Core Smoking Status Observation ProfileObservation
Unique Device Identifiers (Implantable)US Core Implantable Device ProfileDevice
Vital SignsFHIR Core Vital Signs Profiles, US Core Pulse OximetryObservation
EncountersUS Core Encounter ProfileEncounter
Insurance CoverageUS Core Coverage ProfileCoverage
Service Requests / ReferralsUS Core ServiceRequest ProfileServiceRequest
SpecimensUS Core Specimen ProfileSpecimen
Related PersonsUS Core RelatedPerson ProfileRelatedPerson

Resource Endpoints

All resource endpoints require a valid Bearer token with the appropriate scope. Searches return a FHIR Bundle of type searchset; single-resource reads return the resource directly.
Date parameters support FHIR comparator prefixes: eq, ne, gt, lt, ge, le.All search endpoints support both GET (query parameters) and POST /_search (form-encoded body) forms.

Patient

Required scope: patient/Patient.rs
InteractionEndpoint
ReadGET /Patient/{id}
Search (GET)GET /Patient
Search (POST)POST /Patient/_search
Search Parameters: _id, identifier, name, birthdate, gender, _count (default 50, max 200), _revinclude Supported combination searches: birthdate + name, gender + name

AllergyIntolerance

Required scope: patient/AllergyIntolerance.rs
InteractionEndpoint
ReadGET /AllergyIntolerance/{id}
Search (GET)GET /AllergyIntolerance
Search (POST)POST /AllergyIntolerance/_search
Search Parameters: _id, patient, clinical-status, _count, _revinclude

CarePlan

Required scope: patient/CarePlan.rs
InteractionEndpoint
ReadGET /CarePlan/{id}
Search (GET)GET /CarePlan
Search (POST)POST /CarePlan/_search
Search Parameters: _id, patient, category, identifier, _count, _revinclude

CareTeam

Required scope: patient/CareTeam.rs
InteractionEndpoint
ReadGET /CareTeam/{id}
Search (GET)GET /CareTeam
Search (POST)POST /CareTeam/_search
Search Parameters: patient, status, _include, _revinclude

Condition

Required scope: patient/Condition.rs (or a granular category scope)
Granular scopes are enforced. If the token only has patient/Condition.rs?category=encounter-diagnosis, results are restricted to that category.
InteractionEndpoint
ReadGET /Condition/{id}
Search (GET)GET /Condition
Search (POST)POST /Condition/_search
Search Parameters: _id, patient, category, clinical-status, code, identifier, _count, _revinclude

Coverage

Required scope: patient/Coverage.rs
InteractionEndpoint
ReadGET /Coverage/{id}
Search (GET)GET /Coverage
Search (POST)POST /Coverage/_search
Search Parameters: _id, patient, identifier, _count, _revinclude

Device

Required scope: patient/Device.rs
InteractionEndpoint
ReadGET /Device/{id}
Search (GET)GET /Device
Search (POST)POST /Device/_search
Search Parameters: _id, patient, type, _count, _revinclude

DiagnosticReport

Required scope: patient/DiagnosticReport.rs
InteractionEndpoint
ReadGET /DiagnosticReport/{id}
Search (GET)GET /DiagnosticReport
Search (POST)POST /DiagnosticReport/_search
Search Parameters: _id, patient, category, type, code, status, date, _count, _revinclude

DocumentReference

Required scope: patient/DocumentReference.rs Covers clinical documents and chart notes (consultation notes, progress notes, discharge summaries, etc.).
InteractionEndpoint
ReadGET /DocumentReference/{id}
Search (GET)GET /DocumentReference
Search (POST)POST /DocumentReference/_search
Search Parameters: _id, patient, category, type, status, date, _count, _revinclude

Encounter

Required scope: patient/Encounter.rs
InteractionEndpoint
ReadGET /Encounter/{id}
Search (GET)GET /Encounter
Search (POST)POST /Encounter/_search
Search Parameters: _id, patient, date, identifier, _count, _revinclude

Goal

Required scope: patient/Goal.rs
InteractionEndpoint
ReadGET /Goal/{id}
Search (GET)GET /Goal
Search (POST)POST /Goal/_search
Search Parameters: _id, patient, lifecycle-status, target-date, _count, _revinclude

Immunization

Required scope: patient/Immunization.rs
InteractionEndpoint
ReadGET /Immunization/{id}
Search (GET)GET /Immunization
Search (POST)POST /Immunization/_search
Search Parameters: _id, patient, date, status, vaccine-code, lot-number, manufacturer, identifier, _count, _revinclude

Location

Required scope: patient/Location.rs
InteractionEndpoint
Search (GET)GET /Location

MedicationDispense

Required scope: patient/MedicationDispense.rs
InteractionEndpoint
ReadGET /MedicationDispense/{id}
Search (GET)GET /MedicationDispense
Search (POST)POST /MedicationDispense/_search
Search Parameters: _id, patient, whenhandedover, status, medication, identifier, _count, _revinclude

MedicationRequest

Required scope: patient/MedicationRequest.rs
InteractionEndpoint
ReadGET /MedicationRequest/{id}
Search (GET)GET /MedicationRequest
Search (POST)POST /MedicationRequest/_search
Search Parameters: _id, patient, authoredon, status, intent, encounter, medication, identifier, _count, _revinclude

Observation

Required scope: patient/Observation.rs (or a granular category scope)
Granular scopes are enforced. If the token only has patient/Observation.rs?category=vital-signs, results are filtered to vital-signs observations only.
InteractionEndpoint
ReadGET /Observation/{id}
Search (GET)GET /Observation
Search (POST)POST /Observation/_search
Search Parameters: _id, patient, category, code, date, _count, _revinclude Supported category values:
http://terminology.hl7.org/CodeSystem/observation-category|vital-signs
http://terminology.hl7.org/CodeSystem/observation-category|laboratory
http://terminology.hl7.org/CodeSystem/observation-category|social-history
http://terminology.hl7.org/CodeSystem/observation-category|survey
http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh

Organization

Required scope: patient/Organization.rs
InteractionEndpoint
ReadGET /Organization/{id}
Search (GET)GET /Organization

Practitioner

Required scope: patient/Practitioner.rs
InteractionEndpoint
ReadGET /Practitioner/{id}
Search (GET)GET /Practitioner
Search Parameters: _id, name, family, given, telecom, address, address-city, address-state, address-postalcode, identifier, _count

Procedure

Required scope: patient/Procedure.rs
InteractionEndpoint
ReadGET /Procedure/{id}
Search (GET)GET /Procedure
Search (POST)POST /Procedure/_search
Search Parameters: _id, patient, date, code, status, category, performer, identifier, _count, _revinclude

Provenance

Required scope: valid Bearer token (JWT) Provenance resources are returned inline via _revinclude=Provenance:target on any resource search. They can also be read directly by ID.
InteractionEndpoint
ReadGET /Provenance/{id}
Note: To include Provenance in a search response, add _revinclude=Provenance:target to any resource search. Provenance entries appear in the Bundle with search.mode = include.

RelatedPerson

Required scope: patient/RelatedPerson.rs
InteractionEndpoint
ReadGET /RelatedPerson/{id}
Search (GET)GET /RelatedPerson
Search Parameters: _id, patient

ServiceRequest

Required scope: patient/ServiceRequest.rs
InteractionEndpoint
ReadGET /ServiceRequest/{id}
Search (GET)GET /ServiceRequest
Search (POST)POST /ServiceRequest/_search
Search Parameters: _id, patient, category, code, authored, status, intent, identifier, _count, _revinclude

Specimen

Required scope: patient/Specimen.rs
InteractionEndpoint
ReadGET /Specimen/{id}
Search (GET)GET /Specimen

Bulk Data API

The server implements the HL7 FHIR Bulk Data Access (Flat FHIR) v2.0 specification.

Export Endpoints

Export TypeEndpointDescription
Group ExportGET /Group/{group_id}/$exportExport data for all patients in a specific group
Patient ExportGET /Patient/$exportExport data for all patients the client has access to
System ExportGET /$exportSystem-level export of all resources
All export requests require the Prefer: respond-async header and a valid Bearer token. The server returns 202 Accepted with a Content-Location header pointing to the status endpoint.
Optional query parameters: _outputFormat, _since

Export Job Management

OperationEndpointDescription
Check StatusGET /bulk-status/{job_id}Poll job status; returns 202 while in progress, 200 with manifest when complete
Cancel JobDELETE /bulk-status/{job_id}Cancel an in-progress export job
Download FileGET /bulk_files/{filename}Download an exported NDJSON file
Status responses:
  • 202 Accepted with X-Progress header — job in progress
  • 200 OK with JSON manifest — job complete; manifest includes output[] URLs for each resource type
  • 500 with OperationOutcome — job failed
Exported files are in application/fhir+ndjson format, one resource per line.

Group Management

OperationEndpoint
List GroupsGET /Group
Read GroupGET /Group/{id}

Responses and Error Handling

Successful Responses

StatusMeaning
200 OKRequest succeeded; body contains FHIR resource or Bundle
202 AcceptedBulk export accepted; polling in progress

Error Responses

All error responses return a JSON body with a detail field (non-FHIR endpoints) or a FHIR OperationOutcome resource (bulk data endpoints).
StatusMeaning
400 Bad RequestInvalid request parameters or malformed token
401 UnauthorizedMissing or invalid Bearer token
403 ForbiddenToken valid but insufficient scope for the requested resource
404 Not FoundResource with the given ID does not exist
500 Internal Server ErrorUnexpected server error

Additional Notes

  • Read-only API: All resource interactions are read (search-type, read) only. Write operations are not supported.
  • Provenance via _revinclude: To retrieve Provenance alongside any resource, append _revinclude=Provenance:target to any search query.
  • FHIR Version: FHIR R4B (4.0.1)
  • US Core Version: 6.1.0
  • Content Type: All responses use application/fhir+json
  • Connections: TLS 1.2 or higher required; connections below 1.2 are rejected.

Service Base URL

The published Service Base URL directory (FHIR Endpoint Bundle) for the Commure EHR FHIR API is available at: https://onc.api.staging-ehr.athelas.com/onc/base.json