Path-level diff
Compare two FHIR resources field by field. Every added, removed, and changed value is tracked with dot-notation paths and array index tracking — including nested CodeableConcepts, extensions, and identifiers.
Diff, validate, and inspect FHIR resources. Fast. Local. CI-ready.
fhir-resource-diff is a CLI and TypeScript library for working with FHIR JSON resources locally — no server, no Java runtime, no package downloads. It compares resources path by path, validates format and structure, normalizes for comparison, and exposes a browser-safe API for use in React, Vite, and any bundler.
Supports FHIR R4, R4B, and R5 — auto-detected or explicit via --fhir-version.
# Install
npm install -g fhir-resource-diff
# Validate a resource
fhir-resource-diff validate patient.json --fhir-version R4
# Compare two resources
fhir-resource-diff compare expected.json actual.json
# Diff with JSON output for automation
fhir-resource-diff compare a.json b.json --format json --envelope