Expand description
Compartment-aware membership checks for $viewdefinition-run filtering.
Backs filter_resources_by_patient_and_group with a real
CompartmentDefinition-driven scan (audit item #3). The lookup
tables are compiled in via
helios_fhir::compartment_expressions — no runtime data-file
dependency, so the filter works identically whether the server is
invoked from the workspace root, from a Docker container, or from a
release tarball.
For each resource and each requested patient reference, the algorithm is:
- Look up the spec-defined
(search-param-name, FHIRPath-expression)pairs that link the resource to thePatientcompartment viahelios_fhir::compartment_expressions::{r4,r4b,r5,r6}::get_compartment_param_expressions(joined at code-gen time fromCompartmentDefinition-patient.jsonandsearch-parameters.json). - Evaluate each FHIRPath expression against the resource JSON.
- Inspect the result for a
Referencewhosereferencestring matches any requested patient.
Functions§
- resolve_
group_ members_ to_ patient_ refs - Resolves a set of group references to their member patient references.
- resource_
in_ patient_ compartment - Returns
trueifresourceis in the Patient compartment of any of the givenpatient_refs, using the FHIRCompartmentDefinition-patientspec data joined with the corresponding SearchParameter FHIRPath expressions at code-gen time.