Skip to main content

core.convertcontainedresourcestobundle

Home > @medplum/core > convertContainedResourcesToBundle

convertContainedResourcesToBundle() function

Converts a resource with contained resources to a transaction bundle. This function is useful when creating a resource that contains other resources. Handles local references and topological sorting.

Signature:

export declare function convertContainedResourcesToBundle(resource: Resource & {
contained?: Resource[];
}): Bundle;

Parameters

ParameterTypeDescription
resourceResource & { contained?: Resource[]; }The input resource which may or may not include contained resources.

Returns:

Bundle

A bundle with the input resource and all contained resources.