← Clinical Tools

How FHIR apps work

How a tool opens from inside the chart and fills itself in, explained with live launches against a public test EHR.

Try it

Each button opens a real tool through the same SMART on FHIR launch Epic uses. The data comes from the SMART Health IT sandbox, a public test system with synthetic patients. No real patient data is involved.

You'll see a simulated login screen; click Login. The tool opens with a banner showing what it read from the chart. Sandbox patients are sparse: expect age and sex, often without labs or problems. Then come back here, or use the banner's “How this launch worked” link, to see each step.

FHIR: a common format for chart data

FHIR (Fast Healthcare Interoperability Resources) is the standard that EHRs like Epic use to share data with apps. The chart is split into resources, each with a fixed shape:

PatientName, birth date, sex
ObservationLabs and vitals: troponin, D-dimer, heart rate
ConditionProblem list: hypertension, prior PE
MedicationRequestActive orders: estradiol, inhalers

An app asks for them with plain web requests, and they come back as JSON. A troponin result looks like this:

GET Observation?patient=123&code=http://loinc.org|67151-1

{ "resourceType": "Observation",
  "code": { "coding": [{ "system": "http://loinc.org", "code": "67151-1",
            "display": "Troponin T.cardiac, high sensitivity" }] },
  "effectiveDateTime": "2026-10-18T08:42:00Z",
  "valueQuantity": { "value": 11, "unit": "ng/L" } }

The code (LOINC for labs, ICD-10 or SNOMED for problems) is what lets the same app work at any hospital: it asks for “LOINC 67151-1” rather than for one lab's internal test name.

SMART: how the app gets in safely

SMART on FHIR is the sign-in layer on top. It lets the EHR hand an app a short-lived, limited key to one patient's chart. This is the sequence every launch above runs through:

  1. EHR→Tool

    The clinician clicks the tool's button in the chart. The EHR opens /launch/?iss=…&launch=…: iss is the EHR's FHIR address, launch a one-time ticket naming this patient and user.

  2. Tool→EHR

    The tool looks up the EHR's sign-in addresses at iss/.well-known/smart-configuration.

  3. Tool→EHR sign-in

    It redirects to the EHR's sign-in with its client ID (registered in advance), the scopes it wants (e.g. read labs), and a PKCE challenge: a one-way hash of a secret only this browser tab knows.

  4. EHR sign-in

    The EHR checks the user is signed in and the app is approved, then sends the browser back to the tool with a one-time code.

  5. Tool→EHR

    The tool trades the code plus its PKCE secret for an access token, about an hour long, and learns which patient is open.

  6. Tool→FHIR API

    It reads Patient, Observation, Condition and MedicationRequest with that token, fills in the form, and shows what it used.

Why it's safe

Sandbox vs. Epic

The code is the same. What changes at a real hospital:

Next step beyond launching: CDS Hooks, where the EHR calls the tool by itself at a key moment (e.g. when a CT angiogram is ordered) and shows its result as a card.

Teaching and decision support only. Part of Clinical Tools.