core.medplumclient.readversion | Medplum
MedplumClient.readVersion() method
Reads a specific version of a resource by resource type, ID, and version ID.
Signature:
readVersion<RT extends ResourceType>(resourceType: RT, id: string, vid: string, options?: MedplumRequestOptions): ReadablePromise<WithId<ExtractResource<RT>>>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| resourceType | RT | The FHIR resource type. |
| id | string | The resource ID. |
| vid | string | The version ID. |
| options | MedplumRequestOptions | (Optional) Optional fetch options. |
Returns:
ReadablePromise < WithId <ExtractResource
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.