Skip to main content
Glama
coverage.ts1.06 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import type { MedplumClient } from '@medplum/core'; import type { Coverage } from '@medplum/fhirtypes'; /** * Creates a self-pay coverage for a patient * @param medplum - Medplum client instance * @param patientId - ID of the patient * @returns Promise with the created Coverage resource */ export async function createSelfPayCoverage(medplum: MedplumClient, patientId: string): Promise<Coverage> { return medplum.createResource({ resourceType: 'Coverage', status: 'active', type: { coding: [ { system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', code: 'SELFPAY', display: 'Self Pay', }, ], text: 'Self Pay', }, subscriber: { reference: `Patient/${patientId}` }, beneficiary: { reference: `Patient/${patientId}` }, payor: [{ reference: `Patient/${patientId}` }], period: { start: new Date().toISOString(), }, }); }

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