Provides the MockClient
class and a large number of mocked endpoints and resources.
For example:
-
GET fhir/R4/ai/iehr/Patient/123
returns Homer Simpson -
GET fhir/R4/ai/iehr/Practitioner/123
returns Dr. Alice Smith -
GET fhir/R4/ai/iehr/Organization/123
returns Test Organization
Add as a dependency:
npm install @iehr/mock
Note the following peer dependencies:
- @iehr/core
- @iehr/fhir-router
- If you want to use JSONPatch:
- If you want to use GraphQL:
Create a new mock client:
const client = new MockClient();
Read a Patient
resource:
const patient = await client.readResource('Patient', '123');
MockClient
is API compatible with IEHRClient
in @iehr/core. Please refer to IEHRClient
for full documentation on client capabilities.
iEHR is a FHIR®-native, AI-infused, API-first, interoperable EHR. iEHR makes it easy to build healthcare apps quickly with less code.
Apache 2.0.
Copyright © Medplum 2025 (HL7® FHIR® US)
Copyright © iEHR.ai 2025 (HL7® FHIR® International, AI & Data platform)