This
page
is
part
of
the
FHIR
Specification
(v5.0.0:
R5
(v4.0.1:
R4
-
Mixed
Normative
and
STU
).
This
is
the
)
in
it's
permanent
home
(it
will
always
be
available
at
this
URL).
The
current
published
version.
version
which
supercedes
this
version
is
5.0.0
.
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
R3
R2
|
|
Maturity Level : N | Normative (from v4.0.0) |
Compartments
:
|
|
|
This
page
has
been
approved
as
part
of
an
ANSI
standard.
See
the
Infrastructure
Package
for
further
details.
|
A domain resource is a resource that:
As an abstract resource, this resource is never created directly; instead, one of its descendant resources ( see List of Resources ) is created.
This resource extends the base Resource . All of the listed Resources except Bundle , Parameters and Binary extend this resource.
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
Resource |
A
resource
with
narrative,
extensions,
and
contained
resources
+ Rule: If the resource is contained in another resource, it SHALL NOT contain nested Resources + Rule: 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 + Rule: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + Rule: If a resource is contained in another resource, it SHALL NOT have a security label + Guideline: A resource should have narrative for robust management Elements defined in Ancestors: id , meta , implicitRules , language |
|
|
|
0..1 | Narrative | Text summary of the resource, for human interpretation |
|
|
0..* | Resource |
Contained,
inline
Resources
|
|
0..* | Extension |
Additional
content
defined
by
implementations
|
|
|
?!
|
0..* | Extension |
Extensions
that
cannot
be
ignored
|
Documentation
for
this
format
|
||||
UML Diagram ( Legend )
XML Template
<[name] xmlns="http://hl7.org/fhir"><!-- from Element: extension --> <text><!-- 0..1 Narrative Text summary of the resource, for human interpretation --></text> <contained><!-- 0..* Resource Contained, inline Resources --></contained> <extension><!-- 0..* Extension Additional content defined by implementations --></extension> <modifierExtension><!-- 0..* Extension Extensions that cannot be ignored --></modifierExtension> </[name]>
JSON Template
{
"resourceType" : "[name]",
// from Resource: id, meta, implicitRules, and language
"text" : { Narrative }, // Text summary of the resource, for human interpretation
"contained" : [{ Resource }], // Contained, inline Resources
(Extensions - see JSON page)
(Modifier Extensions - see JSON page)
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:[name]; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: Element.extension fhir:DomainResource.text [ Narrative ]; # 0..1 Text summary of the resource, for human interpretation fhir:DomainResource.contained [ Resource ], ... ; # 0..* Contained, inline Resources fhir:DomainResource.extension [ Extension ], ... ; # 0..* Additional content defined by implementations fhir:DomainResource.modifierExtension [ Extension ], ... ; # 0..* Extensions that cannot be ignored ]
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
Resource |
A
resource
with
narrative,
extensions,
and
contained
resources
+ Rule: If the resource is contained in another resource, it SHALL NOT contain nested Resources + Rule: 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 + Rule: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + Rule: If a resource is contained in another resource, it SHALL NOT have a security label + Guideline: A resource should have narrative for robust management Elements defined in Ancestors: id , meta , implicitRules , language |
|
|
|
0..1 | Narrative | Text summary of the resource, for human interpretation |
|
|
0..* | Resource |
Contained,
inline
Resources
|
|
0..* | Extension |
Additional
content
defined
by
implementations
|
|
|
?!
|
0..* | Extension |
Extensions
that
cannot
be
ignored
|
Documentation
for
this
format
|
||||
XML Template
<[name] xmlns="http://hl7.org/fhir"><!-- from Element: extension --> <text><!-- 0..1 Narrative Text summary of the resource, for human interpretation --></text> <contained><!-- 0..* Resource Contained, inline Resources --></contained> <extension><!-- 0..* Extension Additional content defined by implementations --></extension> <modifierExtension><!-- 0..* Extension Extensions that cannot be ignored --></modifierExtension> </[name]>
JSON Template
{
"resourceType" : "[name]",
// from Resource: id, meta, implicitRules, and language
"text" : { Narrative }, // Text summary of the resource, for human interpretation
"contained" : [{ Resource }], // Contained, inline Resources
(Extensions - see JSON page)
(Modifier Extensions - see JSON page)
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:[name]; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: Element.extension fhir:DomainResource.text [ Narrative ]; # 0..1 Text summary of the resource, for human interpretation fhir:DomainResource.contained [ Resource ], ... ; # 0..* Contained, inline Resources fhir:DomainResource.extension [ Extension ], ... ; # 0..* Additional content defined by implementations fhir:DomainResource.modifierExtension [ Extension ], ... ; # 0..* Extensions that cannot be ignored ]
|
|
Level | Location | Description | Expression |
|
|
Rule | (base) | If the resource is contained in another resource, it SHALL NOT contain nested Resources | contained.contained.empty() |
|
|
Rule | (base) | 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
in
(%resource.descendants().reference
|
|
|
|
Rule | (base) | 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() |
|
|
Rule | (base) | If a resource is contained in another resource, it SHALL NOT have a security label | contained.meta.security.empty() |
|
|
Guideline | (base) | A resource should have narrative for robust management |
text.`div`.exists()
This is (only) a best practice guideline because:
|
The
'contained'
mechanism
is
not
permitted
as
a
means
of
reducing
server
calls.
I.e.,
It
is
not
allowed
to
package
a
set
of
resources
as
one
base
resource
and
a
set
of
contained
resources
to
allow
multiple
creates
or
updates
to
happen
in
a
single
transaction,
nor
is
it
permitted
to
use
'contained'
as
a
means
of
retrieving
multiple
resources
in
a
single
'read'.
'contained'
is
only
To
search
for
use
when
there
is
a
need
to
reference
another
resource,
but
the
target
resource
does
not
have
any
independence
from
the
referencing
resource.
Most
commonly,
this
occurs
when
not
enough
information
is
known
to
allow
uniquely
identifying
the
target
resource.
For
example,
if
extensions,
define
a
surgeon
is
known
only
as
"Dr.
Smith"
(no
full
name,
no
license
number,
etc.),
then
there
would
be
no
way
of
determining
which
of
the
candidate
"Dr.
Smith"
practitioners
was
being
referenced.
In
that
situation,
it
would
be
reasonable
SearchParameter
for
the
Procedure
to
have
a
'contained'
reference
to
the
Practitioner.
In
extension.
All
other
cases,
there
might
be
enough
information
to
construct
an
independent
resource,
but
system
behavior
does
not
recognize/permit
an
independent
identity.
As
an
example,
a
prescriber
might
create
a
prescription
search
parameters
are
named
aliases
for
a
custom
compound.
However,
rather
than
registering
the
compound
as
a
new
'Medication'
instance
(that
could
be
pointed
to
by
many
prescriptions/dispenses),
the
system
treats
the
compound
recipe
as
'part'
of
the
prescription
-
it
can
only
be
edited/modified
existing
content
in
the
context
of
that
one
prescription
and
cannot
be
queried
or
manipulated
independently.
If
the
prescription
were
deleted,
resource.
In
some
cases,
though
not
all,
the
Medication
would
be
deleted
as
well.
This
would
be
an
appropriate
use
of
'contained'.
A
key
consideration
with
respect
to
'contained'
resources
is
that
if
a
resource
is
sent
to
a
server
as
'contained',
then
it
is
expected
to
remain
'contained'
(at
least
until
a
formal
update
search
parameter
name
is
received
that
removes
the
'contained'
resource
and
perhaps
replaces
it
with
a
reference
to
a
stand-alone
resource
due
to
additional
information
now
being
available).
For
implementations
concerned
about
minimizing
the
number
of
service
calls,
FHIR
provides
a
number
of
options:
When
sending
creates
or
updates,
leverage
the
transaction
feature
to
create/update
multiple
(interrelated)
resources
at
once
When
querying
for
data,
make
use
of
_include
and
_revinclude
to
return
additional
resources
that
are
relevant
same
as
part
of
the
query
Operations
can
be
defined
element
that
allow
manipulation
or
retrieval
of
multiple
resources
as
part
of
a
single
action.
The
document
and
messaging
paradigms
also
support
the
simultaneous
transport
of
multiple
resources.
REST
can
be
somewhat
heavy
in
terms
of
the
number
of
service
calls
needed
to
manipulate
all
desired
resources.
This
it
searches,
but
this
is
part
of
the
cost
associated
with
the
flexibility
that
allows
a
single
RESTful
interface
to
support
a
wide
range
of
use-cases.
2.1.27.6.5
Searching
Extensions
The
FHIR
specification
does
not
define
SearchParameters
for
most
of
the
standard
extensions
we
publish
and
obviously
cannot
define
SearchParameters
required.
Searching
for
extensions
developed
by
implementers
outside
is
the
core
FHIR
specification.
However,
implementers
are
free
to
same
-
define
their
own
SearchParameters
for
any
extensions
they
make
use
of
and
servers
are
free
to
support
SearchParameters
above
and
beyond
those
published
as
part
of
the
FHIR
core
specification.
There
are
no
formal
naming
rules
for
extension-based
search
parameters.
Authors
SHOULD
name
the
search
parameters
in
such
a
way
name
that
identifies
the
linkage
between
the
value
extension
name
by
its
URL,
and
then
searches
can
filter
based
on
the
search
parameter
is
obvious.
The
expression
for
the
search
parameter
would
typically
end
with
extension('http://yourextensionurlhere').value
.
The
expression
would
also
need
to
provide
a
path
to
value
of
the
extension,
including
handling
situations
where
an
extension
appears
on
multiple
paths
if
necessary.
Additional
constraints
could
also
be
added
if
necessary
(e.g.
.exists()
,
=true
,
etc.)
extension.
Search
Common
search
parameters
defined
by
this
abstract
resource
for
all
descendents.
resource.
See
Searching
for
more
information
about
searching
in
REST,
messaging,
and
services.
| Name | Type | Description | Paths |
| _text |
|
Search on the narrative of the resource |