Skip to content

Releases: dnlbox/fhir-resource-diff

v0.3.5

24 Apr 19:19

Choose a tag to compare

Changes

Changed

  • --version long flag restored alongside -V
  • README: added ecosystem table with all three sister tools, integration pipeline examples, corrected envelope example version
  • llms.txt: updated to v0.3.5, added presets, cross-references to companion tools

Added

  • Required-field tests for DiagnosticReport (status and code)

Full changelog: https://github.com/dnlbox/fhir-resource-diff/blob/main/CHANGELOG.md

v0.3.4

22 Mar 00:38

Choose a tag to compare

Fixed

  • -V is the only alias for the version flag; --version long form removed from the root command so Commander no longer intercepts it before subcommands like list-resources --version R4 (Spec 48)
  • validate - (stdin) auto-detects --annotate wrappers ({ resource, notes }) produced by fhir-test-data generate --annotate and validates the inner resource field, emitting a stderr notice (Spec 49)
  • Built-in module imports now use the node: prefix (e.g. "node:module" instead of "module") for Deno compatibility; Node.js 18+ accepts this prefix too, so no backwards-compatibility impact
  • Deno compatibility: tsup/esbuild silently strips the node: prefix from built-in imports in bundled output, so the previous fix (import { createRequire } from "node:module") still resolved to bare "module" in the bundle, which Deno rejects. The real fix reads the version from package.json in tsup.config.ts at build time and injects it as __PACKAGE_VERSION__ via esbuild's define option. This eliminates the createRequire/node:module import from the bundle entirely — the version becomes a plain inlined string.

v0.3.3

22 Mar 00:33

Choose a tag to compare

Fixed

  • TOOL_VERSION now reads from package.json via the module system — stays in sync with the published package version automatically; was hardcoded to 0.2.0 (Spec 45)
  • validate <file> accepts JSON array files and NDJSON files by path, applying the same auto-detection logic as validate - (stdin) (Spec 46)
  • compare warns and exits 1 when comparing resources of different types (e.g. Patient vs Bundle); pass --force to proceed with the diff anyway (Spec 47)

v0.3.2

19 Mar 23:27

Choose a tag to compare

Fixed

  • --version now reports the correct version from package.json; it was hardcoded to 0.1.0 since the initial release

v0.3.1

19 Mar 20:48

Choose a tag to compare

Added

  • validate - now accepts multiple FHIR resources from stdin: a JSON array, NDJSON (one resource per line), or the existing single-object format — auto-detected without a flag (Spec 34)
  • Multi-resource text output: [N/M] ResourceType/id headers per resource, summary line (N resources: X valid, Y invalid) (Spec 34)
  • Multi-resource JSON output: array of result objects, each with index, resource, and the existing validation fields (Spec 34)
  • --envelope with --format json wraps the multi-resource array in the standard envelope (Spec 34)
  • detectInputFormat and parseMultiResource utilities in src/cli/utils/ (Spec 34)
  • MedicationUsage added to the R5 resource registry (renamed from MedicationStatement in R5); info MedicationUsage now works and validate --fhir-version R5 no longer warns (Spec 35)
  • fhir-resource-type FORMAT_RULE: unknown resourceType values now produce a warning on every validate call, even without --fhir-version; version-mismatched types (e.g. MedicationStatement in R5) also warn (Spec 39)
  • fhir-common-bindings STRUCTURAL_RULE: validates Patient.gender against AdministrativeGender value set and telecom[].system against ContactPointSystem value set (Specs 37, 38)
  • MedicationStatement.status now validated against the R4/R4B value set (active | completed | entered-in-error | intended | stopped | on-hold | unknown | not-taken); arbitrary values produce a warning (Spec 41)
  • fhir-date-format FORMAT_RULE now validates Period.start and Period.end fields as FHIR dateTime; closes the malformed-date fault gap for effectivePeriod, onsetPeriod, performedPeriod, and period across all resource types (Spec 42)
  • fhir-common-bindings STRUCTURAL_RULE now validates Observation.valueQuantity.system and Observation.component[].valueQuantity.system against UCUM (http://unitsofmeasure.org); warnings when a non-UCUM system URI is present (Spec 43)

Fixed

  • validate - now correctly handles pretty-printed single JSON objects (e.g. generate patient --pretty | validate -); previously every line was treated as a separate NDJSON entry (Spec 40)
  • AllergyIntolerance.type no longer triggers a false "should be CodeableConcept" warning in R4 and R4B — it is correctly a plain string code in those versions (Spec 36)
  • MedicationStatement registry entry updated to R4/R4B only (does not exist in R5) (Spec 35)

v0.3.0

16 Mar 18:43

Choose a tag to compare

What's changed

Added

  • normalize --summary flag: prints a one-line change summary to stderr without affecting stdout piping — ↳ normalized: 5 keys sorted, 2 dates normalized
  • NormalizeStats and NormalizeResult types exported from the library — normalize() now returns { resource, stats } instead of a bare FhirResource
  • Pre-commit hooks via lefthook: typecheck, lint, and test run in parallel before every commit
  • Renovate for automated dependency update PRs — coupled packages grouped, no automerge
  • CI Node.js matrix: Node 20 (minimum) + lts/* to catch accidental newer API use
  • Runtime compatibility CI: Bun and Deno smoke tests in a separate compat.yml workflow

Changed

  • info command lookups are now case-insensitive — info observation and info OBSERVATION both work
  • normalize command description updated to explain canonical form and when to use it
  • canonical and none preset descriptions rewritten in plain terms

Breaking change

  • normalize() return type changed from FhirResource to NormalizeResult — update call sites to use .resource for the normalized resource and .stats for change counts

v0.2.0

15 Mar 23:25

Choose a tag to compare

Added

  • Format validation rules: FHIR id format, date/dateTime/instant, reference strings (Spec 21)
  • Structural validation rules: required fields for ~20 resource types, status value sets, CodeableConcept shape (Spec 22)
  • Profile awareness: meta.profile detection, exact-match registry for named profiles, IG namespace registry (Spec 23)
  • ValidationHint type — separates tool-scope notes from data findings; clean resources now show valid not valid (with warnings)
  • ValidationRule infrastructure: walkResource tree walker, runRules runner, ruleId on ValidationError
  • getPath / setPath safe path utilities in src/core/utils/path.ts (own-property-only traversal)
  • Snyk dependency vulnerability scanning GitHub Action (Spec 24)
  • Showcase: 6 real HL7 R4 CC0 examples in examples/showcase/ with SHOWCASE.md
  • CONTRIBUTING.md rewrite: functional programming paradigm, curated-not-complete philosophy, out-of-scope table (Spec 26)
  • LICENSE file (MIT)
  • Ecosystem comparison in README.md: positioning alongside @types/fhir, @medplum/core, fhirclient, HL7 Validator

Fixed

  • Stdin pipe with network sources (curl): EAGAIN race condition in Node.js ESM resolved with async stream reader
  • Prototype pollution in normalize and walkResource (CWE-915): PROTOTYPE_KEYS guard on all bracket-notation writes and path traversal

Changed

  • valid (with warnings) only shown when actual data findings exist in the resource
  • Hint about HL7 Validator moved from errors array to separate hint field on ValidationResult
  • UNSAFE_KEYS renamed to PROTOTYPE_KEYS with explanatory comment
  • Ecosystem section in README.md reframed to acknowledge community contributions