Local API emulation for health apps

Stateful, production-fidelity emulators for FHIR servers, EHRs, payers, and life science APIs. No PHI, no sandbox accounts, no network. Synthetic data only.

A FHIR server for R4, R4B, and R5 with SMART App Launch, plus EHR, payer, imaging, HL7 v2, device, and life science emulators, all available now.

$ npx emuhealth

emuhealth v1.0.0
Synthetic data only. Never load real patient data (PHI) into emuhealth.

  fhir    http://localhost:4100   # FHIR R4, R4B, R5
  epic    http://localhost:4101   # Epic
  openfda http://localhost:4102   # openFDA
  rxnav   http://localhost:4103   # RxNav
  clinicaltrialshttp://localhost:4104   # ClinicalTrials.gov
  ncbi    http://localhost:4105   # NCBI E-utilities
  nppes   http://localhost:4106   # NPPES NPI Registry
  benchlinghttp://localhost:4107   # Benchling
  redcap  http://localhost:4108   # REDCap
  cerner  http://localhost:4109   # Oracle Health (Cerner)
  athena  http://localhost:4110   # athenahealth
  bluebuttonhttp://localhost:4111   # CMS Blue Button 2.0
  cdshookshttp://localhost:4112   # CDS Hooks
  redox   http://localhost:4113   # Redox
  healthlakehttp://localhost:4114   # AWS HealthLake
  gcphealthcarehttp://localhost:4115   # Google Cloud Healthcare API
  azurehealthhttp://localhost:4116   # Azure Health Data Services
  stedi   http://localhost:4117   # Stedi
  availityhttp://localhost:4118   # Availity
  dexcom  http://localhost:4119   # Dexcom
  fitbit  http://localhost:4120   # Fitbit
  oura    http://localhost:4121   # Oura
  withingshttp://localhost:4122   # Withings
  terra   http://localhost:4123   # Terra
  dicomwebhttp://localhost:4124   # DICOMweb
  hl7v2   http://localhost:4125   # HL7 v2 over MLLP
  veeva   http://localhost:4126   # Veeva Vault
  rave    http://localhost:4127   # Medidata Rave
  payer   http://localhost:4128   # Payer APIs
  priorauthhttp://localhost:4129   # Prior Authorization
  xds     http://localhost:4130   # IHE XDS and XCA

What this gives you

The FHIR store, generated synthetic patients, SMART App Launch, and SMART Backend Services are available now.

Stateful FHIR store

Create a Patient, record Observations, search with includes and chained parameters. Versions, history, and ETags behave like a real FHIR server, in R4, R4B, or R5.

Real SMART on FHIR

EHR and standalone launch with PKCE, v1 and v2 scopes, and backend services with JWT client assertions. Your SMART client works without changes.

Synthetic patients

Start with generated patients, encounters, vitals, labs, conditions, and medications, or seed your own from a config file. Deterministic, realistic enough to test against, never real PHI.

Offline and CI-ready

No network, no Docker, no vendor sandbox accounts. Same deterministic behavior in CI as on your laptop.

Point your FHIR client at localhost

Your existing code stays the same. Just change the server URL.

Before
const client = FHIR.client({
  serverUrl: process.env.EHR_FHIR_URL
})

// needs a vendor sandbox account
// needs network
// shared, read-only test data
With emuhealth
const client = FHIR.client({
  serverUrl: "http://localhost:4100"
})

// offline, instant, stateful
// synthetic patients you control

Use it your way

Run the FHIR server from the CLI or start it from your tests.

CLI

Run alongside your dev server. Health services listen on a stable port range starting at 4100.

npx emuhealth --service fhir
Programmatic API

Import into Vitest or Jest. Start per suite, reset to your synthetic seed between tests.

import { createEmulator } from "emuhealth"

const fhir = await createEmulator({ service: "fhir" })
afterEach(() => fhir.reset())
afterAll(() => fhir.close())