Validation

Vonk can validate a resource against a profile as defined in the $validate operation.

You can call validate on three levels:

  1. Validate on the system level
  2. Validate on the ResourceType level
  3. Validate an instance from the database

Besides that you can configure Vonk to validate every incoming resource and even filter on specific profiles. See the section on Validating incoming resources. In all cases, the Precondition is that Vonk must have access to all relevant StructureDefinitions.

Validation has one Limitation.

Note

The very first validation call will take a considerable amount of time, typically around 5 seconds. This is because Vonk maintains a cache of validation information, and on the first call that cache is still empty. Subsequent calls are much faster.

Validate on the system level

POST <vonk_endpoint>/$validate[?profile=<canonical-url-of-structuredefinition>]

There are two ways of calling $validate:

  1. With a Resource as body and optionally a profile parameter on the url.

  2. With a Parameters resource as body, having

    • a parameter element with the Resource to validate in the resource parameter;
    • (optionally) the profile to validate against in the profile parameter

In both cases the request must have a Content-Type header matching the format of the body (application/fhir+json or application/fhir+xml)

If you do not specify a profile parameter, Vonk will validate the Resource against the base profile from the FHIR Specification.

If you call $validate on the system level, Vonk will make no assumptions about the ResourceType of the Resource to validate.

Validate on the ResourceType level

POST <vonk_endpoint>/<resourcetype>/$validate[?profile=<canonical-url-of-structuredefinition>]

You can call $validate in the same two ways as with Validate on the system level.

If you call $validate on the ResourceType level, Vonk will check whether the Resource to validate is of the same <resourcetype> as provided in the url.

Validate an instance from the database

GET <vonk_endpoint>/<resourcetype>/<id>/$validate[?profile=<canonical-url-of-structuredefinition>]

This time you can only use the (optional) profile parameter on the url to specify a StructureDefinition to validate against.

Precondition

Vonk must be aware of all the StructureDefinitions referenced directly or indirectly by a profile. Refer to the Controlling the Conformance Resources for more information.

Limitation

  1. The mode parameter is not yet supported.