import type { PracticeDecisionConsequences } from '../services/OrgAuthorizationService'; export function practiceDecisionFollowUp(incomplete: PracticeDecisionConsequences | undefined) { const positive = (value: number | undefined) => typeof value === 'number' && Number.isFinite(value) && value > 0; const appointments = incomplete?.appointmentSearchFailed === true || incomplete?.tasksUnsettled === true || positive(incomplete?.appointmentsStillStanding); const teams = incomplete?.teamDiscoveryIncomplete === true || incomplete?.teamLineageUnresolved === true || incomplete?.teamBindingUnresolved === true || incomplete?.teamRemovalUnconfirmed === true || incomplete?.referralConsentCleanupUnconfirmed === true || incomplete?.teamEvidencePending === true || positive(incomplete?.teamMembershipsNotRemoved) || positive(incomplete?.referralConsentsNotDeactivated); const other = incomplete?.decisionTimeUnproved === true || incomplete?.followUpUnconfirmed === true; return { appointments, teams, other, any: appointments || teams || other }; } export const PRACTICE_TEAM_PENDING_COPY = 'Care team updates for this practice are still pending.';