import type { Bundle } from 'fhir/r4'; // The API marks a list it could not confirm holds every recent change: a record just written that search has not // caught up with, a write whose outcome is unknown, or a list shape it cannot check. The relation is the API's own. export const RECENT_WRITES_UNRESOLVED_RELATION = 'x-akashic-recent-writes-unresolved'; /** The list may be missing a recent change: it is not to be read as complete, least of all as "none". */ export const mayMissRecentWrite = (bundle: Pick | null | undefined): boolean => (bundle?.link ?? []).some((link) => link.relation === RECENT_WRITES_UNRESOLVED_RELATION);