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<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 | (Optional) Optional fetch options. |
Returns:
ReadablePromise<WithId<ExtractResource<RT>>>
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