Skip to content

enhancement: implement FHIRPath-filtered obligation evaluation #70

Description

@Ardenexal

Component

Validation

FHIR Version

R4, R4B, R5 (all versions)

Problem Statement

FHIRValidationService::collectObligationViolations() silently skips all #[FHIRObligation] instances where $obligation->filter !== null. Conditional obligations (e.g. "populate this field only if another field has value X") are never evaluated.

if ($obligation->filter !== null) {
    continue; // FHIRPath filter evaluation deferred to backlog
}

Proposed Solution

Use the existing FHIRPathService to evaluate $obligation->filter against the resource instance. Only apply the obligation if the filter evaluates to true. If evaluation throws, emit a distinct INFO violation ("filter indeterminate") matching the approach proposed for invariant eval errors.

Additional Context

The FHIRObligation attribute already carries the filter property; only the runtime evaluation step is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions