#healthcare #fhir #interop #api-bindings

tlq-fhir-snapshot

FHIR StructureDefinition snapshot and differential generation and expansion

6 releases

0.1.10 Jan 10, 2026
0.1.9 Jan 8, 2026

#672 in FFI


Used in tlq-fhir-validator

MIT license

365KB
6.5K SLoC

FHIR StructureDefinition Snapshot Expansion

This crate provides functionality to expand StructureDefinition snapshots by resolving complex types, choice types, and contentReferences.

Example

use tlq_fhir_snapshot::{SnapshotExpander, generate_snapshot, generate_differential, generate_deep_snapshot};
use tlq_fhir_context::{DefaultFhirContext, FhirContext};

// Load a package (from registry-client)
// let package = FhirPackage::from_directory(...)?;
// let ctx = DefaultFhirContext::new(package);

// Generate snapshot from differential
// let snapshot = generate_snapshot(&base_snapshot, &differential)?;

// Generate differential from snapshot
// let differential = generate_differential(&base_snapshot, &snapshot)?;

// Expand snapshot (deep expansion)
// let expander = SnapshotExpander::new();
// let expanded = expander.expand_snapshot(snapshot, &ctx)?;
// Or use the convenience function:
// let deep_snapshot = generate_deep_snapshot(&snapshot, &ctx)?;

Dependencies

~5–26MB
~372K SLoC