import { outcomeUnknown } from './saveOperation'; /** * Whether a clinical note write may have landed although it failed. The note handler writes to HealthLake before its * broadcasts, Provenance and audit, so any failure it answers with (5xx) can follow a saved note, besides the answers * that never came. A refusal before the write (4xx, including a changed note) saved nothing. */ export const noteOutcomeUnknown = (error: unknown): boolean => { if (outcomeUnknown(error)) return true; const status = (error as { status?: unknown } | null)?.status; return typeof status === 'number' && status >= 500; };