Skip to main content

core.medplumclient.validateresource

Home > @medplum/core > MedplumClient > validateResource

MedplumClient.validateResource() method

Executes the validate operation with the provided resource.

Signature:

validateResource<T extends Resource>(resource: T, options?: MedplumRequestOptions): Promise<OperationOutcome>;

Parameters

Parameter

Type

Description

resource

T

The FHIR resource.

options

MedplumRequestOptions

(Optional) Optional fetch options.

Returns:

Promise<OperationOutcome>

The validate operation outcome.

Example

Example:

const result = await medplum.validateResource({
resourceType: 'Patient',
name: [{ given: ['Alice'], family: 'Smith' }],
});

See the FHIR "$validate" operation for full details: https://www.hl7.org/fhir/resource-operation-validate.html