Skip to content

Latest commit

 

History

History

fhir-schema-validator

FHIR Schema Validator

{% hint style="info" %} While all validation features work correctly, we're still integrating FHIR Schema validator into Aidbox.

Test FHIR Schema Validator on public demo page. {% endhint %}

This new validation engine is set to replace the existing Zen Schema Validator and JSON Schema validator.

The primary objectives for this new validator are enhanced performance, easy configuration, and straightforward interaction. Internally, the new validator utilizes the FHIR Schema for the validation process. We believe that it has the potential to become a community standard, and we are actively working towards this goal.

Building on our past experiences, we've simplified the interaction process with the validation module. If you wish to use the StructureDefinition resource as a source of truth, simply POST it.

FHIR Schema

FHIR Schema is a format designed to simplify the implementation and validation of FHIR resources. It is heavily inspired by the design of JSON Schema and introduces a more developer-friendly representation of FHIR StructureDefinitions.

Key features of FHIR Schema include:

  • Simplified Structure
    FHIR Schema represents FHIR resources and their elements in a more straightforward and intuitive manner compared to FHIR StructureDefinition. Each element is represented as a property of the resource with its type specified directly. This representation is similar to how data structures are typically defined in programming languages.
  • Nested Elements
    FHIR Schema provides a clear and simple way to represent and validate nested elements in FHIR resources. This is a key requirement for many healthcare data use cases.
  • First-class Arrays
    Identify and label arrays. Most non-XML implementations distinguish between arrays and singular elements, so it's beneficial to pre-calculate this distinction.
  • Clear Implementation Semantics
    FHIR Schema offers clear semantics for implementing FHIR validation rules. This clarity can make it easier for developers to create robust and reliable FHIR implementations.
  • Source of metadata
    This is essential for FHIRPath, CQL, and code-generation.

In summary, FHIR Schema is a format that aims to make FHIR more accessible and easier to work with for developers, potentially leading to improved interoperability of healthcare systems.

Validator Features

Comparison of features with previous validation engines

FeatureFHIR SchemaZen SchemaJSON Schema
Invariantstruefalsefalse
Forbidden elements (max 0)truefalsefalse
Required elementstruetruetrue
Constantstruetruefalse
Union typestruefalsefalse
Empty values checktruefalsefalse
Primitive typestruetruetrue
Slicingtruetruefalse
Ordered slicingtruefalsefalse
Default slicetruefalsefalse
Type slicingtruefalsefalse
Binding slicingtruefalsefalse
Target slicingtruefalsefalse
Re-slicingtruefalsefalse
Terminology bindingstruetruefalse
Extensions validationtruefalsefalse
Underscore propertiestruefalsefalse
Referencestruetruetrue
Recursive schemastruetruetrue
Error on nulls*truefalsefalse

{% hint style="warning" %} Error on nulls

Starting from the 2405 release when using a FHIR schema validation engine Aidbox throws errors when posting values that containnulls. This behavior is FHIR compliant.

When using Zen schema and JSON schema Aidbox automatically strips null values. {% endhint %}

Useful pages

Setup ⚙️setup.md
Supported IGs 📦supported-implementation-guides.md
Upload FHIR IG to Aidbox ⬆️upload-fhir-implementation-guide