Skip to main content

core.medplumclient.readhistory

Home > @medplum/core > MedplumClient > readHistory

MedplumClient.readHistory() method

Reads resource history by resource type and ID.

The return value is a bundle of all versions of the resource.

Signature:

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

Parameters

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

Returns:

ReadablePromise<Bundle<ExtractResource<K>>>

Promise to the resource history.

Example

Example:

const history = await medplum.readHistory('Patient', '123');
console.log(history);

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