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
Parameter | Type | Description |
---|---|---|
resource | T | The FHIR resource. |
options | RequestInit | (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