Skip to main content

core.medplumclient.readversion

Home > @medplum/core > MedplumClient > readVersion

MedplumClient.readVersion() method

Reads a specific version of a resource by resource type, ID, and version ID.

Signature:

readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;

Parameters

ParameterTypeDescription
resourceTypeKThe FHIR resource type.
idstringThe resource ID.
vidstringThe version ID.
optionsRequestInit(Optional) Optional fetch options.

Returns:

ReadablePromise<ExtractResource<K>>

The resource if available.

Example

Example:

const version = await medplum.readVersion('Patient', '123', '456');
console.log(version);

See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html\#vread