Skip to content

fhir-resource-diff

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.

bash
# 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

Released under the MIT License.