Expand description
Reference collection for remote resolve() prefetch (Phase 3).
Gathers the FHIR Reference.reference strings present in an input bundle (and,
during chained prefetch, in fetched resources) so the prefetch stage can decide
which ones are eligible for remote fetching. This module is pure (no I/O).
References are found by structurally walking the JSON for "reference" string
fields, which captures every Reference element regardless of the path it
appears at. Candidates are later filtered against the allowlist
(crate::remote_resolver::RemoteResolveConfig::fetch_decision), so occasional
non-Reference "reference" keys are harmless — they simply won’t match.
Functions§
- collect_
reference_ strings - Collects all unique
referencestrings found anywhere in the bundle. - collect_
reference_ strings_ from_ resources - Collects all unique
referencestrings across a slice of raw resource JSON values (the streaming/NDJSON chunk shape). - collect_
references_ from_ json - Collects all unique
referencestrings from an arbitrary resource JSON value (used to discover chained references inside fetched resources). - collect_
resource_ keys - Collects the
"ResourceType/id"keys of every resource already in the bundle, so the prefetch can skip references that resolve locally. - collect_
resource_ keys_ from_ resources - Collects the
"ResourceType/id"keys of a slice of raw resource JSON values. - reference_
type_ id - Returns the
"Type/id"key implied by a reference string (relative or the trailingType/idof an absolute URL), used to test local resolvability. - resolves_
in_ bundle - Whether
referencealready resolves against a resource present in the bundle.