Summary
In openmed/clinical/exporters/fhir/bundle.py, to_bundle builds reference_map keyed by 'ResourceType/id'. When two input resources share the same resourceType and id, the second silently overwrites the first in reference_map, so internal references resolve to only one of them (whichever appears last). The assembler claims to produce no dangling internal references, but duplicate ids produce silently wrong cross-references.
Scope
Acceptance criteria
Out of scope
- FHIR profile validation
- Synthesizing or deduplicating resources
Files
- openmed/clinical/exporters/fhir/bundle.py
- tests/unit/clinical/test_fhir_bundle.py
Task: OM-340 · Milestone: v1.7 · Priority: P2 · Size: S
Depends on: — · Blocks: —
Roadmap: v1.7 expansion (post-1.6.0)
Spec: PLANS/V2/EXECUTION/tasks/OM-340.md
Summary
In openmed/clinical/exporters/fhir/bundle.py, to_bundle builds reference_map keyed by 'ResourceType/id'. When two input resources share the same resourceType and id, the second silently overwrites the first in reference_map, so internal references resolve to only one of them (whichever appears last). The assembler claims to produce no dangling internal references, but duplicate ids produce silently wrong cross-references.
Scope
Acceptance criteria
Out of scope
Files
Task: OM-340 · Milestone: v1.7 · Priority: P2 · Size: S
Depends on: — · Blocks: —
Roadmap: v1.7 expansion (post-1.6.0)
Spec: PLANS/V2/EXECUTION/tasks/OM-340.md