All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2026-07-09
- Bundle recipes:
generate bundle --recipe <file>now accepts user-defined YAML or JSON recipes for deterministic, pipeline-oriented Bundle generation. Recipes define ordered resources, aliases, field overrides, and reference wiring while keeping clinical meaning user-owned. - Public recipe API:
createBundleFromRecipe(recipe, options)plus exported recipe types. - Starter recipe examples under
examples/recipes/for lab result, condition plus medication, and diagnostic workup bundle shapes.
0.2.0 - 2026-06-01
- Detailed breakdown of resources generated inside a Bundle logged to
stderrwhen--outputis specified, keeping standard output clean and pipe-safe. --versionlong flag (alias for-V). Matches thefhir-resource-diffandfhir-capability-analyzerCLIs, which already supported both forms.- Dev: lefthook pre-commit hooks (typecheck + lint + test in parallel). Brings this repo to parity with
fhir-resource-diffandfhir-capability-analyzer, which already gate local commits the same way.
describe encounteranddescribe diagnostic-reportno longer error with "unknown resource type". Thedescribecommand now lists the same resource types thatgeneratesupports (encounter and diagnostic-report were added as generators in 0.1.3 but missed indescribe).
- Dev: migrated pnpm config from
package.jsonpnpm.onlyBuiltDependencies(removed in pnpm 11) topnpm-workspace.yamlallowBuilds.packageManagerandengines.pnpmbumped to pnpm 11. No user-facing behaviour change; published package surface is identical. - BREAKING: minimum Node version raised from 20 to 22 (
engines.node >=22.0.0). Driven by upstream pnpm 11.x dropping Node 20 support (usesnode:sqlite, available in Node 22.13+ only).@types/nodebumped to^24(LTS line). - Upgraded CLI framework
commander12→14. No user-facing behaviour change expected;--help,--version, and subcommand signatures (generate <resource-type>,locales,describe) are unchanged. If--helpoutput formatting shifts (whitespace), it is upstream cosmetic. - Dev: bumped typescript 5.9→6 (added tsconfig flags for tsup DTS compatibility). vitest stays at 3.x; vitest 4 deferred across the workspace pending vitepress 2 stable (vitepress 1 pins vite 5; vitest 4 requires vite 6+). No user-facing behaviour change.
- Dev: bumped eslint to 10; removed unused zod dependency. No user-facing behaviour change.
0.1.3 - 2026-04-24
- Encounter builder (
createEncounterBuilder) — generates HL7 FHIR R4/R4B/R5 Encounter resources with status, class (HL7 v3 ActCode), and type (SNOMED CT). Status and period fields are consistent: planned encounters have no period, open encounters have start only, closed encounters have start and end. R5 adapter convertsclassfrom Coding to CodeableConcept array per spec. - DiagnosticReport builder (
createDiagnosticReportBuilder) — generates HL7 FHIR R4/R4B/R5 DiagnosticReport resources with status, LOINC report code, and HL7 v2-0074 category. Category is matched to the selected report code for consistency. missing-statusfault — removes thestatusfield from any clinical resource. Triggers a required-field warning infhir-resource-diff validate.invalid-status-valuefault — setsstatusto a value not in any FHIR ValueSet. Triggers a status-value warning infhir-resource-diff validate.- CLI
generatecommand now acceptsencounteranddiagnostic-reportas resource type arguments. llms.txtcreated with full library API, locale table, fault types, and cross-references tofhir-resource-diffandfhir-capability-analyzer.
- README: added "What is FHIR?" section, Encounter and DiagnosticReport in the feature description, ecosystem table with all three sister tools, pipeline integration examples, and Development section.
0.1.2 - 2026-03-21
- Deno compatibility — tsup/esbuild silently strips the
node:prefix from built-in imports in the bundle output, soimport { createRequire } from "node:module"becameimport { createRequire } from "module"in the dist files, which Deno rejects. The real fix eliminates thecreateRequireimport entirely: the package version is now read frompackage.jsonat build time intsup.config.tsand injected as__PACKAGE_VERSION__via esbuild'sdefineoption. The version becomes a plain inlined string in the bundle with no runtime Node.js built-in import.
0.1.1 - 2026-03-21
- CLI version flag — the version string passed to Commander was hardcoded as
"0.1.0". It now usescreateRequire(import.meta.url)to load theversionfield frompackage.jsonat runtime, so-Valways reflects the published package version. --countvalidation (spec 29) —generate --count 0,--count -1, and--count abcnow exit with code 1 and a clear error message to stderr instead of silently outputting an empty array. Numeric values are displayed unquoted; non-numeric strings are quoted. Example:Error: --count must be a positive integer, got 0--annotatepipeline hint (spec 30) — When--annotateis used and stdout is a TTY (interactive terminal), a hint is printed to stderr explaining that piping tofhir-resource-diff validaterequires extracting.resourcefirst viajq '.resource'. The hint is suppressed when stdout is piped — it never appears in pipe output. The--annotatehelp text now documents the{ resource, notes }wrapper shape and the requiredjqworkaround for pipeline use.
0.1.0 - 2026-03-19
- Fluent builder API — immutable method chaining for all resource types. Each builder method returns a new instance; chains are composable and safe to reuse across tests.
- Patient builder — generates Patient resources with locale-appropriate identifiers, names, addresses, telecom, gender, birthDate, and communication entries.
- Practitioner builder — generates Practitioner resources with locale-appropriate professional identifiers, names with title prefixes, work email, and MD qualification.
- PractitionerRole builder — links a Practitioner to an Organization with a coded role and specialty.
- Organization builder — generates Organization resources with locale-appropriate identifiers, names, addresses, and telecom.
- Observation builder — generates LOINC-coded Observation resources (vital signs
and lab results) with realistic
valueQuantityranges and UCUM units. Requires asubjectreference. - Condition builder — generates SNOMED-CT-coded Condition resources with clinical
status and onset date. Requires a
subjectreference. - AllergyIntolerance builder — generates SNOMED-CT-coded AllergyIntolerance
resources with type, category, criticality, and reaction. Requires a
subjectreference. - MedicationStatement builder — generates MedicationStatement resources with
a medication code, status, and effective period. Requires a
subjectreference. - Bundle builder — composes all resource types into a single FHIR Bundle with
automatic reference wiring. All internal references use
urn:uuid:format. Supportstransaction,collection, andsearchsetbundle types. - FHIR multi-version support — all builders accept
.fhirVersion("R4" | "R4B" | "R5"). Default is"R4". R4B is structurally identical to R4 for all generated resources. R5 applies two structural adaptations:MedicationStatement→MedicationUsage: resource type renamed, medication field restructured frommedicationCodeableConcepttomedication.concept.AllergyIntolerance.type: changed from a plain code string to aCodeableConceptwith acodingarray.
- Seeded deterministic generation — the
.seed(n)method guarantees that the same seed always produces the same output, across runs, machines, and Node versions. Built on a seedable PRNG with no Math.random() dependency. - 14 locales — country-specific name pools, address formats, and identifier systems
for:
us,uk,au,ca,de,fr,nl,in,jp,kr,sg,br,mx,za. - Check-digit-validated identifiers — all patient and practitioner identifiers pass their country's official check-digit algorithm: Luhn (AU, FR, US), Modulus 11 (UK NHS), Verhoeff (IN Aadhaar), 11-proef (NL BSN), Modulus 97 (FR NIR), Modulus 10 (DE LANR).
- Fault injection — the
fhir-test-data/faultssubpath export allows generating intentionally invalid resources for testing error paths, validation pipelines, and rejection behaviour. - CLI
generatecommand —fhir-test-data generate <type>produces resources to stdout or a file directory. Supports--locale,--count,--seed,--fhir-version,--output,--format(json/ndjson),--pretty/--no-pretty. - Browser-safe core —
src/core/has no Node.js API imports and runs in browsers, Deno, and Cloudflare Workers without configuration.