Skip to content

resolve() raises an error instead of returning an empty collection for non-URI inputs #307

@luisfabib

Description

@luisfabib

Resolve.evaluate() raises FHIRPathError when the input item is not a string URI or a
Reference object. The FHIRPath spec states that items that cannot be resolved must be
silently skipped (i.e. contribute an empty result), not raise an error.

Additionally, external http:// / https:// URL resolution is completely absent. A warning
is logged but no attempt is made. The spec does allow engines to return empty for external
references when no resolution service is configured, but this should be a documented opt-out,
not a hard block.

Expected behaviour (per spec)

  • Non-URI, non-Reference inputs: silently produce no output (empty collection).
  • External URLs with no resolution service configured: return empty collection (no error, no warning spam).
  • External URLs with a resolution service configured: delegate to the service.

Actual behaviour

  • Non-URI inputs: raises FHIRPathError.
  • External URLs: emits a warnings.warn() and still returns [] — the warn adds noise in
    production validation runs where resolve() is common.

Suggested fix

Replace the raise FHIRPathError(...) branch for non-URI items with a continue (skip).
Tie external URL resolution to the proposed TerminologyService/ResolutionService interface
so it can be opted into.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfhir.pathRelated to the FHIRPath module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions