Skip to content

fhir-test-dataValid FHIR test resources, on demand.

Country-aware identifiers, deterministic seeds, 14 locales. Built for CI pipelines and AI agents.

fhir-test-data is a TypeScript library and CLI for generating valid FHIR test resources — without copying production data or hardcoding US-centric identifiers.

Supports FHIR R4, R4B, and R5. Generates Patient, Practitioner, Organization, Observation, Condition, AllergyIntolerance, MedicationStatement, and Bundle resources across 14 locales.

bash
# Install
pnpm add fhir-test-data

# Pipe into jq
fhir-test-data generate patient --locale uk --seed 42 | jq '.identifier[0]'

# Generate a full bundle with wired references
fhir-test-data generate bundle --locale au --seed 1 --output ./fixtures/
typescript
import { createPatientBuilder, createBundleBuilder } from "fhir-test-data";

// Deterministic — same seed always produces the same patient
const [patient] = createPatientBuilder().locale("nl").seed(99).build();

// Full bundle with automatic reference wiring
const [bundle] = createBundleBuilder().locale("us").seed(42).type("transaction").build();

Part of the FHIR operations toolkit

Three focused CLI tools built for FHIR development workflows. Each does one job well — compose them in shell pipelines, CI steps, or AI agent chains instead of reaching for a single monolithic toolkit.

ToolPurpose
fhir-resource-diffDiff, validate, and inspect FHIR resources
fhir-capability-analyzerAnalyze and compare FHIR server CapabilityStatements
fhir-test-data (this)Generate valid FHIR test resources across 14 locales

The tools are independent — use one, two, or all three in any combination that fits your pipeline.

Released under the MIT License.