Profiling and validation

What is Profiling?

The core FHIR specification outlines essential resources, frameworks, and APIs widely used across diverse healthcare settings. Due to significant variations in practices, regulations, and requirements between regions and within the healthcare industry, the FHIR specification serves as a "platform specification."

However, FHIR resources are generic and have minimal mandatory requirements. For example, all elements in the Patient resource are optional, allowing for the creation of a Patient resource with no data, which is generally impractical. Therefore, this specification often needs to be constrained to suit specific use cases.

The process of creating these constraints is known as profiling. These constraints can be expressed in various ways, for which FHIR defines a set of artefacts:

Artefact
Description
Example

Implementation Guide (IG)

A well-defined and bounded set of adaptations, published together as a single entity. Typically consists of profiles, terminology resources, operation definitions, search parameters, and data examples.

US Core IG mCODE

Conformance Resource

A single resource in a package that makes rules about how an implementation works, for example:

  • The ValueSet resource defines an inclusion of codes from various CodeSystems or other ValueSets. This resource can be used as a Terminology Binding in a StructureDefinition to constrain the possible set of values for a property (e.g., Patient.gender) or to validate a specific code by checking its presence in the ValueSet via /ValueSet/$validate-code.

  • The CodeSystem resource defines a source of codes that can be used for lookups or included in a ValueSet resource.

  • The OperationDefinition defines a FHIR Server operation behaviour and input/output interfaces.

US Core Condition Codes Value Set AdministrativeGender CodeSystem ValueSet $expand OperationDefinition

Profile

A set of constraints on a resource is represented as a StructureDefinition with derivation set to constraint. StructureDefinition is also used for defining resources, not just specifying constraints; all FHIR Core resources are defined using StructureDefinition. While StructureDefinition is indeed a Conformance Resource, we emphasize it here as a Profile because Implementation Guides (IGs) typically consist mostly of these specific resources.

US Core Medication Request

What Aidbox provides for profiling?

Though Aidbox does not emphasize the process of profiling, it provides a rich experience for introspection of IGs loaded into Aidbox.

Introspection views are available only in the New UI. To enable it, go to "Settings" > "New UI."

  • To view the content of an IG in the Aidbox UI, navigate to "FHIR Packages" > "<IG name>"

  • To view the rendered StructureDefinition differential/snapshot, go to "FHIR Packages" > "<IG name>" > "Profiles tab" > "<profile>" > "Differential" or "Snapshot"

  • To expand ValueSets from an IG, go to "FHIR Packages" > "<IG name>" > "ValueSets" > "<ValueSet>" > "Expansion tab"

Additionally, Aidbox offers a developer-oriented approach for creating and testing profiles. You can simply POST a StructureDefinition to a running Aidbox instance and validate a resource against it. Your StructureDefinitions and other Conformance Resources posted via the FHIR CRUD API will later appear in the aidbox.main package. To view its content, navigate to "FHIR Packages" > "app.aidbox.main" > "Profiles tab"

The FHIR ecosystem offers a diverse array of tools for profiling, with the most notable being the FHIR Shorthand/SUSHI project and the FHIR IG Publisher.

What is Validation?

Specifying constraints and refinements is only half the job; your FHIR server must also ensure that incoming data conforms to the selected IG for its operation. The process of verifying that a data instance is valid against a predefined set of constraints is known as validation.

During validation, various constraints are checked, including data shape, required properties, FHIRPath invariants, slicings, reference checks, and terminology bindings. You can read about the specific constraints supported by the Aidbox validator engine here:

FHIR Schema Validator

What Aidbox provides for validation?

Aidbox allows you to upload Implementation Guides. Once an IG is loaded, data instances marked with profile canonical URLs from the loaded IGs will be automatically validated against it without any additional setup. For tutorials on loading IGs into Aidbox, please refer to this page:

Upload FHIR Implementation Guide

Additionally, you can easily create a StructureDefinition in a running Aidbox instance and validate a resource against it. Simply mark your data instance with the profile's canonical URL that was posted earlier, and then create your data. The validator engine will check it against the previously created profile. For tutorials on creating StructureDefinitions in Aidbox, please refer to this guide:

Aidbox FHIR API

Aidbox validation engines

FHIR Schema ValidatorAidboxProfilezen-lang validator

Last updated