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