CLI-first, pipe-friendly
Output goes to stdout by default — pipe into jq, validators, FHIR servers, or AI assistants. NDJSON support for streaming bulk workloads. Works wherever JSON does.
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.
# 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/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();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.
| Tool | Purpose |
|---|---|
| fhir-resource-diff | Diff, validate, and inspect FHIR resources |
| fhir-capability-analyzer | Analyze 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.