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?: MedplumRequestOptions): ReadablePromise<Bundle<ExtractResource<K>>>;
Parameters
Parameter | Type | Description |
---|---|---|
resourceType | K | The FHIR resource type. |
id | string | The resource ID. |
options | MedplumRequestOptions | (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