Skip to main content
Glama
definitions.ts946 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { OperationOutcomeError, serverError } from '@medplum/core'; import { readJson } from '@medplum/definitions'; import type { Bundle, OperationDefinition, ResourceType, StructureDefinition } from '@medplum/fhirtypes'; const operationDefinitions = ( readJson('fhir/r4/profiles-resources.json') as Bundle<StructureDefinition | OperationDefinition> ).entry ?.filter((e) => e.resource?.resourceType === 'OperationDefinition') ?.map((e) => e.resource as OperationDefinition); export function getOperationDefinition(resourceType: ResourceType, code: string): OperationDefinition { const opDef = operationDefinitions?.find((od) => od.resource?.includes(resourceType) && od.code === code); if (!opDef) { throw new OperationOutcomeError(serverError(new Error('OperationDefinition not found'))); } return opDef; }

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