Overview

SQL on FHIR module includes the following resource types:

  • ViewDefinition

ViewDefinition

Path Card. Type Description
constant0..*BackboneElementA constant is a value that is injected into a FHIRPath expression through the use of a FHIRPath external constant with the same name.
constant.valueBase64Binary0..1base64BinaryThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueUri0..1uriThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueString0..1stringThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueCode0..1codeThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valuePositiveInt0..1positiveIntThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueCanonical0..1canonicalThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueDecimal0..1decimalThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueDateTime0..1dateTimeThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.name1..1stringName of constant (referred to in FHIRPath as %[name])
constant.valueInstant0..1instantThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.value1..1
constant.valueBoolean0..1booleanThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueDate0..1dateThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueUnsignedInt0..1unsignedIntThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueUuid0..1uuidThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueTime0..1timeThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueId0..1idThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueUrl0..1urlThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueOid0..1oidThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

constant.valueInteger0..1integerThe value that will be substituted in place of the constant reference. This is done by including `%your_constant_name` in a FHIRPath expression, which effectively converts the FHIR literal defined here to a FHIRPath literal used in the path expression.

Support for additional types may be added in the future.

contact0..*ContactDetailContact details for the publisher
copyright0..1markdownUse and/or publishing restrictions
description0..1markdownNatural language description of the view definition
experimental0..1booleanFor testing purposes, not real usage
fhirVersion0..*codeThe FHIR version(s) for the FHIR resource. The value of this element is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor].
identifier0..1IdentifierAdditional identifier for the view definition
meta0..1MetaMetadata about the view definition
name0..1stringName of the view definition, must be in a database-friendly format.
publisher0..1stringName of the publisher/steward (organization or individual)
resource1..1codeThe FHIR resource that the view is based upon, e.g. 'Patient' or 'Observation'.
select0..*BackboneElementThe select structure defines the columns to be used in the resulting view. These are expressed in the `column` structure below, or in nested `select`s for nested resources.
select.column0..*BackboneElementA column to be produced in the resulting table. The column is relative to the select structure that contains it.
select.column.tag0..*BackboneElementTags can be used to attach additional metadata to columns, such as implementation-specific directives or database-specific type hints.
select.column.tag.name1..1stringA name that identifies the meaning of the tag. A namespace should be used to scope the tag to a particular context. For example, 'ansi/type' could be used to indicate the type that should be used to represent the value within an ANSI SQL database.
select.column.tag.value1..1stringValue of tag
select.column.name1..1stringName of the column produced in the output, must be in a database-friendly format. The column names in the output must not have any duplicates.
select.column.path1..1stringA FHIRPath expression that evaluates to the value that will be output in the column for each resource. The input context is the collection of resources of the type specified in the resource element. Constants defined in Reference({constant}) can be referenced as %[name].
select.column.type0..1uriA FHIR StructureDefinition URI for the column's type. Relative URIs are implicitly given the 'http://hl7.org/fhir/StructureDefinition/' prefix. The URI may also use FHIR element ID notation to indicate a backbone element within a structure. For instance, `Observation.referenceRange` may be specified to indicate the returned type is that backbone element.

This field must be provided if a ViewDefinition returns a non-primitive type. Implementations should report an error if the returned type does not match the type set here, or if a non-primitive type is returned but this field is unset.

select.column.collection0..1booleanIndicates whether the column may have multiple values. Defaults to `false` if unset.

ViewDefinitions must have this set to true if multiple values may be returned. Implementations SHALL report an error if multiple values are produced when that is not the case.

select.column.description0..1markdownA human-readable description of the column.
select.select0..*Nested select relative to a parent expression. If the parent `select` has a `forEach` or `forEachOrNull`, this child select will apply for each item in that expression.
select.forEach0..1stringA FHIRPath expression to retrieve the parent element(s) used in the containing select, relative to the root resource or parent `select`, if applicable. `forEach` will produce a row for each element selected in the expression. For example, using forEach on `address` in Patient will generate a new row for each address, with columns defined in the corresponding `column` structure.
select.unionAll0..*A `unionAll` combines the results of multiple selection structures. Each structure under the `unionAll` must produce the same column names and types. The results from each nested selection will then have their own row.
select.forEachOrNull0..1stringSame as forEach, but produces a single row with null values in the nested expression if the collection is empty. For example, with a Patient resource, a `forEachOrNull` on address will produce a row for each patient even if there are no addresses; it will simply set the address columns to `null`.
status1..1codedraft | active | retired | unknown
title0..1stringA optional human-readable description of the view.
url0..1uriCanonical identifier for this view definition, represented as a URI (globally unique)
useContext0..*UsageContextThe context that the content is intended to support
where0..*BackboneElementA series of zero or more FHIRPath constraints to filter resources for the view. Every constraint must evaluate to true for the resource to be included in the view.
where.path1..1stringA FHIRPath expression that defines a filter that must evaluate to true for a resource to be included in the output. The input context is the collection of resources of the type specified in the resource element. Constants defined in Reference({constant}) can be referenced as %[name].
where.description0..1stringA human-readable description of the above where constraint.

Last updated 2025-07-01T00:23:09Z