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?: RequestInit): Promise<OperationOutcome>;

Parameters

ParameterTypeDescription
resourceTThe FHIR resource.
optionsRequestInit(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