SQL on FHIR
3.0.0-ballot - STU 3 Ballot International flag

SQL on FHIR, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 3.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/sql-on-fhir/ and changes regularly. See the Directory of published versions

Resource Profile: Shareable View Definition

Official URL: http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ShareableViewDefinition Version: 3.0.0-ballot
Standards status: Trial-use Maturity Level: 2 Computable Name: ShareableViewDefinition
Other Identifiers: OID:2.16.840.1.113883.4.642.40.77.42.3

A profile for View Definitions intended to be shared between multiple systems. This requires that the View Definition have a defined URL and name. It also requires declaration of the FHIR version that the view is intended to be executed over, and the FHIR type of each column. This ensures consistent interpretation of the view across different view runner implementations.

Usages:

You can also check for usages in the FHIR IG Statistics

Formal Views of Profile Content

Description Differentials, Snapshots, and other representations.

NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.implicitRules This element is a modifier element. This element is included in summaries. 0..1 uri A set of rules under which this content was created
ViewDefinition.contained 0..* Resource Contained, inline Resources
ViewDefinition.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored
Slice: Unordered, Open by value:url
ViewDefinition.url This element is included in summaries. C 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
Constraints: cnl-1
ViewDefinition.name This element is included in summaries. C 1..1 string Name for this view definition (computer friendly)
Constraints: sql-name
ViewDefinition.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
ViewDefinition.resource 1..1 code FHIR resource for the ViewDefinition
Binding: ResourceType (required)
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
Binding: FHIRVersion (required)
ViewDefinition.select C 1..* BackboneElement A collection of columns and nested selects to include in the view.
Constraints: sql-expressions
ViewDefinition.select.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
ViewDefinition.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.resource Base required Resource Types 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.fhirVersion Base required FHIRVersion 📦6.0.0-snapshot1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
cnl-1 warning ViewDefinition.url URL should not contain | or # - these characters make processing canonical references problematic exists() implies matches('^[^|# ]+$')
dom-2 error ViewDefinition If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error ViewDefinition If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource contained.where((('#'+id.trace('id') in %resource.descendants().select(reference | as(uri))) or descendants().where(reference='#' | as(uri)='#').exists()).not()).trace('unmatched', id).empty()
dom-4 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice ViewDefinition A resource should have narrative for robust management text.`div`.exists()
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
sql-expressions error ViewDefinition.select Can only have at most one of `forEach`, `forEachOrNull`, or `repeat`. (forEach.exists().toInteger() + forEachOrNull.exists().toInteger() + repeat.exists().toInteger()) <= 1
sql-name error ViewDefinition.name Name is limited to letters, numbers, or underscores and cannot start with an underscore -- i.e. with a regular expression of: ^[A-Za-z][A-Za-z0-9_]*$ This makes it usable as table names in a wide variety of databases. empty() or matches('^[A-Za-z][A-Za-z0-9_]*$')

This structure is derived from ViewDefinition

NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.url 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
ViewDefinition.name 1..1 string Name for this view definition (computer friendly)
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
ViewDefinition.select.column
ViewDefinition.select.column.type 1..1 uri A FHIR StructureDefinition URI for the column's type.

