SQL on FHIR Module Resources

Overview

SQL on FHIR module includes the following resource types:

  • ViewDefinition

ViewDefinition

Path
Card.
Type
Description

resource

1..1

code

The FHIR resource that the view is based upon, e.g. 'Patient' or 'Observation'.

url

0..1

uri

Canonical identifier for this view definition, represented as a URI (globally unique)

experimental

0..1

boolean

For testing purposes, not real usage

constant

0..*

BackboneElement

A constant is a value that is injected into a FHIRPath expression through the use of a FHIRPath external constant with the same name.

constant.valueBase64Binary

0..1

base64Binary

The 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.valueUri

0..1

uri

The 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.valueString

0..1

string

The 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.valueCode

0..1

code

The 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.valuePositiveInt

0..1

positiveInt

The 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.valueCanonical

0..1

canonical

The 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.valueDecimal

0..1

decimal

The 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.valueDateTime

0..1

dateTime

The 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.name

1..1

string

Name of constant (referred to in FHIRPath as %[name])

constant.valueInstant

0..1

instant

The 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.value

1..1

constant.valueBoolean

0..1

boolean

The 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.valueDate

0..1

date

The 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.valueUnsignedInt

0..1

unsignedInt

The 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.valueUuid

0..1

uuid

The 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.valueTime

0..1

time

The 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.valueId

0..1

id

The 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.valueUrl

0..1

url

The 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.valueOid

0..1

oid

The 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.valueInteger

0..1

integer

The 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.

where

0..*

BackboneElement

A 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.path

1..1

string

A 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.description

0..1

string

A human-readable description of the above where constraint.

name

0..1

string

Name of the view definition, must be in a database-friendly format.

select

0..*

BackboneElement

The 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.column

0..*

BackboneElement

A column to be produced in the resulting table. The column is relative to the select structure that contains it.

select.column.tag

0..*

BackboneElement

Tags can be used to attach additional metadata to columns, such as implementation-specific directives or database-specific type hints.

select.column.tag.name

1..1

string

A 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.value

1..1

string

Value of tag

select.column.name

1..1

string

Name 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.path

1..1

string

A 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.type

0..1

uri

A 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.collection

0..1

boolean

Indicates 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.description

0..1

markdown

A human-readable description of the column.

select.select

0..*

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.forEach

0..1

string

A 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.unionAll

0..*

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.forEachOrNull

0..1

string

Same 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`.

status

1..1

code

draft | active | retired | unknown

identifier

0..1

Identifier

Additional identifier for the view definition

title

0..1

string

A optional human-readable description of the view.

fhirVersion

0..*

code

The 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].

copyright

0..1

markdown

Use and/or publishing restrictions

publisher

0..1

string

Name of the publisher/steward (organization or individual)

meta

0..1

Meta

Metadata about the view definition

useContext

0..*

UsageContext

The context that the content is intended to support

contact

0..*

ContactDetail

Contact details for the publisher

description

0..1

markdown

Natural language description of the view definition

Last updated

Was this helpful?