Skip to main content

ViewDefinition

ResourceSQL on FHIR

A ViewDefinition represents a tabular projection of a FHIR resource, where the columns and inclusion criteria are defined by FHIRPath expressions.

Tested supportFull test results →
Backends
PostgreSQLElasticsearch
Interactions
CreateReadUpdatePatchDelete
Search
0 of 0 parameters tested

Structure​

ElementCard.TypeDescription
resourceRequired
1..1codeFHIR resource for the ViewDefinitionBinding (required): resource-types
profile
0..*canonical(StructureDefinition)FHIR profiles that this view definition was intended to be executed against
fhirVersion
0..*codeFHIR version(s) of the resource for the ViewDefinitionBinding (required): FHIR-version
constant
0..*BackboneElementConstant that can be used in FHIRPath expressions
nameRequired
1..1stringName of constant (referred to in FHIRPath as %[name])
value[x]Required
1..1base64Binary | boolean | canonical | code | date | dateTime | decimal | id | instant | integer | oid | string | positiveInt | time | unsignedInt | uri | url | uuidValue of constant
selectRequired
1..*BackboneElementA collection of columns and nested selects to include in the view.
column
0..*BackboneElementA column to be produced in the resulting table.
pathRequired
1..1stringFHIRPath expression that creates a column and defines its content
nameRequired
1..1stringColumn name produced in the output
description
0..1markdownDescription of the column
collection
0..1booleanIndicates whether the column may have multiple values.
type
0..1uriA FHIR StructureDefinition URI for the column's type.
tag
0..*BackboneElementAdditional metadata describing the column
nameRequired
1..1stringName of tag
valueRequired
1..1stringValue of tag
select
0..*Same as ViewDefinition.selectNested select relative to a parent expression.
forEach
0..1stringA FHIRPath expression to retrieve the parent element(s) used in the containing select. The default is effectively `$this`.
forEachOrNull
0..1stringSame as forEach, but will produce a row with null values if the collection is empty.
repeat
0..*stringFHIRPath expressions to recursively select from.
unionAll
0..*Same as ViewDefinition.selectCreates a union of all rows in the given selection structures.
where
0..*BackboneElementA series of zero or more FHIRPath constraints to filter resources for the view.
pathRequired
1..1stringA FHIRPath expression defining a filter condition
description
0..1stringA human-readable description of the above where constraint.

Σ in _summary results · ?! modifier element · 1.. required · inherited elements in grey

Search parameters​

Query with GET [base]/ViewDefinition?[parameter]=[value]. Type decides which modifiers and prefixes apply, see search features.

ViewDefinition defines no search parameters of its own; the common parameters below apply.

PG: PostgreSQL, ES: Elasticsearch. passes its TestScript checks, fails, not tested yet.

Common parameters on every resource (8)
_haste-health-authorreference

The author of the resource

_idtoken

Logical id of this artifact

_lastUpdateddate

When the resource version last changed

_profileuri

Profiles this resource claims to conform to

_securitytoken

Security Labels applied to this resource

_sourceuri

Identifies where the resource comes from

_tagtoken

Tags applied to this resource

_typetoken

Derived from the R4B Definition