FHIR_README.md
๐ Complete FHIR documentation has moved to Documentation/api/FHIR_API.md
OpenEMR provides a comprehensive FHIR R4 implementation compliant with US Core 8.0 and SMART on FHIR v2.2.0.
Administration โ Config โ Connectors
Replace default with your multi-site tenant if applicable see (Multi-Tenancy Guide):
https://localhost:9300/apis/default/fhir
curl -X GET 'https://localhost:9300/apis/default/fhir/metadata'
No authentication required for capability statement
# Get access token (see Authentication Guide)
# Then make FHIR requests:
curl -X GET 'https://localhost:9300/apis/default/fhir/Patient' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Accept: application/fhir+json'
| Standard | Version | Status |
|---|---|---|
| FHIR | R4 (4.0.1) | โ Full Support |
| US Core | 8.0 | โ Compliant |
| SMART on FHIR | v2.2.0 | โ Certified |
| Bulk Data | v1.0 | โ Implemented |
| USCDI | v1 | โ Supported |
curl -X GET 'https://localhost:9300/apis/default/fhir/Patient/123' \
-H 'Authorization: Bearer TOKEN'
curl -X GET 'https://localhost:9300/apis/default/fhir/Observation?patient=123&category=vital-signs' \
-H 'Authorization: Bearer TOKEN'
curl -X POST 'https://localhost:9300/apis/default/fhir/DocumentReference/$docref' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/fhir+json' \
--data '{"resourceType":"Parameters","parameter":[{"name":"patient","valueId":"123"}]}'
curl -X GET 'https://localhost:9300/apis/default/fhir/Patient/$export' \
-H 'Authorization: Bearer TOKEN' \
-H 'Prefer: respond-async'
curl -X POST 'https://localhost:9300/oauth2/default/registration' \
-H 'Content-Type: application/json' \
--data '{"client_name":"My SMART App","scope":"openid launch patient/Patient.rs"}'
AllergyIntolerance, Appointment, Binary, CarePlan, CareTeam, Condition, Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location, Medication, MedicationRequest, MedicationDispense โจ, Observation, Organization, Patient, Person, Practitioner, PractitionerRole, Procedure, Provenance, RelatedPerson โจ, ServiceRequest โจ, Specimen โจ
All patient resources plus: Group, Bulk Export operations
# All medications for a patient
GET /fhir/MedicationRequest?patient=123
# Active problems
GET /fhir/Condition?patient=123&clinical-status=active
# Recent encounters
GET /fhir/Encounter?patient=123&date=ge2024-01-01
# Vital signs only
GET /fhir/Observation?patient=123&category=vital-signs
# Lab results only
GET /fhir/Observation?patient=123&category=laboratory
# Problem list items
GET /fhir/Condition?patient=123&category=problem-list-item
# Observations since January 2024
GET /fhir/Observation?patient=123&date=ge2024-01-01
# Encounters in Q1 2024
GET /fhir/Encounter?patient=123&date=ge2024-01-01&date=le2024-03-31
<context>/<Resource>.<permissions>
Examples:
patient/Patient.rs # Patient: read + search
user/Observation.cruds # User: full access
system/Patient.$export # System: bulk export
c - Creater - Readu - Updated - Deletes - Searchpatient/ - Single patient's datauser/ - User's authorized data (multiple patients)system/ - Unrestricted access (backend services)Filter resources by category:
# Vital signs only
patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs
# Health concerns only
patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern
# Clinical notes only
patient/DocumentReference.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note
Export large datasets for analytics and population health:
# Export all data
GET /fhir/$export
# Export all patient compartment data
GET /fhir/Patient/$export
# Export data for specific patient group
GET /fhir/Group/1/$export
system/Patient.$export # For patient export
system/*.$bulkdata-status # Check export status
system/Binary.read # Download files
Content-Location URLโ Complete Bulk Export Guide
Generate Continuity of Care Documents on demand:
POST /fhir/DocumentReference/$docref
Parameters:
patient - Patient ID (required)start - Start date for filteringend - End date for filtering{
"resourceType": "Parameters",
"parameter": [
{"name": "patient", "valueId": "123"},
{"name": "start", "valueDate": "2024-01-01"},
{"name": "end", "valueDate": "2024-12-31"}
]
}
Returns DocumentReference with link to download CCD XML file.
โ CCD Tutorial with Screenshots
EHR Launch - App launched from within OpenEMR:
1. User clicks app in OpenEMR
2. App receives launch token
3. App requests authorization with launch token
4. App receives patient + encounter context
Standalone Launch - App launched independently:
1. User opens app
2. App requests authorization
3. User logs in and approves
4. App receives access token
Patient Context:
{
"patient": "123"
}
Encounter Context: โจ NEW
{
"patient": "123",
"encounter": "456"
}
User Context:
{
"fhirUser": "Practitioner/789"
}
Interactive API testing:
https://your-openemr-install/swagger/
Test against live OpenEMR instances:
Discover server capabilities:
curl https://localhost:9300/apis/default/fhir/metadata
Discover SMART capabilities:
curl https://localhost:9300/apis/default/fhir/.well-known/smart-configuration
โ Patients, Practitioners, Organizations โ Observations, Vital Signs, Lab Results โ Conditions, Problems, Diagnoses โ Medications, Prescriptions, Dispensing โ Procedures, Immunizations, Allergies
โ Encounters, Appointments โ Care Plans, Care Teams, Goals โ Service Requests, Specimens โ Documents, CCD Generation
โ Coverage, Related Persons โ Locations, Devices โ Provenance, Audit
โ OAuth 2.0 / OpenID Connect โ Granular scope-based access control โ PKCE for public applications โ Token introspection โ Asymmetric client authentication (JWKS) โ TLS/HTTPS required
โ HIPAA - Protected health information โ ONC Cures - Information blocking prevention โ US Core 8.0 - US healthcare requirements โ FHIR R4 - HL7 standard compliance
โ JavaScript Examples โ Python Examples โ cURL Examples
| Topic | Link |
|---|---|
| FHIR Resources | FHIR_API.md#supported-resources |
| Search Parameters | FHIR_API.md#search-parameters |
| FHIR Scopes | AUTHORIZATION.md#fhir-api-scopes |
| Authentication | AUTHENTICATION.md |
| SMART Apps | SMART_ON_FHIR.md |
| Bulk Export | FHIR_API.md#bulk-fhir-exports |
| CCD Generation | FHIR_API.md#documentreference-docref-operation |
FHIR Version: R4 (4.0.1) SMART Version: v2.2.0 US Core: 8.0
This documentation represents the collective knowledge and contributions of the OpenEMR open-source community. The content is based on:
The organization, structure, and presentation of this documentation was enhanced using Claude AI (Anthropic) to:
All technical accuracy is maintained from the original community-authored documentation.
OpenEMR is an open-source project. To contribute to this documentation:
Last Updated: November 2025 License: GPL v3
For complete documentation, see Documentation/api/