Skip to main content
Glama
usePatient.ts688 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import type { OperationOutcome, Patient } from '@medplum/fhirtypes'; import { useResource } from '@medplum/react'; import { useParams } from 'react-router'; type Options = { ignoreMissingPatientId?: boolean; setOutcome?: (outcome: OperationOutcome) => void; }; export function usePatient(options?: Options): Patient | undefined { const { patientId } = useParams(); if (!patientId && !options?.ignoreMissingPatientId) { throw new Error('Patient ID not found'); } return useResource<Patient>({ reference: `Patient/${patientId}` }, options?.setOutcome); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server