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.
Generate valid FHIR R4/R4B/R5 test resources with country-aware identifiers — pipe-friendly, AI-friendly, and ready for any test workflow.
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();