Releases: dnlbox/fhir-test-data
Releases · dnlbox/fhir-test-data
Release list
v0.3.0
Added
- 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.
Full changelog: v0.2.0...v0.3.0
v0.2.0
What's Changed
- chore(deps): upgrade commander to v14 by @dnlbox in #1
- chore(deps): migrate to pnpm 11 by @dnlbox in #2
- docs: migrate to shared @fhir-toolkit/docs-theme by @dnlbox in #3
- chore: release version 0.2.0 by @dnlbox in #4
- fix(ci): add NODE_AUTH_TOKEN env for npm publish by @dnlbox in #5
- fix(ci): use node lts and restore registry-url for OIDC trusted publish by @dnlbox in #6
New Contributors
Full Changelog: v0.1.3...v0.2.0
v0.1.3
Changes
Added
createEncounterBuilder— R4/R4B/R5 Encounter with HL7 v3 ActCode class, SNOMED CT type, status-consistent period, and optional subject reference. R5 adapter convertsclassto CodeableConcept array per spec.createDiagnosticReportBuilder— R4/R4B/R5 DiagnosticReport with LOINC report code, HL7 v2-0074 category (matched to code), and optional subject reference.missing-statusfault — removesstatusfrom any resource; triggers a required-field warning infhir-resource-diff validateinvalid-status-valuefault — setsstatusto a string outside the resource's value set; triggers a status-value warning infhir-resource-diff validate- CLI:
generate encounterandgenerate diagnostic-reportcommands llms.txtwith full API reference, locale table, and companion tool cross-references
Changed
- README: added "What is FHIR?" intro, Encounter and DiagnosticReport in the resource description, ecosystem table with all three sister tools, pipeline integration examples, and Development section
Full changelog: https://github.com/dnlbox/fhir-test-data/blob/main/CHANGELOG.md
v0.1.2
Fixed
- 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.
v0.1.1
Fixed
- 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.json
at runtime, so-Valways reflects the published package version. --countvalidation (spec 29) —generate --count 0,--count -1, and--count abc
now 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 to
fhir-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.
v0.1.0
Added
- 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 realisticvalueQuantityranges and UCUM units. Requires a
subjectreference. - Condition builder — generates SNOMED-CT-coded Condition resources with clinical
status and onset date. Requires asubjectreference. - AllergyIntolerance builder — generates SNOMED-CT-coded AllergyIntolerance
resources with type, category, criticality, and reaction. Requires asubject
reference. - MedicationStatement builder — generates MedicationStatement resources with
a medication code, status, and effective period. Requires asubjectreference. - Bundle builder — composes all resource types into a single FHIR Bundle with
automatic reference wiring. All internal references useurn: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 aCodeableConcept
with 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.