doco Documentation for this format
NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.id This element is included in summaries. 0..1 id Logical id of this artifact
ViewDefinition.meta This element is included in summaries. 0..1 Meta Metadata about the resource
ViewDefinition.implicitRules This element is a modifier element. This element is included in summaries. 0..1 uri A set of rules under which this content was created
ViewDefinition.language 0..1 code Language of the resource content
Binding: AllLanguages (required): IETF language tag for a human language
Additional BindingsPurpose
CommonLanguages Starter
ViewDefinition.text 0..1 Narrative Text summary of the resource, for human interpretation
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
ViewDefinition.contained 0..* Resource Contained, inline Resources
ViewDefinition.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored
Slice: Unordered, Open by value:url
ViewDefinition.url This element is included in summaries. C 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
Constraints: cnl-1
ViewDefinition.identifier This element is included in summaries. 0..* Identifier Additional identifier for the view definition
ViewDefinition.version This element is included in summaries. 0..1 string Business version of the view definition
ViewDefinition.versionAlgorithm[x] This element is included in summaries. 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
ViewDefinition.versionAlgorithm[x].versionAlgorithmString string
ViewDefinition.versionAlgorithm[x].versionAlgorithmCoding Coding
ViewDefinition.name This element is included in summaries. C 1..1 string Name for this view definition (computer friendly)
Constraints: sql-name
ViewDefinition.title This element is included in summaries. 0..1 string Name for this view definition (human friendly)
ViewDefinition.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
ViewDefinition.experimental This element is included in summaries. 0..1 boolean For testing purposes, not real usage
ViewDefinition.date This element is included in summaries. 0..1 dateTime Date last changed
ViewDefinition.publisher This element is included in summaries. 0..1 string Name of the publisher/steward (organization or individual)
ViewDefinition.contact This element is included in summaries. 0..* ContactDetail Contact details for the publisher
ViewDefinition.description 0..1 markdown Natural language description of the view definition
ViewDefinition.useContext This element is included in summaries. 0..* UsageContext The context that the content is intended to support
ViewDefinition.jurisdiction This element is included in summaries. 0..* CodeableConcept Intended jurisdiction for view definition (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
ViewDefinition.purpose 0..1 markdown Why this view definition is defined
ViewDefinition.copyright 0..1 markdown Use and/or publishing restrictions
ViewDefinition.copyrightLabel 0..1 string Copyright holder and year(s)
ViewDefinition.approvalDate 0..1 date When the view definition was approved by publisher
ViewDefinition.lastReviewDate 0..1 date When the view definition was last reviewed by the publisher
ViewDefinition.effectivePeriod This element is included in summaries. 0..1 Period When the view definition is expected to be used
ViewDefinition.topic 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc
Binding: DefinitionTopic (example)
ViewDefinition.author 0..* ContactDetail Who authored the view definition
ViewDefinition.editor 0..* ContactDetail Who edited the view definition
ViewDefinition.reviewer 0..* ContactDetail Who reviewed the view definition
ViewDefinition.endorser 0..* ContactDetail Who endorsed the view definition
ViewDefinition.relatedArtifact 0..* RelatedArtifact Additional documentation, citations, etc
ViewDefinition.resource 1..1 code FHIR resource for the ViewDefinition
Binding: ResourceType (required)
ViewDefinition.profile 0..* canonical(StructureDefinition) FHIR profiles that this view definition was intended to be executed against
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
Binding: FHIRVersion (required)
ViewDefinition.constant 0..* BackboneElement Constant that can be used in FHIRPath expressions
ViewDefinition.constant.id 0..1 string Unique id for inter-element referencing
ViewDefinition.constant.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.constant.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.constant.name C 1..1 string Name of constant (referred to in FHIRPath as %[name])
Constraints: sql-name
ViewDefinition.constant.value[x] 1..1 Value of constant
ViewDefinition.constant.value[x].valueBase64Binary base64Binary
ViewDefinition.constant.value[x].valueBoolean boolean
ViewDefinition.constant.value[x].valueCanonical canonical(Any)
ViewDefinition.constant.value[x].valueCode code
ViewDefinition.constant.value[x].valueDate date
ViewDefinition.constant.value[x].valueDateTime dateTime
ViewDefinition.constant.value[x].valueDecimal decimal
ViewDefinition.constant.value[x].valueId id
ViewDefinition.constant.value[x].valueInstant instant
ViewDefinition.constant.value[x].valueInteger integer
ViewDefinition.constant.value[x].valueInteger64 integer64
ViewDefinition.constant.value[x].valueOid oid
ViewDefinition.constant.value[x].valueString string
ViewDefinition.constant.value[x].valuePositiveInt positiveInt
ViewDefinition.constant.value[x].valueTime time
ViewDefinition.constant.value[x].valueUnsignedInt unsignedInt
ViewDefinition.constant.value[x].valueUri uri
ViewDefinition.constant.value[x].valueUrl url
ViewDefinition.constant.value[x].valueUuid uuid
ViewDefinition.select C 1..* BackboneElement A collection of columns and nested selects to include in the view.
Constraints: sql-expressions
ViewDefinition.select.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column 0..* BackboneElement A column to be produced in the resulting table.
ViewDefinition.select.column.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.column.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.column.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column.path 1..1 string FHIRPath expression that creates a column and defines its content
ViewDefinition.select.column.name C 1..1 string Column name produced in the output
Constraints: sql-name
ViewDefinition.select.column.description 0..1 markdown Description of the column
ViewDefinition.select.column.collection 0..1 boolean Indicates whether the column may have multiple values.
ViewDefinition.select.column.type 1..1 uri A FHIR StructureDefinition URI for the column's type.
ViewDefinition.select.column.tag 0..* BackboneElement Additional metadata describing the column
ViewDefinition.select.column.tag.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.column.tag.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.column.tag.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column.tag.name 1..1 string Name of tag
ViewDefinition.select.column.tag.value 1..1 string Value of tag
ViewDefinition.select.select 0..* See select (ViewDefinition) Nested select relative to a parent expression.
ViewDefinition.select.forEach 0..1 string A FHIRPath expression to retrieve the parent element(s) used in the containing select. The default is effectively `$this`.
ViewDefinition.select.forEachOrNull 0..1 string Same as forEach, but will produce a row with null values if the collection is empty.
ViewDefinition.select.repeat 0..* string FHIRPath expressions to recursively select from.
ViewDefinition.select.unionAll 0..* See select (ViewDefinition) Creates a union of all rows in the given selection structures.
ViewDefinition.where 0..* BackboneElement A series of zero or more FHIRPath constraints to filter resources for the view.
ViewDefinition.where.id 0..1 string Unique id for inter-element referencing
ViewDefinition.where.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.where.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.where.path 1..1 string A FHIRPath expression defining a filter condition
ViewDefinition.where.description 0..1 string A human-readable description of the above where constraint.

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
ViewDefinition.language Base required All Languages 📍6.0.0-snapshot1 FHIR Std.
ViewDefinition.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.jurisdiction Base extensible Jurisdiction ValueSet ⏿5.0.0 tx.fhir.org
ViewDefinition.topic Base example Definition Topic 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.resource Base required Resource Types 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.fhirVersion Base required FHIRVersion 📦6.0.0-snapshot1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
cnl-1 warning ViewDefinition.url URL should not contain | or # - these characters make processing canonical references problematic exists() implies matches('^[^|# ]+$')
dom-2 error ViewDefinition If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error ViewDefinition If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource contained.where((('#'+id.trace('id') in %resource.descendants().select(reference | as(uri))) or descendants().where(reference='#' | as(uri)='#').exists()).not()).trace('unmatched', id).empty()
dom-4 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice ViewDefinition A resource should have narrative for robust management text.`div`.exists()
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
sql-expressions error ViewDefinition.select Can only have at most one of `forEach`, `forEachOrNull`, or `repeat`. (forEach.exists().toInteger() + forEachOrNull.exists().toInteger() + repeat.exists().toInteger()) <= 1
sql-name error ViewDefinition.name, ViewDefinition.constant.name, ViewDefinition.select.column.name Name is limited to letters, numbers, or underscores and cannot start with an underscore -- i.e. with a regular expression of: ^[A-Za-z][A-Za-z0-9_]*$ This makes it usable as table names in a wide variety of databases. empty() or matches('^[A-Za-z][A-Za-z0-9_]*$')

This structure is derived from ViewDefinition

Summary

Mandatory: 3 elements(1 nested mandatory element)

Maturity: 2

Key Elements View

NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.implicitRules This element is a modifier element. This element is included in summaries. 0..1 uri A set of rules under which this content was created
ViewDefinition.contained 0..* Resource Contained, inline Resources
ViewDefinition.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored
Slice: Unordered, Open by value:url
ViewDefinition.url This element is included in summaries. C 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
Constraints: cnl-1
ViewDefinition.name This element is included in summaries. C 1..1 string Name for this view definition (computer friendly)
Constraints: sql-name
ViewDefinition.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
ViewDefinition.resource 1..1 code FHIR resource for the ViewDefinition
Binding: ResourceType (required)
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
Binding: FHIRVersion (required)
ViewDefinition.select C 1..* BackboneElement A collection of columns and nested selects to include in the view.
Constraints: sql-expressions
ViewDefinition.select.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
ViewDefinition.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.resource Base required Resource Types 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.fhirVersion Base required FHIRVersion 📦6.0.0-snapshot1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
cnl-1 warning ViewDefinition.url URL should not contain | or # - these characters make processing canonical references problematic exists() implies matches('^[^|# ]+$')
dom-2 error ViewDefinition If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error ViewDefinition If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource contained.where((('#'+id.trace('id') in %resource.descendants().select(reference | as(uri))) or descendants().where(reference='#' | as(uri)='#').exists()).not()).trace('unmatched', id).empty()
dom-4 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice ViewDefinition A resource should have narrative for robust management text.`div`.exists()
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
sql-expressions error ViewDefinition.select Can only have at most one of `forEach`, `forEachOrNull`, or `repeat`. (forEach.exists().toInteger() + forEachOrNull.exists().toInteger() + repeat.exists().toInteger()) <= 1
sql-name error ViewDefinition.name Name is limited to letters, numbers, or underscores and cannot start with an underscore -- i.e. with a regular expression of: ^[A-Za-z][A-Za-z0-9_]*$ This makes it usable as table names in a wide variety of databases. empty() or matches('^[A-Za-z][A-Za-z0-9_]*$')

Differential View

This structure is derived from ViewDefinition

NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.url 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
ViewDefinition.name 1..1 string Name for this view definition (computer friendly)
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
ViewDefinition.select
ViewDefinition.select.column
ViewDefinition.select.column.type 1..1 uri A FHIR StructureDefinition URI for the column's type.

doco Documentation for this format

Snapshot ViewView

NameFlagsCard.TypeDescription & Constraints    Filter: doco
ViewDefinition 0..* ViewDefinition(3.0.0-ballot) View Definition
This resource is an additional resource
ViewDefinition.id This element is included in summaries. 0..1 id Logical id of this artifact
ViewDefinition.meta This element is included in summaries. 0..1 Meta Metadata about the resource
ViewDefinition.implicitRules This element is a modifier element. This element is included in summaries. 0..1 uri A set of rules under which this content was created
ViewDefinition.language 0..1 code Language of the resource content
Binding: AllLanguages (required): IETF language tag for a human language
Additional BindingsPurpose
CommonLanguages Starter
ViewDefinition.text 0..1 Narrative Text summary of the resource, for human interpretation
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
ViewDefinition.contained 0..* Resource Contained, inline Resources
ViewDefinition.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored
Slice: Unordered, Open by value:url
ViewDefinition.url This element is included in summaries. C 1..1 uri Canonical identifier for this view definition, represented as an absolute URI (globally unique)
Constraints: cnl-1
ViewDefinition.identifier This element is included in summaries. 0..* Identifier Additional identifier for the view definition
ViewDefinition.version This element is included in summaries. 0..1 string Business version of the view definition
ViewDefinition.versionAlgorithm[x] This element is included in summaries. 0..1 How to compare versions
Binding: VersionAlgorithm (extensible)
ViewDefinition.versionAlgorithm[x].versionAlgorithmString string
ViewDefinition.versionAlgorithm[x].versionAlgorithmCoding Coding
ViewDefinition.name This element is included in summaries. C 1..1 string Name for this view definition (computer friendly)
Constraints: sql-name
ViewDefinition.title This element is included in summaries. 0..1 string Name for this view definition (human friendly)
ViewDefinition.status This element is a modifier element. This element is included in summaries. 1..1 code draft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of an artifact.
ViewDefinition.experimental This element is included in summaries. 0..1 boolean For testing purposes, not real usage
ViewDefinition.date This element is included in summaries. 0..1 dateTime Date last changed
ViewDefinition.publisher This element is included in summaries. 0..1 string Name of the publisher/steward (organization or individual)
ViewDefinition.contact This element is included in summaries. 0..* ContactDetail Contact details for the publisher
ViewDefinition.description 0..1 markdown Natural language description of the view definition
ViewDefinition.useContext This element is included in summaries. 0..* UsageContext The context that the content is intended to support
ViewDefinition.jurisdiction This element is included in summaries. 0..* CodeableConcept Intended jurisdiction for view definition (if applicable)
Binding: JurisdictionValueSet (extensible): Countries and regions within which this artifact is targeted for use.
ViewDefinition.purpose 0..1 markdown Why this view definition is defined
ViewDefinition.copyright 0..1 markdown Use and/or publishing restrictions
ViewDefinition.copyrightLabel 0..1 string Copyright holder and year(s)
ViewDefinition.approvalDate 0..1 date When the view definition was approved by publisher
ViewDefinition.lastReviewDate 0..1 date When the view definition was last reviewed by the publisher
ViewDefinition.effectivePeriod This element is included in summaries. 0..1 Period When the view definition is expected to be used
ViewDefinition.topic 0..* CodeableConcept E.g. Education, Treatment, Assessment, etc
Binding: DefinitionTopic (example)
ViewDefinition.author 0..* ContactDetail Who authored the view definition
ViewDefinition.editor 0..* ContactDetail Who edited the view definition
ViewDefinition.reviewer 0..* ContactDetail Who reviewed the view definition
ViewDefinition.endorser 0..* ContactDetail Who endorsed the view definition
ViewDefinition.relatedArtifact 0..* RelatedArtifact Additional documentation, citations, etc
ViewDefinition.resource 1..1 code FHIR resource for the ViewDefinition
Binding: ResourceType (required)
ViewDefinition.profile 0..* canonical(StructureDefinition) FHIR profiles that this view definition was intended to be executed against
ViewDefinition.fhirVersion 1..* code FHIR version(s) of the resource for the ViewDefinition
Binding: FHIRVersion (required)
ViewDefinition.constant 0..* BackboneElement Constant that can be used in FHIRPath expressions
ViewDefinition.constant.id 0..1 string Unique id for inter-element referencing
ViewDefinition.constant.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.constant.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.constant.name C 1..1 string Name of constant (referred to in FHIRPath as %[name])
Constraints: sql-name
ViewDefinition.constant.value[x] 1..1 Value of constant
ViewDefinition.constant.value[x].valueBase64Binary base64Binary
ViewDefinition.constant.value[x].valueBoolean boolean
ViewDefinition.constant.value[x].valueCanonical canonical(Any)
ViewDefinition.constant.value[x].valueCode code
ViewDefinition.constant.value[x].valueDate date
ViewDefinition.constant.value[x].valueDateTime dateTime
ViewDefinition.constant.value[x].valueDecimal decimal
ViewDefinition.constant.value[x].valueId id
ViewDefinition.constant.value[x].valueInstant instant
ViewDefinition.constant.value[x].valueInteger integer
ViewDefinition.constant.value[x].valueInteger64 integer64
ViewDefinition.constant.value[x].valueOid oid
ViewDefinition.constant.value[x].valueString string
ViewDefinition.constant.value[x].valuePositiveInt positiveInt
ViewDefinition.constant.value[x].valueTime time
ViewDefinition.constant.value[x].valueUnsignedInt unsignedInt
ViewDefinition.constant.value[x].valueUri uri
ViewDefinition.constant.value[x].valueUrl url
ViewDefinition.constant.value[x].valueUuid uuid
ViewDefinition.select C 1..* BackboneElement A collection of columns and nested selects to include in the view.
Constraints: sql-expressions
ViewDefinition.select.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column 0..* BackboneElement A column to be produced in the resulting table.
ViewDefinition.select.column.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.column.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.column.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column.path 1..1 string FHIRPath expression that creates a column and defines its content
ViewDefinition.select.column.name C 1..1 string Column name produced in the output
Constraints: sql-name
ViewDefinition.select.column.description 0..1 markdown Description of the column
ViewDefinition.select.column.collection 0..1 boolean Indicates whether the column may have multiple values.
ViewDefinition.select.column.type 1..1 uri A FHIR StructureDefinition URI for the column's type.
ViewDefinition.select.column.tag 0..* BackboneElement Additional metadata describing the column
ViewDefinition.select.column.tag.id 0..1 string Unique id for inter-element referencing
ViewDefinition.select.column.tag.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.select.column.tag.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.select.column.tag.name 1..1 string Name of tag
ViewDefinition.select.column.tag.value 1..1 string Value of tag
ViewDefinition.select.select 0..* See select (ViewDefinition) Nested select relative to a parent expression.
ViewDefinition.select.forEach 0..1 string A FHIRPath expression to retrieve the parent element(s) used in the containing select. The default is effectively `$this`.
ViewDefinition.select.forEachOrNull 0..1 string Same as forEach, but will produce a row with null values if the collection is empty.
ViewDefinition.select.repeat 0..* string FHIRPath expressions to recursively select from.
ViewDefinition.select.unionAll 0..* See select (ViewDefinition) Creates a union of all rows in the given selection structures.
ViewDefinition.where 0..* BackboneElement A series of zero or more FHIRPath constraints to filter resources for the view.
ViewDefinition.where.id 0..1 string Unique id for inter-element referencing
ViewDefinition.where.extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
ViewDefinition.where.modifierExtension This element is a modifier element. This element is included in summaries. 0..* Extension Extensions that cannot be ignored even if unrecognized
Slice: Unordered, Open by value:url
ViewDefinition.where.path 1..1 string A FHIRPath expression defining a filter condition
ViewDefinition.where.description 0..1 string A human-readable description of the above where constraint.

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
ViewDefinition.language Base required All Languages 📍6.0.0-snapshot1 FHIR Std.
ViewDefinition.versionAlgorithm[x] Base extensible Version Algorithm 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.status Base required PublicationStatus 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.jurisdiction Base extensible Jurisdiction ValueSet ⏿5.0.0 tx.fhir.org
ViewDefinition.topic Base example Definition Topic 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.resource Base required Resource Types 📦6.0.0-snapshot1 FHIR Std.
ViewDefinition.fhirVersion Base required FHIRVersion 📦6.0.0-snapshot1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
cnl-1 warning ViewDefinition.url URL should not contain | or # - these characters make processing canonical references problematic exists() implies matches('^[^|# ]+$')
dom-2 error ViewDefinition If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error ViewDefinition If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource contained.where((('#'+id.trace('id') in %resource.descendants().select(reference | as(uri))) or descendants().where(reference='#' | as(uri)='#').exists()).not()).trace('unmatched', id).empty()
dom-4 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 error ViewDefinition If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice ViewDefinition A resource should have narrative for robust management text.`div`.exists()
ele-1 error **ALL** elements All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
sql-expressions error ViewDefinition.select Can only have at most one of `forEach`, `forEachOrNull`, or `repeat`. (forEach.exists().toInteger() + forEachOrNull.exists().toInteger() + repeat.exists().toInteger()) <= 1
sql-name error ViewDefinition.name, ViewDefinition.constant.name, ViewDefinition.select.column.name Name is limited to letters, numbers, or underscores and cannot start with an underscore -- i.e. with a regular expression of: ^[A-Za-z][A-Za-z0-9_]*$ This makes it usable as table names in a wide variety of databases. empty() or matches('^[A-Za-z][A-Za-z0-9_]*$')

This structure is derived from ViewDefinition

Summary

Mandatory: 3 elements(1 nested mandatory element)

Maturity: 2

 

Other representations of profile: CSV, Excel, Schematron

Notes:

Required FHIRPath Expressions/Functions

All View Runners claiming conformance to the Shareable View Definition profile SHALL implement these FHIRPath capabilities:

Experimental FHIRPath Functions

The following functions are intended for eventual inclusion in the required subset, however they are not yet a part of the normative FHIRPath release and may still be subject to change: