core.medplumclient.readhistory | Medplum

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<RT extends ResourceType>(resourceType: RT, id: string, options?: ReadHistoryOptions, requestOptions?: MedplumRequestOptions): ReadablePromise<Bundle<WithId<ExtractResource<RT>>>>;

Parameters

Parameter Type Description
resourceType RT The FHIR resource type.
id string The resource ID.
options ReadHistoryOptions (Optional) Optional history options.
requestOptions MedplumRequestOptions (Optional) Optional fetch options.

Returns:

ReadablePromise <Bundle< WithId <ExtractResource>>>

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.