Releases: dnlbox/fhir-resource-diff
Releases · dnlbox/fhir-resource-diff
v0.3.5
Changes
Changed
--versionlong 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
Fixed
-Vis the only alias for the version flag;--versionlong form removed from the root command so Commander no longer intercepts it before subcommands likelist-resources --version R4(Spec 48)validate -(stdin) auto-detects--annotatewrappers ({ resource, notes }) produced byfhir-test-data generate --annotateand validates the innerresourcefield, 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 frompackage.jsonintsup.config.tsat build time and injects it as__PACKAGE_VERSION__via esbuild'sdefineoption. This eliminates thecreateRequire/node:moduleimport from the bundle entirely — the version becomes a plain inlined string.
v0.3.3
Fixed
TOOL_VERSIONnow reads frompackage.jsonvia the module system — stays in sync with the published package version automatically; was hardcoded to0.2.0(Spec 45)validate <file>accepts JSON array files and NDJSON files by path, applying the same auto-detection logic asvalidate -(stdin) (Spec 46)comparewarns and exits 1 when comparing resources of different types (e.g.PatientvsBundle); pass--forceto proceed with the diff anyway (Spec 47)
v0.3.2
v0.3.1
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/idheaders 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) --envelopewith--format jsonwraps the multi-resource array in the standard envelope (Spec 34)detectInputFormatandparseMultiResourceutilities insrc/cli/utils/(Spec 34)MedicationUsageadded to the R5 resource registry (renamed fromMedicationStatementin R5);info MedicationUsagenow works andvalidate --fhir-version R5no longer warns (Spec 35)fhir-resource-typeFORMAT_RULE: unknownresourceTypevalues now produce a warning on everyvalidatecall, even without--fhir-version; version-mismatched types (e.g.MedicationStatementin R5) also warn (Spec 39)fhir-common-bindingsSTRUCTURAL_RULE: validatesPatient.genderagainstAdministrativeGendervalue set andtelecom[].systemagainstContactPointSystemvalue set (Specs 37, 38)MedicationStatement.statusnow 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-formatFORMAT_RULE now validatesPeriod.startandPeriod.endfields as FHIR dateTime; closes themalformed-datefault gap foreffectivePeriod,onsetPeriod,performedPeriod, andperiodacross all resource types (Spec 42)fhir-common-bindingsSTRUCTURAL_RULE now validatesObservation.valueQuantity.systemandObservation.component[].valueQuantity.systemagainst 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.typeno longer triggers a false "should be CodeableConcept" warning in R4 and R4B — it is correctly a plain string code in those versions (Spec 36)MedicationStatementregistry entry updated toR4/R4Bonly (does not exist in R5) (Spec 35)
v0.3.0
What's changed
Added
normalize --summaryflag: prints a one-line change summary to stderr without affecting stdout piping —↳ normalized: 5 keys sorted, 2 dates normalizedNormalizeStatsandNormalizeResulttypes exported from the library —normalize()now returns{ resource, stats }instead of a bareFhirResource- Pre-commit hooks via lefthook:
typecheck,lint, andtestrun 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.ymlworkflow
Changed
infocommand lookups are now case-insensitive —info observationandinfo OBSERVATIONboth worknormalizecommand description updated to explain canonical form and when to use itcanonicalandnonepreset descriptions rewritten in plain terms
Breaking change
normalize()return type changed fromFhirResourcetoNormalizeResult— update call sites to use.resourcefor the normalized resource and.statsfor change counts
v0.2.0
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.profiledetection, exact-match registry for named profiles, IG namespace registry (Spec 23) ValidationHinttype — separates tool-scope notes from data findings; clean resources now showvalidnotvalid (with warnings)ValidationRuleinfrastructure:walkResourcetree walker,runRulesrunner,ruleIdonValidationErrorgetPath/setPathsafe path utilities insrc/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/withSHOWCASE.md CONTRIBUTING.mdrewrite: functional programming paradigm, curated-not-complete philosophy, out-of-scope table (Spec 26)LICENSEfile (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
normalizeandwalkResource(CWE-915):PROTOTYPE_KEYSguard 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
errorsarray to separatehintfield onValidationResult UNSAFE_KEYSrenamed toPROTOTYPE_KEYSwith explanatory comment- Ecosystem section in
README.mdreframed to acknowledge community contributions