📚 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
- ☑ Enable OpenEMR Standard FHIR REST API
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'- 📘 FHIR API Complete Guide - Full FHIR R4 reference
- ⚡ SMART on FHIR - App integration guide
- 🔐 Authentication - OAuth2 for FHIR
- 🔑 Scopes Reference - FHIR-specific scopes
- 📚 Main API Documentation - All APIs (FHIR, REST, Portal)
| 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
- ServiceRequest - Lab orders, imaging requests, referrals
- Specimen - Laboratory specimen tracking
- MedicationDispense - Pharmacy dispensing records
- RelatedPerson - Patient relationships and emergency contacts
# 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- Search
patient/- 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-noteExport 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/$exportsystem/Patient.$export # For patient export
system/*.$bulkdata-status # Check export status
system/Binary.read # Download files
- Initiate export → Receive
Content-LocationURL - Poll status → Wait for completion
- Download NDJSON files → Process data
Generate Continuity of Care Documents on demand:
POST /fhir/DocumentReference/$docrefParameters:
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:
- Demo Portal: https://www.open-emr.org/wiki/index.php/Development_Demo
- Click: "API (Swagger) User Interface"
Discover server capabilities:
curl https://localhost:9300/apis/default/fhir/metadataDiscover SMART capabilities:
curl https://localhost:9300/apis/default/fhir/.well-known/smart-configuration- FHIR API Docs - Complete FHIR reference
- SMART on FHIR Docs - App integration
- Troubleshooting - Common issues
- OpenEMR Forum - Ask questions
- GitHub Issues - Report bugs
- FHIR R4 Spec - Official specification
- US Core 8.0 IG - US Core guide
- SMART Spec - SMART on FHIR
✅ 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:
- Original documentation by OpenEMR developers and contributors
- Technical specifications from the OpenEMR codebase
- Community feedback and real-world implementation experience
The organization, structure, and presentation of this documentation was enhanced using Claude AI (Anthropic) to:
- Reorganize content into a more accessible modular structure
- Add comprehensive examples and use cases
- Improve navigation and cross-referencing
- Enhance clarity and consistency across documents
All technical accuracy is maintained from the original community-authored documentation.
OpenEMR is an open-source project. To contribute to this documentation:
- Report Issues: GitHub Issues
- Discuss: Community Forum
- Submit Changes: Pull Requests
Last Updated: November 2025 License: GPL v3
For complete documentation, see Documentation/api/