Skip to main content

core.parsereference

Home > @medplum/core > parseReference

parseReference() function

Parses a reference and returns a tuple of [ResourceType, ID].

Signature:

export declare function parseReference(reference: Reference | undefined): [ResourceType, string];

Parameters

ParameterTypeDescription
referenceReference | undefinedA reference to a FHIR resource.

Returns:

[ResourceType, string]

A tuple containing the ResourceType and the ID of the resource or undefined when undefined or an invalid reference is passed.