View raw Markdown
type: operationresource: Resourceoperation: validate

resource $validate

Validate a resource

Description: The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter:

Modes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an OperationOutcome

Note that this operation is not the only way to validate resources - see Validating Resources for further information.

Comments: This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.

This operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.

Note: the correct behavior of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases

Future versions of this specifcation may add additional validation parameters. A candidate list is maintained with the FHIR Validator Documentation

Affects State: false

System: true

Type: true

Instance: true

URL: http://hl7.org/fhir/build/OperationDefinition/Resource-validate

Notes

Summary Table

This table presents a summary of the options for invoking the validate operation.

Resource?Profile?Mode = AbsentMode = profileMode = createMode = updateMode = delete
When invoked at System/Type level (/ or /[ResourceType])
YYContent (Profile)Content+ProfileContent+Profile + Create RulesError (no context)Error (no context)
YNContentError (no profile)Content + Create RulesError (no context)Error (no context)
NYError (no content)Error (no content)Error (no content)Error (no context/content)Error (no context/content)
NNError (no content)Error (no content)Error (no content)Error (no context/content)Error (no context/content)
When invoked at Resource level (/[ResourceType]/[id])
YYError (action mode needed)Error (action mode needed)Error (wrong context)Content/By Profile + Update rulesError (no content allowed)
YNError (action mode needed)Error (action mode needed)Error (wrong context)Content + Update rulesError (no content allowed)
NYExisting Content (Profile)Existing Content/By ProfileError (wrong context)Error (no content)Delete Rules (Profile)
NNExisting ContentError (no profile)Error (wrong context)Error (no content)Delete Rules

Parameters