Validate resources against Terminology Server

Operation $validate

The operation $validate can be used to check whether a resource conforms to a profile. The simplest way to execute this operation is to post the resource to a server. The server will return an OperationOutcome resource listing issues found in the resource.

What gets validated?

Structure: Check that all the content in the resource is described by the specification, and nothing extra is present
Cardinality: Check that the cardinality of all properties is correct (min & max)
Coding/CodeableConcept bindings: Check that codes/displays provided in the Coding/CodeableConcept types are valid

Note: Business rules are made outside the specification and hence not validated as a part of this operation, such as checking for duplicates, checking that references resolve, checking that a user is authorized to do what they want to do, etc.

Sample validation - Individual resource

  1. Open postman and select the method: POST
  2. Put the following URL:
  1. The header section should be informed with the following fields:
  • Key=Content-Type Value=application/json
  • Key=Accept Value=application/fhir+json
  1. In the body section you should choose the option “raw” and the type of file JSON
  2. The body should contain the resource that needs to be validated with the profile mentioned in the meta element
  3. If successful the response will be 200 OK
  4. If unsuccessful the response will be 422 Unprocessable Entity and the OperationOutcome will have the details of the errors.

Bundle validation

  1. Open postman and select the method: POST
  2. Put the following URL:
  1. The header section should be informed with the following fields:
  • Key=Content-Type Value=application/json
  • Key=Accept Value=application/fhir+json
  1. In the body section you should choose the option “raw” and the type of file JSON
  2. The body should contain the bundle that needs to be ingested with the profile mentioned in the meta element of each resource
  3. If successful the response will be 200 OK
  4. If unsuccessful the response will be 400 bad request and the OperationOutcome will have the details of the errors.