Skip to content

Ecosystem

fhir-test-data is one of two tools in the dnlbox FHIR toolchain. They are designed to complement each other in a typical FHIR development workflow.


dnlbox FHIR toolchain

ToolWhat it does
fhir-test-data (this)Generate valid FHIR test resources with country-aware identifiers
fhir-resource-diffDiff, validate, and inspect FHIR resources

Natural workflow

bash
# 1. Generate test fixtures
fhir-test-data generate bundle --locale uk --seed 1 --output ./fixtures/

# 2. Validate the generated output
fhir-resource-diff validate ./fixtures/Bundle-0001.json --fhir-version R4

# 3. Compare against a baseline after a library upgrade
fhir-resource-diff compare ./fixtures/Bundle-0001.json ./baseline/Bundle-0001.json

TypeScript FHIR ecosystem

How fhir-test-data fits relative to other tools in the TypeScript/JavaScript FHIR ecosystem:

ToolPurposeLocale supportDeterministicTypeScript-nativeBrowser-safe
fhir-test-dataTest data generation14 localesYes (seeded)YesYes
SyntheaClinically realistic patient simulationUS onlyPartialNo (Java)No
@types/fhirFHIR TypeScript types onlyYesYes
@medplum/coreFHIR client + utilitiesYesPartial
fhirclientSMART on FHIR clientYesYes

When to use fhir-test-data

  • You need TypeScript-native test data generation (no Java runtime, no CLI wrapper)
  • You need internationally correct identifiers across 14 locales (NHS numbers, BSNs, Aadhaar, CPF, RRN, and more)
  • You need deterministic fixtures — the same seed gives the same data across CI runs
  • You need clinically meaningful codes — LOINC observations with HL7-consistent units, SNOMED CT conditions
  • You need a pipe-friendly CLI for generating fixture files without writing code, or for feeding data into other tools
  • You need a browser-safe library for testing in non-Node environments

When to use Synthea

Synthea is a great open-source project that has contributed enormously to the healthcare simulation and research community. It generates clinically realistic longitudinal patient histories — disease progression, care pathways, medication histories — that model real epidemiology over time. If that level of clinical realism is what your use case requires, Synthea is the right tool.

fhir-test-data serves a different set of needs: fast, deterministic, internationally correct fixtures for developer testing workflows, without a Java runtime or a long generation step.


HL7 FHIR specification

This library generates resources conformant with:

For full schema validation and profile conformance checking, use the HL7 FHIR Validator. fhir-test-data generates structurally valid resources; it is not a conformance validator.

Released under the MIT License.