FHIR API Documentation
Technical documentation for the certified API (45 CFR 170.315(g)(10)) of BUAMS AI™ 1.0, published by Inspire Consulting, LLC. Public: no account, login or other step is needed to read it.
1. Overview and standards
| Standard | Version |
|---|---|
| HL7 FHIR | R4 (4.0.1) |
| US Core Implementation Guide / USCDI | US Core 6.1.0 / USCDI v3 |
| SMART App Launch | 2.0.0 (also accepts SMART v1 .read scopes) |
| FHIR Bulk Data Access | 1.0.1 |
| OpenID Connect Core | 1.0 (ID token signed RS256) |
| OAuth 2.0 token revocation / introspection | RFC 7009 / RFC 7662 |
The API offers single-patient access (SMART App Launch, for patient-facing and provider-facing apps) and multi-patient access (SMART Backend Services + Bulk Data). All responses are JSON. The live CapabilityStatement is at https://buams.ai/fhir/r4/metadata.
2. Endpoints and service base URLs
Each practice (tenant) has its own FHIR service base URL on its own host, of the form https://{practice}.buams.ai/fhir/r4. The full list of service base URLs, in FHIR Endpoint and Organization format, is published at https://buams.ai/certification/service-base-urls. The endpoints below are shown for this host; on a practice host, use that host.
| Service | Method | URL |
|---|---|---|
| FHIR service base | — | https://buams.ai/fhir/r4 |
| CapabilityStatement | GET | https://buams.ai/fhir/r4/metadata |
| SMART configuration | GET | https://buams.ai/fhir/r4/.well-known/smart-configuration |
| OpenID configuration | GET | https://buams.ai/.well-known/openid-configuration |
| Authorization endpoint | GET, POST | https://buams.ai/oauth/authorize |
| Token endpoint | POST | https://buams.ai/oauth/token |
| Revocation endpoint | POST | https://buams.ai/oauth/revoke |
| Introspection endpoint | POST | https://buams.ai/oauth/introspect |
| Authorization-server JWK Set | GET | https://buams.ai/oauth/jwks |
3. Software components and configuration
An application needs the following to use the API:
- HTTPS with TLS 1.2 or newer. TLS 1.0 and 1.1 are refused. Plain HTTP is redirected or refused.
- An HTTP client that can send and receive JSON. Send
Accept: application/fhir+json(orapplication/json) on FHIR requests andContent-Type: application/x-www-form-urlencodedon OAuth requests. - An OAuth 2.0 / SMART App Launch client supporting the authorization-code grant with PKCE (S256). A browser (or embedded web view) is needed for the user to sign in and approve access.
- For confidential asymmetric clients and Bulk Data: an RSA (RS384) or EC (ES384) key pair. The public key is published at a TLS-protected JWKS URL registered with the developer, and the client signs a JWT client assertion (
private_key_jwt). - For Bulk Data: the ability to poll a status URL and to download newline-delimited JSON (
application/fhir+ndjson) files. - A registered client (section 4). No other software, SDK or library is required; any standards-conformant FHIR R4 / SMART client library may be used.
4. Application registration
Every application must be registered before it can request authorization. Registration is free, is not withheld on competitive grounds, and is open to any application developer. To register, email [email protected] with the details below. You receive a client_id (and, for symmetric confidential clients, a client_secret, delivered once through a secure channel).
| Attribute | Required | Notes |
|---|---|---|
| Application name | Yes | Shown to the user on the authorization screen. |
| Developer / organization and contact email | Yes | Used for security and service notices. |
| Application type | Yes | Single patient (SMART App Launch) or multiple patients (Backend Services / Bulk Data). |
| Client authentication | Yes | none (public client, PKCE only), client_secret_basic / client_secret_post (confidential symmetric), or private_key_jwt (confidential asymmetric). Multi-patient applications must use private_key_jwt. |
| Redirect URI(s) | Single patient: yes | Exact match is enforced. HTTPS is required except for native-app loopback / custom schemes. |
| Launch URL | For EHR launch | Where the EHR sends iss and launch. |
| JWKS URL | For private_key_jwt | A TLS-protected URL serving the client's public keys (RS384 or ES384). |
| Requested scopes | Yes | The maximum scopes the app may request (section 6). Requests for scopes outside this set are refused with invalid_scope. |
5. Authorization (SMART App Launch)
Discover the endpoints from https://buams.ai/fhir/r4/.well-known/smart-configuration. Two launch flows are supported:
- Standalone launch. The app starts the flow and requests
launch/patient. The patient signs in with their Patient Portal account and approves access to their own record. - EHR launch. A clinician opens the app from the patient chart. The EHR calls the launch URL with
iss(the practice's FHIR base URL) and an opaquelaunchvalue, which the app passes back with thelaunchscope.
Authorization request — GET or POST https://buams.ai/oauth/authorize
| Parameter | Type | Required | Description |
|---|---|---|---|
response_type | string | Yes | Always code. |
client_id | string | Yes | The registered client id. |
redirect_uri | URI | Yes | One of the registered redirect URIs, exactly. |
scope | string | Yes | Space-separated scopes (section 6). |
state | string | Yes | Opaque value returned unchanged; use it to prevent CSRF. |
aud | URI | Yes | The FHIR service base URL the token is for. |
code_challenge | string | Yes | Base64url SHA-256 of the code verifier. |
code_challenge_method | string | Yes | Always S256. |
launch | string | EHR launch | The value received on the launch URL. |
The user signs in (with multi-factor authentication where enabled), sees the application name and the requested access, may narrow the resources granted, and approves or denies. When offline_access is requested, the screen explains that the app may keep access while the user is not using it.
Response: a redirect to redirect_uri with code (single use, valid 5 minutes) and state, or with error (access_denied, invalid_request, invalid_scope, unauthorized_client) and state.
6. Scopes
| Scope | Grants |
|---|---|
launch, launch/patient | Patient context from an EHR launch, or a patient selected during a standalone launch. The token response then includes patient. |
openid fhirUser | An OpenID Connect id_token whose fhirUser claim identifies the signed-in user (a Patient or Practitioner URL). |
offline_access | A refresh token (valid 93 days, rotated on every use). |
patient/{Resource}.rs (v2) / patient/{Resource}.read (v1) | Read and search that resource type for the patient in context. patient/*.rs covers every type. |
user/{Resource}.rs / user/{Resource}.read | Resources the signed-in clinician is permitted to see. |
system/{Resource}.rs / system/{Resource}.read | Backend Services (no user). Required for Bulk Data. |
| Granular v2 scopes | A category restriction, e.g. patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory or patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern. Only matching resources are returned. |
Issued tokens carry only the scopes the user approved and the client registered. A token never grants more than was requested.
7. Token endpoint — POST https://buams.ai/oauth/token
Body: application/x-www-form-urlencoded. Confidential symmetric clients authenticate with HTTP Basic (client_secret_basic) or with client_id + client_secret in the body; asymmetric clients send client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer and a signed client_assertion (claims iss, sub = client id, aud = token URL, exp ≤ 5 minutes, unique jti).
| grant_type | Parameters | Used by |
|---|---|---|
authorization_code | code, redirect_uri, code_verifier, client_id (public clients) or client authentication | Single-patient apps |
refresh_token | refresh_token, optional scope (may narrow, never expand), client authentication for confidential clients | Apps granted offline_access |
client_credentials | scope (system/…), client_assertion_type, client_assertion | Backend Services / Bulk Data |
Successful response (HTTP 200, JSON)
| Field | Type | Description |
|---|---|---|
access_token | string | Opaque bearer token. Send as Authorization: Bearer {token}. |
token_type | string | Bearer |
expires_in | integer | Lifetime in seconds (3600). |
scope | string | The scopes actually granted. |
refresh_token | string | Only when offline_access was granted. |
id_token | string (JWT) | Only when openid was granted. Signed RS256; verify with the JWK Set. |
patient | string | Patient id in context, when a patient context exists. |
encounter | string | Encounter id, when launched from an encounter. |
need_patient_banner, smart_style_url | boolean, URI | EHR-launch display hints. |
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=SplxlOBe&redirect_uri=https%3A%2F%2Fapp.example%2Fcb&code_verifier=dBjftJeZ4CVP&client_id=my-app
HTTP/1.1 200 OK
{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 3600,
"scope": "launch/patient openid fhirUser offline_access patient/*.rs",
"patient": "123", "refresh_token": "8xLOxBtZp8", "id_token": "eyJ..." }
Errors (HTTP 400/401, JSON {"error", "error_description"}): invalid_request, invalid_client, invalid_grant (code or refresh token invalid, used, expired or revoked; redirect URI mismatch; PKCE failure), invalid_scope, unauthorized_client, unsupported_grant_type.
8. Token revocation and introspection
Revocation — POST https://buams.ai/oauth/revoke with token (an access or refresh token) and optional token_type_hint. Always answers HTTP 200. Revoking any token of a grant revokes the whole grant, and the app loses access immediately. Patients can also revoke an app themselves in the Patient Portal (Connected Apps), and clinic administrators can revoke at the patient's request.
Introspection — POST https://buams.ai/oauth/introspect with token. Returns {"active": true, "scope", "client_id", "token_type", "exp", "iat", "iss", "aud", "sub", "patient"} for a valid token, or {"active": false}. A request without token returns 400 invalid_request.
9. Making FHIR requests
| Interaction | Syntax | Returns |
|---|---|---|
| read | GET [base]/{Resource}/{id} | The resource (HTTP 200), or OperationOutcome 404. |
| search | GET [base]/{Resource}?{param}={value}&… | A Bundle of type: searchset with total and every match in entry[].resource. |
| search (POST) | POST [base]/{Resource}/_search with the parameters form-encoded in the body | Same as GET search. |
- Send
Authorization: Bearer {access_token}on every request exceptmetadataand the SMART configuration. - All supplied parameters must match (logical AND). For
status,intentandtype, comma-separated values match any of them (logical OR). - Token values may be
codeorsystem|code. Date values accept the prefixeseq ne gt lt ge le sa eb. _revinclude=Provenance:targetadds the Provenance of each match to the Bundle.- All matches are returned in one Bundle; there is no paging.
- With a
patient/scope, every search is limited to the patient in context, whateverpatientvalue is sent.
GET /fhir/r4/Observation?patient=123&category=laboratory&date=ge2024-01-01
Authorization: Bearer eyJ...
Accept: application/fhir+json
HTTP/1.1 200 OK
Content-Type: application/fhir+json
{ "resourceType": "Bundle", "type": "searchset", "total": 2,
"entry": [ { "fullUrl": "https://buams.ai/fhir/r4/Observation/lab-41",
"resource": { "resourceType": "Observation", "id": "lab-41", "status": "final", … },
"search": { "mode": "match" } } ] }
10. Resource reference
Each resource conforms to the US Core 6.1.0 profiles listed for it. The profile page defines every element returned (the return variables), its data type, cardinality and which elements are Must Support. Searches return Bundle (searchset); reads return the resource itself.
Group $export
Used only for population-level Bulk Data export — see section 12. GET [base]/Group/{id}/$export.
Patient read search $everything
Profiles (return structure):
- us-core-patient —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
Functions:
GET [base]/Patient/{id}— read one Patient; returns the Patient resource.GET [base]/Patient?…— search; returns a Bundle of Patient.POST [base]/Patient/_search— search with form-encoded parameters.GET [base]/Patient/{id}/$everything— see section 11.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
name | string | Any part of the name (full, given or family), matched case-insensitively. |
identifier | token (code, or system|code) | An identifier value, optionally system|value. |
birthdate | date (YYYY-MM-DD or dateTime) | Date of birth (YYYY-MM-DD). Accepts date prefixes. |
gender | token (code, or system|code) | Administrative gender: male, female, other, unknown. |
Scopes: patient/Patient.rs, user/Patient.rs, system/Patient.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Patient or the patient), 404 (no Patient with that id in this practice).
Practitioner read reference target
Profiles (return structure):
- us-core-practitioner —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
Functions:
GET [base]/Practitioner/{id}— read one Practitioner; returns the Practitioner resource.
Not searchable: it is returned so references from other resources (for example Observation.derivedFrom, performer, payor) can be resolved by read.
Scopes: patient/Practitioner.rs, user/Practitioner.rs, system/Practitioner.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Practitioner or the patient), 404 (no Practitioner with that id in this practice).
Condition read search
Profiles (return structure):
- us-core-condition-problems-health-concerns —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-problems-health-concerns - us-core-condition-encounter-diagnosis —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-encounter-diagnosis
Functions:
GET [base]/Condition/{id}— read one Condition; returns the Condition resource.GET [base]/Condition?…— search; returns a Bundle of Condition.POST [base]/Condition/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
category | token (code, or system|code) | A category code, optionally prefixed with its system: system|code. |
clinical-status | token (code, or system|code) | The clinical status code, e.g. active, resolved. |
Scopes: patient/Condition.rs, user/Condition.rs, system/Condition.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Condition or the patient), 404 (no Condition with that id in this practice).
AllergyIntolerance read search
Profiles (return structure):
- us-core-allergyintolerance —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
Functions:
GET [base]/AllergyIntolerance/{id}— read one AllergyIntolerance; returns the AllergyIntolerance resource.GET [base]/AllergyIntolerance?…— search; returns a Bundle of AllergyIntolerance.POST [base]/AllergyIntolerance/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
Scopes: patient/AllergyIntolerance.rs, user/AllergyIntolerance.rs, system/AllergyIntolerance.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover AllergyIntolerance or the patient), 404 (no AllergyIntolerance with that id in this practice).
MedicationRequest read search
Profiles (return structure):
- us-core-medicationrequest —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
Functions:
GET [base]/MedicationRequest/{id}— read one MedicationRequest; returns the MedicationRequest resource.GET [base]/MedicationRequest?…— search; returns a Bundle of MedicationRequest.POST [base]/MedicationRequest/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
intent | token (code, or system|code) | The order intent, e.g. order, plan. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/MedicationRequest.rs, user/MedicationRequest.rs, system/MedicationRequest.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover MedicationRequest or the patient), 404 (no MedicationRequest with that id in this practice).
Observation read search
Profiles (return structure):
- us-core-observation-screening-assessment —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-screening-assessment - us-core-observation-sdoh-assessment —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-sdoh-assessment - us-core-observation-lab —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab - us-core-blood-pressure —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-blood-pressure - us-core-bmi —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-bmi - us-core-head-circumference —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-head-circumference - us-core-body-height —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-height - us-core-body-weight —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-weight - us-core-body-temperature —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature - us-core-heart-rate —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate - pediatric-bmi-for-age —
http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age - head-occipital-frontal-circumference-percentile —
http://hl7.org/fhir/us/core/StructureDefinition/head-occipital-frontal-circumference-percentile - pediatric-weight-for-height —
http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height - us-core-pulse-oximetry —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry - us-core-respiratory-rate —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate - us-core-smokingstatus —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus - us-core-observation-clinical-result —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result - us-core-observation-occupation —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-occupation - us-core-observation-pregnancyintent —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-pregnancyintent - us-core-observation-pregnancystatus —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-pregnancystatus
Functions:
GET [base]/Observation/{id}— read one Observation; returns the Observation resource.GET [base]/Observation?…— search; returns a Bundle of Observation.POST [base]/Observation/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
category | token (code, or system|code) | A category code, optionally prefixed with its system: system|code. |
code | token (code, or system|code) | A clinical code (LOINC, SNOMED CT, CPT …), optionally system|code. |
Scopes: patient/Observation.rs, user/Observation.rs, system/Observation.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Observation or the patient), 404 (no Observation with that id in this practice).
Goal read search
Profiles (return structure):
- us-core-goal —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal
Functions:
GET [base]/Goal/{id}— read one Goal; returns the Goal resource.GET [base]/Goal?…— search; returns a Bundle of Goal.POST [base]/Goal/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
Scopes: patient/Goal.rs, user/Goal.rs, system/Goal.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Goal or the patient), 404 (no Goal with that id in this practice).
CarePlan read search
Profiles (return structure):
- us-core-careplan —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan
Functions:
GET [base]/CarePlan/{id}— read one CarePlan; returns the CarePlan resource.GET [base]/CarePlan?…— search; returns a Bundle of CarePlan.POST [base]/CarePlan/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
category | token (code, or system|code) | A category code, optionally prefixed with its system: system|code. |
Scopes: patient/CarePlan.rs, user/CarePlan.rs, system/CarePlan.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover CarePlan or the patient), 404 (no CarePlan with that id in this practice).
Encounter read search
Profiles (return structure):
- us-core-encounter —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter
Functions:
GET [base]/Encounter/{id}— read one Encounter; returns the Encounter resource.GET [base]/Encounter?…— search; returns a Bundle of Encounter.POST [base]/Encounter/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/Encounter.rs, user/Encounter.rs, system/Encounter.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Encounter or the patient), 404 (no Encounter with that id in this practice).
Coverage read search
Profiles (return structure):
- us-core-coverage —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-coverage
Functions:
GET [base]/Coverage/{id}— read one Coverage; returns the Coverage resource.GET [base]/Coverage?…— search; returns a Bundle of Coverage.POST [base]/Coverage/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/Coverage.rs, user/Coverage.rs, system/Coverage.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Coverage or the patient), 404 (no Coverage with that id in this practice).
MedicationDispense read search
Profiles (return structure):
- us-core-medicationdispense —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationdispense
Functions:
GET [base]/MedicationDispense/{id}— read one MedicationDispense; returns the MedicationDispense resource.GET [base]/MedicationDispense?…— search; returns a Bundle of MedicationDispense.POST [base]/MedicationDispense/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/MedicationDispense.rs, user/MedicationDispense.rs, system/MedicationDispense.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover MedicationDispense or the patient), 404 (no MedicationDispense with that id in this practice).
Device read search
Profiles (return structure):
- us-core-implantable-device —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device
Functions:
GET [base]/Device/{id}— read one Device; returns the Device resource.GET [base]/Device?…— search; returns a Bundle of Device.POST [base]/Device/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
type | token (code, or system|code) | The device type code, optionally system|code. |
Scopes: patient/Device.rs, user/Device.rs, system/Device.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Device or the patient), 404 (no Device with that id in this practice).
DocumentReference read search
Profiles (return structure):
- us-core-documentreference —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference
Functions:
GET [base]/DocumentReference/{id}— read one DocumentReference; returns the DocumentReference resource.GET [base]/DocumentReference?…— search; returns a Bundle of DocumentReference.POST [base]/DocumentReference/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
category | token (code, or system|code) | A category code, optionally prefixed with its system: system|code. |
Scopes: patient/DocumentReference.rs, user/DocumentReference.rs, system/DocumentReference.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover DocumentReference or the patient), 404 (no DocumentReference with that id in this practice).
Immunization read search
Profiles (return structure):
- us-core-immunization —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization
Functions:
GET [base]/Immunization/{id}— read one Immunization; returns the Immunization resource.GET [base]/Immunization?…— search; returns a Bundle of Immunization.POST [base]/Immunization/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/Immunization.rs, user/Immunization.rs, system/Immunization.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Immunization or the patient), 404 (no Immunization with that id in this practice).
Procedure read search
Profiles (return structure):
- us-core-procedure —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure
Functions:
GET [base]/Procedure/{id}— read one Procedure; returns the Procedure resource.GET [base]/Procedure?…— search; returns a Bundle of Procedure.POST [base]/Procedure/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
status | token (code, or system|code) | The resource status code, e.g. active, completed, final. Comma-separated values match any. |
Scopes: patient/Procedure.rs, user/Procedure.rs, system/Procedure.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Procedure or the patient), 404 (no Procedure with that id in this practice).
DiagnosticReport read search
Profiles (return structure):
- us-core-diagnosticreport-lab —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab - us-core-diagnosticreport-note —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note
Functions:
GET [base]/DiagnosticReport/{id}— read one DiagnosticReport; returns the DiagnosticReport resource.GET [base]/DiagnosticReport?…— search; returns a Bundle of DiagnosticReport.POST [base]/DiagnosticReport/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
category | token (code, or system|code) | A category code, optionally prefixed with its system: system|code. |
date | date (YYYY-MM-DD or dateTime) | The clinically relevant date. Accepts the prefixes eq ne gt lt ge le sa eb, e.g. date=ge2024-01-01. Repeat to bound a range. |
code | token (code, or system|code) | A clinical code (LOINC, SNOMED CT, CPT …), optionally system|code. |
Scopes: patient/DiagnosticReport.rs, user/DiagnosticReport.rs, system/DiagnosticReport.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover DiagnosticReport or the patient), 404 (no DiagnosticReport with that id in this practice).
ServiceRequest read search
Profiles (return structure):
- us-core-servicerequest —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-servicerequest
Functions:
GET [base]/ServiceRequest/{id}— read one ServiceRequest; returns the ServiceRequest resource.GET [base]/ServiceRequest?…— search; returns a Bundle of ServiceRequest.POST [base]/ServiceRequest/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
Scopes: patient/ServiceRequest.rs, user/ServiceRequest.rs, system/ServiceRequest.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover ServiceRequest or the patient), 404 (no ServiceRequest with that id in this practice).
CareTeam read search
Profiles (return structure):
- us-core-careteam —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam
Functions:
GET [base]/CareTeam/{id}— read one CareTeam; returns the CareTeam resource.GET [base]/CareTeam?…— search; returns a Bundle of CareTeam.POST [base]/CareTeam/_search— search with form-encoded parameters.
Search parameters:
| Name | Data type | Description |
|---|---|---|
_id | token (code, or system|code) | The logical id of the resource. Example: _id=123. |
patient | reference (Type/id) | The patient the resource is about, as Patient/{id} or {id}. |
Scopes: patient/CareTeam.rs, user/CareTeam.rs, system/CareTeam.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover CareTeam or the patient), 404 (no CareTeam with that id in this practice).
Organization
Profiles (return structure):
- us-core-organization —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization
Functions:
Scopes: patient/Organization.rs, user/Organization.rs, system/Organization.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Organization or the patient), 404 (no Organization with that id in this practice).
Provenance read reference target
Profiles (return structure):
- us-core-provenance —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance
Functions:
GET [base]/Provenance/{id}— read one Provenance; returns the Provenance resource.
Not searchable: it is returned so references from other resources (for example Observation.derivedFrom, performer, payor) can be resolved by read.
Scopes: patient/Provenance.rs, user/Provenance.rs, system/Provenance.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Provenance or the patient), 404 (no Provenance with that id in this practice).
RelatedPerson read reference target
Profiles (return structure):
- us-core-relatedperson —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-relatedperson
Functions:
GET [base]/RelatedPerson/{id}— read one RelatedPerson; returns the RelatedPerson resource.
Not searchable: it is returned so references from other resources (for example Observation.derivedFrom, performer, payor) can be resolved by read.
Scopes: patient/RelatedPerson.rs, user/RelatedPerson.rs, system/RelatedPerson.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover RelatedPerson or the patient), 404 (no RelatedPerson with that id in this practice).
Specimen read reference target
Profiles (return structure):
- us-core-specimen —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-specimen
Functions:
GET [base]/Specimen/{id}— read one Specimen; returns the Specimen resource.
Not searchable: it is returned so references from other resources (for example Observation.derivedFrom, performer, payor) can be resolved by read.
Scopes: patient/Specimen.rs, user/Specimen.rs, system/Specimen.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover Specimen or the patient), 404 (no Specimen with that id in this practice).
QuestionnaireResponse read reference target
Profiles (return structure):
- us-core-questionnaireresponse —
http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse
Functions:
GET [base]/QuestionnaireResponse/{id}— read one QuestionnaireResponse; returns the QuestionnaireResponse resource.
Not searchable: it is returned so references from other resources (for example Observation.derivedFrom, performer, payor) can be resolved by read.
Scopes: patient/QuestionnaireResponse.rs, user/QuestionnaireResponse.rs, system/QuestionnaireResponse.rs (or the v1 .read equivalents).
Errors: 401 (missing/invalid token), 403 (scope does not cover QuestionnaireResponse or the patient), 404 (no QuestionnaireResponse with that id in this practice).
11. Patient $everything
GET [base]/Patient/{id}/$everything returns a Bundle (searchset) containing the Patient and every resource the token's scopes allow for that patient. No parameters. Errors as for read.
12. Bulk data export (population services)
For registered multi-patient clients using SMART Backend Services. Get an access token with grant_type=client_credentials, a private_key_jwt client assertion and a system/ scope (section 7).
Kick-off — GET [base]/Group/{groupId}/$export
| Header / parameter | Type | Required | Description |
|---|---|---|---|
Authorization | header | Yes | Bearer {token} carrying a system/ read scope. |
Accept | header | Yes | application/fhir+json |
Prefer | header | Yes | respond-async |
_outputFormat | string | No | application/fhir+ndjson (default; also application/ndjson, ndjson). Other formats return 400. |
_type | string | No | Comma-separated resource types to export, e.g. Patient,Condition. Default: every exported resource type. A malformed value returns 400. |
_since | instant | — | Not supported in this version; the export returns the current content of the Group. |
Response: 202 Accepted with an empty body and a Content-Location header holding the status URL. Errors: 400 (bad _type or format), 401, 403 (no system/ read scope), 404 (unknown Group).
Status — GET [base]/bulk-status/{jobId}
While running: 202 Accepted. When complete: 200 OK with this JSON manifest.
| Field | Type | Description |
|---|---|---|
transactionTime | instant | When the export's data snapshot was taken. |
request | URI | The kick-off request URL. |
requiresAccessToken | boolean | Always true: send the bearer token when downloading. |
output[] | array of {type, url} | One NDJSON file per resource type. |
error[] | array | OperationOutcome files for errors (empty when there are none). |
Cancel: DELETE [base]/bulk-status/{jobId} → 202. Download: GET [base]/bulk-files/{jobId}/{Resource}.ndjson with the bearer token → 200, application/fhir+ndjson, one resource per line. A job is visible only to the client that started it; other clients get 404.
13. Errors and exception handling
FHIR errors return an OperationOutcome (issue[].severity, issue[].code, issue[].diagnostics) with these HTTP status codes:
| HTTP | issue.code | When | What the client should do |
|---|---|---|---|
| 400 | invalid, required, not-supported | Malformed request, missing required parameter, unsupported format. | Fix the request; do not retry unchanged. |
| 401 | security | Missing, expired or revoked access token. A WWW-Authenticate: Bearer header is returned. | Refresh the token or re-authorize. |
| 403 | forbidden | The token's scopes do not cover the resource type or patient. | Request the needed scope. |
| 404 | not-found | No such resource in this practice, or not visible to this client. | Check the id. |
| 426 | — | The connection used TLS older than 1.2, or plain HTTP. | Use HTTPS with TLS 1.2+. |
| 500 / 503 | exception | Unexpected server error or maintenance. | Retry with exponential back-off. |
OAuth endpoints return RFC 6749 errors as JSON (error, error_description); see sections 5 and 7.
14. Developer attestations
Refresh tokens. The module issues refresh tokens to native applications when offline_access is granted. Each refresh token is valid for 93 days unless revoked, which is never shorter than three calendar months. When a valid refresh token is supplied, the module rotates it and issues a new one valid for a new 93-day period without requiring re-authentication or re-authorization. A refresh request may narrow, but cannot expand, the original grant.
JWK Set caching. Client JWK Sets retrieved from registered TLS-protected URLs are not cached; the module retrieves the JWK Set when it validates each client assertion.
Transport security. All SMART, OAuth, discovery and FHIR routes require HTTPS. TLS 1.0 and 1.1 are rejected.
Fees. No fee is charged to patients, their apps, or app developers for registration or for using this API. See Certification and Costs.
15. API terms of use
- The API may be used by any registered application to access electronic health information with the authorization of the patient, or of a user permitted to access that information.
- Applications must keep client secrets and private keys confidential, must request only the scopes they need, and must honour revocation.
- Applications must not attempt to access data outside their authorization, degrade the service, or circumvent its security controls. Abusive traffic may be rate-limited.
- No fee is charged for registration or use of the API, and registration is not refused on competitive grounds.
- Questions and security reports: [email protected].
This page is generated from the live CapabilityStatement and route table, so the resource reference always matches the deployed API.