import { useAuthServiceContext } from "../../../services";
import { usePatientConnectionsService } from "../../../services/PatientConnectionsService.tsx";
import { isOrglessPatientsHost } from "../../../utils/hostedMount";
import PersonalImports from "./PersonalImports";
import ConnectionsScreen from "../RecordsPage/ConnectionsScreen.tsx";
// A patient's own connections to other health systems, bringing their records to the practice whose portal they are in.
// Only the patient themselves, at a practice, may use it: a caregiver signed in for them, or a portal with no practice
// open, is told why and nothing is asked of the server. Every row is the patient's own.
const MyRecordsConnections = () => {
const { currentUser, currentOrganization } = useAuthServiceContext();
const personal = isOrglessPatientsHost();
const { listOwnConnections, listPatientIssuers, startPatientConnection, switchOffOwnConnection, confirmPatientLink, personalAttempt, personalConnectionsPage } = usePatientConnectionsService({ personal });
const isPatient = currentUser?.fhir?.resourceType === "Patient" && Boolean(currentUser?.fhir?.id);
const practice = currentOrganization?.name?.trim() || "your practice";
const practiceName = currentOrganization?.name?.trim() || "Your practice";
return (
<>
{personal && isPatient && }
>
);
};
export default MyRecordsConnections;