This
page
is
part
of
the
Continuous
Integration
Build
of
FHIR
Specification
(v4.0.1:
R4
-
Mixed
Normative
and
STU
)
in
it's
permanent
home
(it
will
always
(will
be
available
incorrect/inconsistent
at
this
URL).
The
current
version
which
supercedes
this
version
is
5.0.0
.
For
a
full
list
of
available
versions,
see
times).
See
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
Responsible
Owner:
FHIR
Infrastructure
Work
Group
|
Standards Status : Normative |
The
FHIR
Specification
uses
FHIRPath
(release
2)
for
path-based
navigation
and
extraction.
FHIRPath
is
a
separate
specification
published
at
http://hl7.org/fhirpath
in
order
to
support
wider
re-use
across
multiple
specifications.
FHIRPath is used in several places in the FHIR and related specifications:
In
addition,
FHIRPath
is
used
and
extended
in
pre-fetch
templates
in
Smart
many
other
contexts
beyond
those
listed
above.
For
additional
examples
and
information
about
other
usage
patterns
and
extensions,
refer
to
the
FHIRPath
Usage
and
Extensions
page
on
FHIR's
CDS-Hooks
HL7's
confluence.

FHIR inter-version compatibility rules allow for non-repeating elements to be made repeating in future FHIR versions. For this reason, FHIRPath expressions SHOULD be written presuming all elements will repeat, even if the current version of the model has a maximum cardinality of '1'.
In FHIRPath, like XPath, operations are expressed in terms of the logical content of hierarchical data models, and support traversal, selection and filtering of data.
FHIRPath uses a tree model that abstracts away the actual underlying data model of the data being queried. For FHIR, this means that the contents of the resources and data types as described in the Logical views (or the UML diagrams) are used as the model, rather than the JSON and XML formats, so specific xml or json features are not visible to the FHIRPath language (such as comments and the split representation of primitives).
More specifically:
contained
element
node
does
not
have
the
name
of
the
Resource
as
its
first
and
only
child
(instead
it
directly
contains
the
contained
resource’s
children)
For
choice
elements
,
where
elements
can
be
one
of
multiple
types,
e.g.
e.g.,
Patient.deceased[x]
.
In
actual
instances
these
will
be
present
as
either
Patient.deceasedBoolean
or
Patient.deceasedDateTime
.
In
FHIRPath,
choice
elements
are
labeled
according
to
the
name
without
the
'[x]'
suffix,
and
children
can
be
explicitly
treated
as
a
specific
type
using
the
as
ofType
operation:
function:
(Observation.value.ofType(Quantity)).unit
FHIRPath statements can start with a full resource name:
Patient.name.given
The name can also include super types such as DomainResource:
DomainResource.contained(id = 23).exists()
These statements apply to any resource that specializes DomainResource .
The
namespace
for
the
types
defined
in
FHIR
(primitive
data
types,
data
types,
datatypes,
datatypes,
resources)
is
FHIR.
So,
for
example:
Patient.is(FHIR.Patient)
The first element - the type name - is not namespaced, but the parameter to the is() operation is.
Understanding the primitive types is critical: FHIR.string is a different type to System.String. The FHIR.string type specializes FHIR.Element, and has the properties id, extension, and also the implicit value property that is actually of type of System.String.
The evaluation engine will automatically convert the value of FHIR types representing primitives to FHIRPath types when they are used in expressions according to the following mapping:
| FHIR primitive type | FHIRPath type |
|---|---|
| FHIR.boolean | System.Boolean |
|
FHIR.string,
FHIR.uri,
FHIR.code,
FHIR.oid,
FHIR.id,
FHIR.uuid,
|
System.String |
| FHIR.integer, FHIR.unsignedInt, FHIR.positiveInt | System.Integer |
| FHIR.integer64 | System.Long |
| FHIR.decimal | System.Decimal |
| FHIR.date, FHIR.dateTime, FHIR.instant | System.DateTime |
| FHIR.time | System.Time |
| FHIR.Quantity | System.Quantity (see below) |
Since
FHIR
primitives
may
contain
extensions,
so
that
the
following
expressions
are
not
mutually
exclusive:
Patient.name.given = 'Ewout' // value of Patient.name.given as a string Patient.name.given.extension.first().value = true // extension of the primitive value !Patient.active.hasValue() and !Patient.active.empty() // can both be true, if there are extensions but no value for Patient.active
The automatic conversion means that in most respects, a FHIR primitive can generally be treated as if it was the equivalent FHIRPath system type. The primary exception is the is() operation, where the difference is explicit:
Patient.name.given.is(FHIR.string) Patient.name.given.is(System.string).not() Patient.name.given.getValue().is(System.string)
This also applies to e.g. Resource.id:
Patient.id is System.String (Patient.id is FHIR.id).not
As
shown,
all
FHIR
primitives
have
the
operation
getValue()
defined
(see
below)
for
the
few
edge
cases
where
the
automatic
conversion
isn't
appropriate.
Note
that
as()
ofType()
does
not
have
such
restrictions
-
both
of
the
following
are
valid:
Patient.name.given.ofType(FHIR.string) Patient.name.given.ofType(System.string)
The
Mapping
from
FHIR
Quantity
to
FHIRPath
System.Quantity
can
only
be
applied
if
the
FHIR
Quantity
has
a
UCUM
code
-
i.e.
i.e.,
a
system
of
http://unitsofmeasure.org
,
and
a
code
is
present.
As
part
of
the
mapping,
time-valued
UCUM
units
are
mapped
to
the
calendar
duration
units
defined
in
FHIRPath,
according
to
the
following
map:
| a | year |
| mo | month |
| d | day |
| h | hour |
| min | minute |
| s | second |
e.g.
the
i.e.,
The
FHIR
Quantity
1
'a'
would
be
implicitly
converted
to
the
FHIRPath
System.Quantity
1
'year'.
Note
that
there's
a
subtle
difference
between
the
UCUM
definitions
for
a
and
mo
,
which
are
definition
durations
of
365.25
and
30
days
respectively,
while
year
and
month
are
calendar
based
durations,
and
their
length
of
time
varies.
See
Time-valued
Quantities
for
further
discussion.
Implementers
should
be
aware
of
these
subtle
differences,
but
in
general,
this
approach
matches
what
users
expect
most
closely.
FHIR defines two specific variables that are always in scope when FHIRPath is used in any of the contexts above:
%resource // the resource that contains the original node that is in %context
%rootResource // the container resource for the resource identified by %resource
%profile // the canonical URL of a profile that contains the invariant's fhirpath expression (only defined in profile invariants)
// Note: not all fhirpath engines support this profile variable, or the slice() function that usually uses it.
The resource is very often the context, such that %resource = %context. When a DomainResource contains another resource, and that contained resource is the focus (%resource) then %rootResource refers to the container resource. Note that in most cases, the resource is not contained by another resource, and then %rootResource is the same as %resource.
In addition to the general purpose variables above, additional variables and/or guidance about variable use are defined when working with specific resources. Refer to the following for additional FHIRPath guidance defined for:
FHIR
adds
(compatible)
functionality
to
the
common
set
of
functions:
common
FHIRPath
functions.
Some
of
these
functions
are
candidates
for
elevation
to
the
base
version
of
FHIRPath
when
the
next
version
is
released.
In addition to the general purpose functions below, additional functions function use are defined when working with specific resources. Refer to the following for additional FHIRPath guidance defined for:
Will
filter
the
input
collection
for
items
named
"extension"
with
the
given
url.
url
.
This
is
a
syntactical
shortcut
for
.extension.where(url
=
string)
,
but
is
simpler
to
write.
Will
return
an
empty
collection
if
If
the
input
collection
is
empty
or
the
url
is
empty.
empty,
the
return
value
will
be
an
empty
collection.
Patient.extension('http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName').value
Returns
true
if
If
the
input
collection
contains
a
single
value
which
is
a
FHIR
primitive,
and
it
has
then
will
return
true
if
the
single
value
is
a
primitive
value
(e.g.
(e.g.,
as
opposed
to
not
having
a
value
and
just
having
extensions).
extensions)
and
false
if
not.
If
the
input
collection
isn't
a
single
FHIR
primitive,
the
return
value
is
empty.
Note to implementers : The FHIR conceptual model talks about "primitives" as subclasses of the type Element that also have id and extensions. What this actually means is that a FHIR primitive is not a primitive in an implementation language. The introduction (section 2 above) describes the navigation tree as if the FHIR model applies - primitives are both primitives and elements with children.
In FHIRPath, this means that FHIR primitives have a
valuechild, but, as described above, they are automatically cast to FHIRPath primitives when comparisons are made, and that the primitive value will be included in the set returned bychildren()ordescendants().
Patient.active.hasValue()
When
FHIRPath
statements
are
used
in
an
invariant,
the
log
contents
should
be
added
to
If
the
error
message
constructed
when
input
collection
contains
a
single
item,
this
function
will
return
a
single
String
if
the
invariant
type
is
violated.
For
example:
"SHALL have a local reference if the resource is provided inline (url: height; ids: length,weight)"
from
"reference.startsWith('#').not() or
(%context.reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))"
The
FHIRPath
specification
adds
an
additional
parameter
to
a
primitive,
and
it
has
a
value
(e.g.
if
hasValue()
=
true
),
and
the
trace()
function,
primitive
type
has
a
selection
expression
that
can
be
used
to
shape
what
is
logged
System
type
for
which
toString()
is
defined
.
Otherwise
the
collection
that
result
is
traced.
E.g.
an
empty
collection.
Patient.birthDate.toString()
This
will
log
Return
the
type/name
underlying
system
value
for
each
contained
resource
that
meets
the
criteria.
Note:
FHIR
primitive
if
the
selector
parameter
input
collection
contains
a
single
value
which
is
planned
to
be
added
to
a
future
version
of
FHIR
primitive,
and
it
has
a
primitive
value
(see
discussion
for
hasValue()).
Otherwise,
the
base
FHIRPath
specification.
return
value
is
empty.
Patient.birthDate.getValue() // returns just the primitive, does not include extensions (such as the birthTime extension)
For each item in the collection, if it is a string that is a uri (or canonical or url ), locate the target of the reference, and add it to the resulting collection. If the item does not resolve to a resource, the item is ignored and nothing is added to the output collection.
The
items
in
the
collection
may
also
represent
a
Reference,
in
which
case
the
Reference.reference
is
resolved.
If
the
input
is
empty,
the
return
value
will
be
an
empty
collection.
Patient.managingOrganization.resolve().name Observation.subject.where(resolve() is Patient)
In
Returns
a
collection
that
contains
all
items
in
the
input
collection
that
are
of
the
given
type
or
a
subclass
thereof.
This
is
as
defined
as
in
the
base
FHIRPath
specification,
but
implementers
should
be
aware
that
in
FHIR,
only
concrete
core
types
are
allowed
as
an
argument.
All
primitives
are
considered
to
be
independent
types
(so
markdown
is
not
a
subclass
of
string
).
Profiled
types
are
not
allowed,
so
to
select
SimpleQuantity
one
would
pass
Quantity
as
an
argument.
Observation.value.ofType(canonical) Observation.value.ofType(dateTime) | Observation.value.ofType(Period).start // selects either dateTime or Period starts (both of type dateTime)
Returns the FHIR element definition information for each element in the input collection. If the input collection is empty, the return value will be an empty collection.
Returns
the
given
slice
as
defined
in
input
collection
filtered
to
items
that
conform
to
the
given
structure
definition.
specified
profile
slice.
The
structure
argument
is
a
the
(possibly
versioned)
canonical
uri
that
resolves
to
of
the
structure
definition,
and
definition
that
contains
the
specified
slice.
The
name
argument
is
either
the
must
be
name
of
a
ElementDefinition.sliceName
for
the
element
slice
within
that
(if
the
sliceName
is
unique
in
the
snapshot),
or
the
ElementDefinition.id
of
the
element
slice.
The
structure
argument
can
also
be
the
special
variable
definition.
%profile
which
refers
to
the
profile
in
which
the
ElementDefinition.constraint
containing
the
FHIRPath
is
defined.
(This
variable
can
only
be
used
for
FHIRPath
appearing
in
constraints)
If
the
structure
cannot
be
resolved,
or
the
name
of
the
slice
within
the
resolved
structure
is
not
present,
an
error
is
thrown.
For
every
element
present
in
the
input
collection,
if
the
resolved
slice
is
present
on
profile,
or
those
parameters
are
empty,
the
element,
it
return
value
will
be
returned.
an
empty
collection.
If
the
slice
does
not
match
any
element
in
the
input
collection,
or
if
the
input
collection
is
empty,
the
result
is
return
value
will
be
an
empty
collection
(
{
}
).
collection.
For example, this invariant could appear in a Patient profile:
// ensure that a patient has at least one home phone and one home email (based on the slicing defined in the profile) Patient.telecom.slice(%profile, 'homephone').exists() and Patient.telecom.slice(%profile, 'homeemail').exists()
NOTE:
not
all
FHIRPath
engines
are
in
a
position
to
implement
slice()
as
implementation
requires
implementation
of
a
FHIR
validation
engine,
which
is
not
a
small
undertaking.
For
each
element
in
the
input
collection,
verifies
that
there
are
no
modifying
extensions
defined
other
than
the
ones
given
by
the
modifier
argument.
argument
(comma-separated
string).
If
the
check
passes,
the
input
collection
is
returned.
Otherwise,
an
error
is
thrown.
thrown,
including
if
modifier
is
empty.
Returns
true
if
the
single
input
element
conforms
to
the
profile
specified
by
the
structure
argument,
and
false
otherwise.
If
the
input
is
not
a
single
item,
the
structure
is
empty,
or
the
structure
cannot
be
resolved
to
a
valid
profile,
an
error
is
thrown.
If
the
input
contains
more
than
one
element,
an
error
is
thrown.
If
the
input
is
empty,
the
result
return
value
is
empty.
Patient.conformsTo('http://hl7.org/fhir/StructureDefinition/Patient')
When
invoked
on
a
single
code-valued
element,
returns
true
if
the
code
is
a
member
of
the
given
valueset.
valueset
.
When
invoked
on
a
single
concept-valued
element,
returns
true
if
any
code
in
the
concept
is
a
member
of
the
given
valueset.
When
invoked
on
a
single
string,
returns
true
if
the
string
is
equal
to
a
code
in
the
valueset,
so
long
as
the
valueset
only
contains
one
codesystem.
If
the
valueset
in
this
case
contains
more
than
one
codesystem,
an
error
the
return
value
is
thrown.
empty.
If
the
valueset
cannot
be
resolved
as
a
uri
to
a
value
set,
an
error
or
the
input
is
thrown.
empty
or
has
more
than
one
value,
the
return
value
is
empty.
Note that implementations are encouraged to make use of a terminology service to provide this functionality.
For example:
Observation.component.where(code.memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult'))
This expression returns components that have a code that is a member of the observation-vitalsignresult valueset.
When
invoked
on
a
Coding-valued
element
and
the
given
code
is
Coding-valued,
returns
true
if
the
source
code
is
equivalent
to
the
given
code,
or
if
the
source
code
subsumes
the
given
code
(i.e.
(i.e.,
the
source
code
is
an
ancestor
of
the
given
code
in
a
subsumption
hierarchy),
and
false
otherwise.
If
the
Codings
are
from
different
code
systems,
the
relationships
between
the
code
systems
must
be
well-defined
or
a
run-time
error
the
return
value
is
thrown.
empty.
When the source or given elements are CodeableConcepts, returns true if any Coding in the source or given elements is equivalent to or subsumes the given code.
If either the input or the code parameter are not single value collections, the return value is empty.
Note that implementations are encouraged to make use of a terminology service to provide this functionality.
%terminologies.subsumes(Procedure.category, Procedure.code) = 'subsumes'
When
invoked
on
a
Coding-valued
element
and
the
given
code
is
Coding-valued,
returns
true
if
the
source
code
is
equivalent
to
the
given
code,
or
if
the
source
code
is
subsumed
by
the
given
code
(i.e.
(i.e.,
the
given
code
is
an
ancestor
of
the
source
code
in
a
subsumption
hierarchy),
and
false
otherwise.
If the Codings are from different code systems, the relationships between the code systems must be well-defined or a run-time error is thrown.
When the source or given elements are CodeableConcepts, returns true if any Coding in the source or given elements is equivalent to or subsumed by the given code.
If either the input or the code parameter are not single value collections, the return value is empty.
Note that implementations are encouraged to make use of a terminology service to provide this functionality.
When
invoked
on
an
a
single
xhtml
element
returns
true
if
the
rules
around
HTML
usage
are
met,
and
false
if
they
are
not.
The
return
value
is
undefined
(
empty
on
any
other
kind
of
element,
or
a
collection
of
xhtml
elements.
This
function
returns
the
lowest
possible
value
in
the
natural
range
expressed
by
the
type
it
is
invoked
on.
e.g.,
the
lowBoundary
of
null
1.0
)
is
0.95000000000
,
and
the
lowBoundary
of
2010-10-10
is
2010-10-10T00:00:00.000+14:00
.
This
function
can
be
invoked
in
any
singleton
primitive
type
that
has
a
value
domain
with
a
natural
sort
order:
decimal
,
integer
,
dateTime
,
instant
,
date
,
time
and
Quantity
.
This
function
is
defined
for
use
with
continuously
distributed
value
domains
to
help
deal
with
precision
issues.
The
return
value
is
considered
to
have
arbitrarily
high
precision
(as
precise
as
the
underlying
implementation
can
be).
The
function
is
not
very
useful
on
integer,
since
it
is
not
a
continuously
distributed
value
domain,
and
the
lowBoundary
of
an
integer
is
always
the
same
value,
but
it
is
defined
on
integer
for
language
consistency.
This function is intended to be added to the core FHIRPath specification in a future version.
This
function
returns
the
lowest
possible
value
in
the
natural
range
expressed
by
the
type
it
is
invoked
on.
e.g.,
the
highBoundary
of
1.0
is
1.05000000000
,
and
the
highBoundary
of
2010-10-10
is
2010-10-10T23:59:59.999-12:00
.
This
function
can
be
invoked
in
any
singleton
primitive
type
that
has
a
value
domain
with
a
natural
sort
order:
decimal
,
integer
,
dateTime
,
instant
,
date
,
time
and
Quantity
.
This
function
is
defined
for
use
with
continuously
distributed
value
domains
to
help
deal
with
precision
issues.
The
return
value
is
considered
to
have
arbitrarily
high
precision
(as
precise
as
the
underlying
implementation
can
be).
The
function
is
not
very
useful
on
integer,
since
it
is
not
a
continuously
distributed
value
domain,
and
the
highBoundary
of
an
integer
is
always
the
same
value,
but
it
is
defined
on
integer
for
language
consistency.
This function is intended to be added to the core FHIRPath specification in a future version.
This
function
returns
true
if
the
engine
executing
the
FHIRPath
statement
can
compare
the
singleton
Quantity
with
the
singleton
other
kind
Quantity
and
determine
their
relationship
to
each
other.
Comparable
means
that
both
have
values
and
that
the
code
and
system
for
the
units
are
the
same
(irrespective
of
element.
system)
or
both
have
code
+
system,
system
is
recognized
by
the
FHIRPath
implementation
and
the
codes
are
comparable
within
that
code
system.
e.g.,
days
and
hours
or
inches
and
cm.
This function is intended to be added to the core FHIRPath specification in a future version.
Equivalence works in exactly the same manner, but with the addition that for complex types, equality requires all child properties to be equal, except for "id" elements .
In addition, for Coding values, equivalence is defined based on the code and system elements only. The version, display, and userSelected elements are ignored for the purposes of determining Coding equivalence.
For CodeableConcept values, equivalence is defined as a non-empty intersection of Coding elements, using equivalence. In other words, two CodeableConcepts are considered equivalent if any Coding in one is equivalent to any Coding in the other.
The FHIR specification adds support for additional environment variables:
The following environmental values are set for all contexts:
%sct // (string) url for snomed ct %loinc // (string) url for loinc %`vs-[name]` // (string) full url for the provided HL7 value set with id [name] %`ext-[name]` // (string) full url for the provided HL7 extension with id [name] %resource // The original resource current context is part of. When evaluating a datatype, this would be the resource the element is part of. Do not go past a root resource into a bundle, if it is contained in a bundle. // Note that the names of the `vs-` and `ext-` constants are quoted (just like paths) to allow "-" in the name.
For example:
Observation.component.where(code.memberOf(%`vs-observation-vitalsignresult`))
This expression returns components that have a code that is a member of the observation-vitalsignresult valueset.
Implementation Note: Implementation Guides are allowed to define their own externals, and implementers should provide some appropriate configuration framework to allow these constants to be provided to the evaluation engine at run-time. E.g.:
%"us-zip" = '[0-9]{5}(-[0-9]{4}){0,1}'%`us-zip` = '[0-9]{5}(-[0-9]{4}){0,1}'
Authors of Implementation Guides should be aware that adding specific environment variables restricts the use of the FHIRPath to their particular context.
Note that these tokens are not restricted to simple types, and they may have fixed values that are not known before evaluation at run-time, though there is no way to define these kinds of values in implementation guides.
This
page
documents
a
restricted
subset
of
the
FHIRPath
language
that
is
used
in
a
few
contexts
in
this
specification.
When
the
restricted
FHIRPath
language
subset
is
in
use,
the
following
rules
apply:
These rules exist to keep processing the path simple to support use of the path by processors that are not backed by a full FHIRPath implementation.
The following locations use this restricted FHIRPath language:
The
variable
%factory
is
a
reference
to
a
class
factory
that
provides
the
following
type
methods.
Note
that
a
future
version
of
FHIRPath
may
provide
a
factory
framework
directly,
in
which
case
this
page,
the
FHIR
Terminology
service
factory
API
may
be
withdrawn
or
deprecated.
This API provides specific methods for constructing common types, and some general methods for constructing any type.
For
the
specific
type
constructors,
all
the
parameters
are
optional.
Note
that
since
all
variables
/
outputs
in
FHIRPath
are
collections,
all
the
parameters
are
inherently
collections,
but
when
the
underlying
element
referred
to
is
only
draft
(Maturity
=
0).
It
a
singleton
element,
the
collection
cannot
contain
more
than
one
item.
Use
the
value
{}
if
there
is
no
value
to
provide.
Create
an
instance
of
the
type
with
the
value
and
possibly
one
or
more
extensions.
e.g.,
%factory.code('final')
.
Parameters:
Return Value: the primitive type, or an error.
Creates
an
extension
with
the
given
url
and
value:
%factory.extension('http://hl7.org/fhir/StructureDefinition/artifact-copyrightLabel',
'CC0-1.0')
.
Parameters:
Return Value: An extension with the specified properties.
Creates
an
identifier
with
the
given
properties:
%factory.Identifier('urn:ietf:rfc:3986',
'urn:oid:1.2.3.4.5',
'official')
.
Parameters:
Return Value: An identifier with the specified properties .
Create
a
human
name
with
the
given
properties:
%factory.HumanName('Smith',
'Julia',
{},
{},
'Julia
Smith')
.
Parameters:
Return Value: a HumanName.
Creates
a
ContactPoint:
%factory.ContactPoint('email',
'coyote@acme.com',
'work')
Parameters:
Return Value: a ContactPoint.
Creates
an
Address:
%factory.Address('5
Nowhere
Road',
'coyote@acme.com',
'EW',
'0000',
{},
'home',
'physical')
Parameters:
Return Value: An address.
Creates
a
Quantity:
%factory.Quantity('http://unitsofmeasure.org',
'mg/dL',
'5.03',
'mg/dL')
Parameters:
Return Value: a Quantity.
Creates
a
Coding:
%factory.Coding('http://loinc.org',
'1234-5,
'An
example
test',
'1.02')
Parameters:
Return Value: A coding.
Creates
a
CodeableConcept:
%factory.CodeableConcept(%factory.Coding(...),
"Example
Test")
Parameters:
Return Value: a CodeableConcept.
For
the
general
type
constructors,
all
the
parameters
are
mandatory.
Note
that
since
all
variables
/
outputs
in
FHIRPath
are
collections,
all
the
parameters
are
inherently
collections,
but
when
the
underlying
property
referred
to
is
a
singleton
element,
the
collection
cannot
contain
more
mature
status
following
than
one
item.
Use
the
usual
Maturity
Model
value
{}
if
there
is
no
value
to
provide.
Create
an
instance
of
the
named
type:
%factory.create(SampledData)
Parameters:
Return Value: an instance of the named type.
Add
an
extension,
and
return
the
new
type:
%factory.withExtension(%factory.create(Money),
'http:/acme.com/extension/example',
%factory.code('test'))
Parameters:
Return Value: A copy of the instance of the type with the extension added. Extensions that already exist with the same url are not removed.
Set
a
property
value,
and
return
the
new
type:
%factory.withProperty(%factory.create(Address),
'http:/acme.com/extension/example',
%factory.create(Period))
Parameters:
Return
Value:
A
copy
of
the
instance
of
the
type
with
the
named
property
set.
Any
existing
value(s)
for
FHIR.
the
named
property
will
be
deleted.
In order to support terminological reasoning in FHIRPath statements, FHIR defines a general %terminologies object that FHIRPath implementations should make available. Calls to this object are passed through a standard FHIR terminology service .
Summary:
%terminologies : TerminologyServer // default terminology server (application controls context) %terminologies.at(url) : TerminologyServer // terminology server at specified address %terminologies.expand(valueSet, params) : ValueSet %terminologies.lookup(coded, params) : Parameters %terminologies.validateVS(valueSet, coded, params) : Parameters %terminologies.validateCS(codeSystem, coded, params) : Parameters %terminologies.subsumes(system, coded1, coded2, params) : code %terminologies.translate(conceptMap, code, params) : Parameters
For all these functions, if any of the parameters are empty, or a collection with more than one value, or one or more of the parameters are not valid, the return value is empty.
Get a terminology server object pointing at a particular server. Note: The %terminologies object points to the default terminology server as specified by the application evaluating the FHIRPath.
Parameters:
Return Value: A terminology server that points at the specified URL. No errors - they will come when/if the terminology server object is used.
This calls the Terminology Service $expand operation ( formal definition ).
Parameters:
Return
Value:
a
ValueSet
with
an
expansion,
or
null
if
expansion.
If
an
error
occurs.
occurs,
the
return
value
is
empty.
This calls the Terminology Service $lookup operation ( formal definition ).
Parameters:
Return Value:
This calls the Terminology Service $validate-code operation on a value set ( formal definition ).
Parameters:
Return Value: A Parameters resource with the results of the validation operation.
This calls the Terminology Service $validate-code operation on a code system ( formal definition ).
Parameters:
Return Value: A Parameters resource with the results of the validation operation.
This calls the Terminology Service $subsumes operation ( formal definition ).
Parameters:
Return Value: a code as specified for the subsumes operation.
This calls the Terminology Service $translate operation ( formal definition ).
Parameters:
Return Value: A Parameters resource with the results of the translation operation.
In order to support interaction with a server in FHIRPath statements, FHIR defines a general %server object that FHIRPath implementations should make available. Calls to this object are passed through a FHIR RESTful framework .
Summary:
%server : Server // default server (application controls context) %server.at(url) : Server // server at specified address %server.read(type, id) : Resource %server.create(resource) : Resource %server.update(resource) : Resource %server.delete(resource) : boolean %server.patch(parameters) : Resource %server.search(doPost, parameters) : Bundle %server.capabilities(mode) : Resource %server.validate(resource, mode, parameters) : OperationOutcome %server.transform(source, content) : Resource %server.everything(type, id, parameters) : Bundle %server.apply(resource, subject, parameters) : Bundle
Get a server object pointing at a particular server. Note: The %server object points to the default server as specified by the application evaluating the FHIRPath.
Parameters:
Return Value: A server that points at the specified URL. No errors - they will come when/if the server object is used.
Get a resource from the server.
Parameters:
Return Value: The resource at type/id. If not found, the return value is empty.
Create a resource on the server.
Parameters:
Return Value: The resource after it was stored. If the create operation failed, the return value is empty.
Store a resource on the server.
Parameters:
Return Value: The resource after it was stored. If the create operation failed, the return value is empty.
Delete a resource on the server.
Parameters:
Return Value: true if the resource was deleted, or false.
Perform a search on the server.
Parameters:
Return Value: A bundle with the search results. If the search fails, the return value is empty.
Perform a patch operation on the server.
Parameters:
Return Value: The resource after the patch. If the patch fails, the return value is empty.
Get the capabilities from the server
Parameters:
Return Value: The resource returned (CapabilitiesStatement or TerminologyCapabilities resource). If not available, the return value is empty.
Validate a resource on the server.
Parameters:
Return Value: An operation outcome with issues. If the validation couldn't be performed, the return value is empty.
Run the $transform operation on the server.
Parameters:
Return Value: The resource returned from the transform. If the transform fails, the return value is empty.
Get a resource from the server.
Parameters:
Return Value: The Bundle for type/id. If not available, the return value is empty.
Get a resource from the server.
Parameters:
Return Value: The bundle from $apply. If the operation fails, the return value is empty.