canonical: https://jentic.com/apis/epic.com/epic-fhir

# Epic on FHIR API

Jentic publishes a curated, agent-optimized OpenAPI specification for Epic on FHIR API, keeping it validated and agent-ready. Retrieve patient demographics, clinical observations, and medication requests from Epic-connected health systems using FHIR R4 resources. The API provides read access to Patient, Observation, and MedicationRequest resources, enabling interoperable health data retrieval from one of the largest EHR networks in the United States serving over 305 million patient records.

## For AI agents

Search and retrieve patient demographics, clinical observations (labs, vitals), and medication requests from Epic-connected health systems via FHIR R4 resources.

## Scope

Does not handle appointment scheduling, clinical note authoring, or billing - use for read-only patient data retrieval (demographics, labs, medications) only.

## Capabilities

- Search patients by name, date of birth, identifier, or other demographics across Epic-connected systems
- Retrieve individual patient records with full FHIR R4 Patient resource including contact and insurance information
- Query clinical observations including lab results, vital signs, and social history by patient and category
- Fetch active and historical medication requests with dosage, prescriber, and status details
- Access health data from over 305 million patient records across Epic-connected organizations

## Use cases

### AI Agent FHIR Data Retrieval

AI agents access Epic patient data through Jentic using FHIR R4 resources without manually configuring Epic's authentication or endpoint discovery. An agent searches for 'retrieve patient from Epic' and Jentic returns the Patient resource schema with required parameters. The agent executes the query and receives standardized FHIR JSON, enabling health data workflows across Epic's network of hospitals and clinics.

Example prompt: Search for patient John Smith by name using GET /Patient with family=Smith and given=John, then retrieve their latest hemoglobin lab observation

### Patient Record Lookup

Search and retrieve patient demographics from Epic-connected health systems using standard FHIR search parameters. The Patient resource supports search by name, date of birth, identifier (MRN), gender, and address. Results return full FHIR R4 Patient resources with telecom, address, and managing organization details for care coordination.

Example prompt: Search for patients with last name 'Garcia' and date of birth '1985-03-15' using GET /Patient, then retrieve the full record for the matching patient ID

### Clinical Observations and Lab Results

Query Observation resources to retrieve lab results, vital signs, and other clinical measurements for a specific patient. FHIR Observations are categorized by type (laboratory, vital-signs, social-history) and include value, units, reference ranges, and interpretation codes. Supports date range filtering for longitudinal clinical trend analysis.

Example prompt: Retrieve all Observation resources of category 'laboratory' for patient ID abc123 from the last 90 days and list any values flagged as abnormal

### Medication History Review

Fetch active and completed medication requests for medication reconciliation and drug interaction checking. The MedicationRequest resource includes drug name, dosage instructions, prescriber, dispensing pharmacy, and status. Supports filtering by status (active, completed, stopped) for current medication list generation.

Example prompt: Get all active MedicationRequest resources for patient ID xyz789 and list the drug names, dosages, and prescribing providers

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /Patient | Search patients by demographics |
| GET | /Patient/{id} | Get a specific patient by ID |
| GET | /Observation | Query clinical observations and lab results |
| GET | /MedicationRequest | Get medication requests and prescriptions |

## Key resources

- **Patient** — Demographics, identifiers, telecom, and managing organization for patient records
- **Observation** — Lab results, vital signs, and clinical measurements with categories and values
- **MedicationRequest** — Prescriptions with drug, dosage, prescriber, and status information

## Why Jentic

- **Setup:** Wiring Epic on FHIR by hand means passing SMART on FHIR tokens in the Authorization header, learning the FHIR resource query conventions, and building your own retries against api.epic.com. Through Jentic you install once, import the Epic on FHIR API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Epic on FHIR here is read-only, so scope the agent to the operations it needs, such as GET /Patient or GET /Observation. You pick that allowed set, so an operation like GET /MedicationRequest is only reachable if you include it.
- **Credential handling:** Your Epic authorization token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'retrieve patient labs from Epic' or 'look up a patient by id', and Jentic returns the matching FHIR operation with its input schema so the agent calls the right endpoint without browsing the FHIR documentation.

## Related APIs

- **Athena Health** — Cloud-based EHR API with 38 endpoints for patient records, appointments, and clinical charts
- **1upHealth API** — Health data aggregation platform that connects to Epic and other EHRs via FHIR
- **DrChrono** — Full-featured ambulatory EHR with 310 endpoints including billing, labs, and practice management

## FAQ

### Which OpenAPI specification does this Epic on FHIR API page describe?

A curated, agent-optimized Jentic specification covering 4 read operations across the Patient, Observation, and MedicationRequest FHIR resources. Epic itself publishes a FHIR R4 CapabilityStatement at its own metadata endpoint, https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/metadata, which declares the resources, interactions, and search parameters that FHIR endpoint supports. That is a FHIR conformance resource rather than an OpenAPI document, so OpenAPI tooling cannot load it directly. The Jentic specification expresses the operations on this page in OpenAPI form and is kept validated and agent-ready. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Epic on FHIR API use?

The Epic on FHIR API uses an API key passed in the Authorization header. In practice, Epic implementations typically use SMART on FHIR (OAuth 2.0-based) for production access with client credentials or authorization code flows depending on the app type. Through Jentic, credentials are stored in your Jentic One instance and agents receive pre-configured authorization headers.

### Can I retrieve lab results with the Epic on FHIR API?

Yes. The GET /Observation endpoint returns clinical observations including lab results when queried with category=laboratory and a patient reference. Results include LOINC codes, numeric values with units, reference ranges, and interpretation flags (normal, abnormal, critical).

### How many patient records can I access through Epic on FHIR?

Epic's network serves over 305 million patient records across connected hospitals and health systems. Access depends on your application's registration with individual Epic organizations. Each organization grants access to their patient population through the FHIR endpoint.

### How do I search for a patient through Jentic?

Search Jentic for 'look up patient in Epic' to discover the GET /Patient endpoint. The agent loads the schema which accepts search parameters like family (last name), given (first name), birthdate, and identifier (MRN). Install via pip install jentic and use the search-load-execute flow to query without manual configuration.

### What FHIR resources does the Epic on FHIR API support?

This spec covers Patient (demographics and identifiers), Observation (labs, vitals, social history), and MedicationRequest (prescriptions and medication orders). These three resources cover the core clinical data retrieval use cases for patient-facing and provider-facing applications.

### Can I limit what my agent is allowed to do with the Epic on FHIR API?

Yes. Jentic One is self-hosted by you, so your own rules decide which Epic on FHIR operations and credentials the agent can use. Epic on FHIR here is read-only, and you choose the allowed set, so you can grant just GET /Patient and GET /Observation while leaving GET /MedicationRequest unreachable unless you add it. Your Epic authorization token stays in your own instance and is injected only when a permitted operation runs.
