// Destinations that act inside a practice. The org-less patient portal has none, so they live on each // practice's own portal, reached from My practices. The record is not one of them: it is the patient's // own, and its reads are served without a practice. export const PRACTICE_BOUND_NAV_IDS = new Set([ "appointments", "messages", "related-persons", "tasks", "care-plans", "goals", "collaboration-teams", "invoices", "my-support", ]); // Family & caregivers is the one practice-bound page with a job here. A caregiver invited with no account // lands here with no practice, and it is her only door to the person she helps. A patient adds their first // child there, and Patient/dependent takes any signed-in patient with no practice, so a patient needs the // door before anyone is linked. A related-person login cannot add a child, so it stays hidden there. export const familyOpensOnOrglessPortal = (isPatient: boolean, helpsSomeone: boolean): boolean => isPatient || helpsSomeone; // A patient's own Bills & payments has a job here too: the bills read on this host is served practice by practice, // with no practice on screen. Someone switched in for another person keeps reaching their bills only as the grant // offers, so it stays hidden while acting for someone. export const ownBillsOpenOnOrglessPortal = (isPatient: boolean, actingForSomeone: boolean): boolean => isPatient && !actingForSomeone; export const shownOnOrglessPortal = (id: string, familyOpens: boolean, ownBillsOpen = false): boolean => !PRACTICE_BOUND_NAV_IDS.has(id) || (id === "related-persons" && familyOpens) || (id === "invoices" && ownBillsOpen);