This
page
is
part
of
the
Snapshot
#3
for
FHIR
Specification
(v4.0.1:
R4
-
Mixed
Normative
and
STU
)
in
it's
permanent
home
(it
will
always
be
available
at
this
URL).
The
current
version
which
supercedes
this
version
is
5.0.0
R5
,
released
to
support
Connectathon
32
.
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
R3
R2
|
|
Maturity
Level
:
|
|
Compartments
:
|
Structure
Name
Flags
Card.
Type
Description
&
Constraints
Binary
N
Resource
Pure
binary
content
defined
by
a
format
other
than
FHIR
Elements
defined
in
Ancestors:
id
,
meta
,
implicitRules
,
language
contentType
Σ
1..1
code
MimeType
of
the
binary
content
MimeType
(
Required
)
securityContext
Σ
0..1
Reference
(
Any
)
Identifies
another
resource
to
use
as
proxy
when
enforcing
access
control
data
0..1
base64Binary
The
actual
content
Documentation
for
this
format
UML
Diagram
(
Legend
)
Binary
(
Resource
)
MimeType
of
the
binary
content
represented
as
a
standard
MimeType
(BCP
13)
contentType
:
code
[1..1]
«
The
mime
type
of
an
attachment.
Any
valid
mime
type
is
allowed.
(Strength=Required)
Mime
Types
!
»
This
element
identifies
another
resource
that
can
be
used
as
a
proxy
of
the
security
sensitivity
to
use
when
deciding
and
enforcing
access
control
rules
for
the
Binary
resource.
Given
that
the
Binary
resource
contains
very
few
elements
that
can
be
used
to
determine
the
sensitivity
of
the
data
and
relationships
to
individuals,
the
referenced
resource
stands
in
as
a
proxy
equivalent
for
this
purpose.
This
referenced
resource
may
be
related
to
the
Binary
(e.g.
Media,
DocumentReference),
or
may
be
some
non-related
Resource
purely
as
a
security
proxy.
E.g.
to
identify
that
the
binary
resource
relates
to
a
patient,
and
access
should
only
be
granted
to
applications
that
have
access
to
the
patient
securityContext
:
Reference
[0..1]
«
Any
»
The
actual
content,
base64
encoded
data
:
base64Binary
[0..1]
XML
Template
<
<!-- from -->
<
<</securityContext>
<
</Binary>
JSON
Template
{
"resourceType" : "",
// from
"
"
"
}
Turtle
Template
@prefix fhir: <http://hl7.org/fhir/> .
[ a fhir:;
fhir:nodeRole fhir:treeRoot; # if this is the parser root
# from
fhir:
fhir:
fhir:
]
Changes
since
R3
Binary
Binary.contentType
Change
value
set
from
http://hl7.org/fhir/ValueSet/mimetypes
to
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
Binary.data
Renamed
from
content
to
data
Min
Cardinality
changed
from
1
to
0
See
the
Full
Difference
for
further
information
This
analysis
is
available
as
XML
or
Raw
JSON
.
See
R3
<-->
R4
Conversion
Maps
(status
=
2
tests
that
all
execute
ok.
All
tests
pass
round-trip
testing
and
all
r3
resources
are
valid.)
Structure
Name
Flags
Card.
Type
Description
&
Constraints
Binary
N
Resource
Pure
binary
content
defined
by
a
format
other
than
FHIR
Elements
defined
in
Ancestors:
id
,
meta
,
implicitRules
,
language
contentType
Σ
1..1
code
MimeType
of
the
binary
content
MimeType
(
Required
)
securityContext
Σ
0..1
Reference
(
Any
)
Identifies
another
resource
to
use
as
proxy
when
enforcing
access
control
data
0..1
base64Binary
The
actual
content
Documentation
for
this
format
UML
Diagram
(
Legend
)
Binary
(
Resource
)
MimeType
of
the
binary
content
represented
as
a
standard
MimeType
(BCP
13)
contentType
:
code
[1..1]
«
The
mime
type
of
an
attachment.
Any
valid
mime
type
is
allowed.
(Strength=Required)
Mime
Types
!
»
This
element
identifies
another
resource
that
can
be
used
as
a
proxy
of
the
security
sensitivity
to
use
when
deciding
and
enforcing
access
control
rules
for
the
Binary
resource.
Given
that
the
Binary
resource
contains
very
few
elements
that
can
be
used
to
determine
the
sensitivity
of
the
data
and
relationships
to
individuals,
the
referenced
resource
stands
in
as
a
proxy
equivalent
for
this
purpose.
This
referenced
resource
may
be
related
to
the
Binary
(e.g.
Media,
DocumentReference),
or
may
be
some
non-related
Resource
purely
as
a
security
proxy.
E.g.
to
identify
that
the
binary
resource
relates
to
a
patient,
and
access
should
only
be
granted
to
applications
that
have
access
to
the
patient
securityContext
:
Reference
[0..1]
«
Any
»
The
actual
content,
base64
encoded
data
:
base64Binary
[0..1]
XML
Template
<
<!-- from -->
<
<</securityContext>
<
</Binary>
JSON
Template
{
"resourceType" : "",
// from
"
"
"
}
Turtle
Template
@prefix fhir: <http://hl7.org/fhir/> .
[ a fhir:;
fhir:nodeRole fhir:treeRoot; # if this is the parser root
# from
fhir:
fhir:
fhir:
]
Changes
since
Release
3
Binary
Binary.contentType
Change
value
set
from
http://hl7.org/fhir/ValueSet/mimetypes
to
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
Binary.data
Renamed
from
content
to
data
Min
Cardinality
changed
from
1
to
0
See
the
Full
Difference
for
further
information
This
analysis
is
available
as
XML
or
JSON
.
See
R3
<-->
R4
Conversion
Maps
(status
=
2
tests
that
all
execute
ok.
All
tests
pass
round-trip
testing
and
all
r3
resources
are
valid.)
See
the
Profiles
&
Extensions
and
the
alternate
definitions:
Master
Definition
XML
+
JSON
,
XML
Schema
/
Schematron
canonical
form
+
also
see
JSON
Schema
,
ShEx
(for
Turtle
Format
Specification
)
&
the
dependency
analysis
2.35.3.1
Terminology
Bindings
Path
Definition
Type
Reference
Binary.contentType
The
mime
type
of
an
attachment.
Any
valid
mime
type
is
allowed.
Required
Mime
Types
2.35.3.2
Content
Optionality
Binary.data
is
optional
because
it
is
excluded
when
a
summary
view
of
the
Binary
resource
is
requested
(this
can
be
useful
when
the
binary
resource
is
part
of
a
wider
request
e.g.
a
search
_include).
Otherwise,
the
data
is
not
optional;
a
binary
resource
without
any
specified
content
it
not
useful.
Simple
delivery
for
resupply
Binary
resources
behave
slightly
differently
from
all
other
resources
on
the
RESTful
API:
When
a
read
request
is
made
with
a
FHIR
type
in
the
Accept
header
(e.g.
"
application/fhir+xml
"
or
"
application/fhir+json
")
the
Binary
resource
is
returned
in
the
requested
FHIR
format.
This
applies
even
when
the
binary
data
itself
Usage
note:
every
effort
has
a
FHIR
mime
type
When
a
read
request
is
been
made
with
a
FHIR
type
in
the
Accept
header
(e.g.
"application/fhir+xml"
or
"application/fhir+json")
the
binary
resource
is
returned
in
the
requested
FHIR
format.
This
applies
even
when
the
binary
data
itself
has
a
FHIR
mime
type
The
Binary
resource
is
always
represented
in
the
native
FHIR
format
when
wrapped
in
a
Bundle
The
_format
overrides
the
accept
header
and
SHALL
be
interpreted
as
using
the
standard
FHIR
mime
types,
even
if
the
more
generic
mime
types
are
given
as
a
value.
When
the
read
request
has
some
other
type
in
the
Accept
header,
then
the
content
should
be
returned
with
the
content
type
stated
in
the
resource
in
the
Content-Type
header.
E.g.
if
the
content
type
in
the
resource
is
"application/pdf",
then
the
content
should
be
returned
as
a
PDF
directly.
The
_summary
parameter
does
not
apply
in
this
case.
due
to
the
way
the
web
infrastructure
works,
it
is
not
possible
to
make
blanket
rules
about
the
relationship
between
the
"Accept"
field
in
the
HTTP
request,
and
the
return
type,
which
is
why
there
is
no
hard
rule
about
this.
However,
the
intent
is
that
unless
specifically
requested,
the
FHIR
XML/JSON
representation
is
not
returned
When
binary
data
is
written
to
the
server
(
create
/
update
-
POST
or
PUT),
the
data
is
accepted
as
is
and
treated
as
the
content
of
a
Binary
,
including
when
the
content
type
is
"application/fhir+xml"
or
"application/fhir+json",
except
for
the
special
case
where
the
content
is
actually
a
Binary
resource.
Note
that
when
client
requests
a
Binary
resource
using
a
generic
mime
type
(application/xml,
text/xml,
or
application/json),
the
server
SHOULD
return
the
content
directly
if
the
content-type
format
matches
the
requested
mime
type
(e.g.
if
the
Accept
header
is
application/json,
and
the
contentType
is
vnd.xacml+json).
However,
servers
might
not
always
be
able
to
interpret
mime
types
correctly,
and
clients
SHOULD
be
prepared
to
receive
either
format.
Note
ensure
that
in
the
native
binary
representation,
the
normal
resource
metadata
is
not
available
directly,
though
some
of
it
is
replicated
in
the
HTTP
response
headers.
Specifically,
the
following
elements
of
the
resource
have
matching
HTTP
Headers:
Binary.meta.lastUpdated
:
Last-Modified
Binary.meta.versionId
:
ETag
header
Binary.contentType
:
Content-Type
Binary.securityContext
:
X-Security-Context
-
this
is
a
FHIR
specific
extension,
primarily
intended
to
allow
the
security
context
for
a
Binary
resource
to
be
specified
when
it
is
posted
in
native
form.
The
content
of
the
header
is
Binary.securityContext.reference
2.35.3.4
Security
Considerations
Binary
resources
are
not
constrained
to
any
list
of
safe
content
types
(content
types
without
active
elements
such
as
scripting
or
executable
code),
and
therefore
can
be
of
any
content
type
and
encoding.
Therefore,
extra
care
needs
to
be
taken
to
validate
the
content
of
the
Binary
resource
against
malicious
or
malformed
content.
For
more
details
see
Security
of
Narrative
,
since
the
security
issues
examples
are
similar.
Very
often,
the
content
of
a
Binary
resource
is
sensitive,
correct
and
the
server
should
apply
appropriate
access
control
to
the
content.
When
the
server
itself
generates
the
content,
it
implicitly
knows
what
access
control
to
apply.
When
the
client
provides
the
binary
to
the
server
itself,
it
uses
the
securityContext
element
(or
the
matching
X-Security-Context
HTTP
header)
to
inform
the
server
that
the
Binary
resource
should
be
treated
as
if
it
was
the
other
resource.
Typically,
the
other
resource
is
a
DocumentReference
or
similar
resource
that
refers
directly
to
the
Binary
resource,
but
that
is
not
mandatory.
2.35.3.5
Read
This
specification
makes
no
rules
concerning
advanced
read
functionality
for
the
Binary
resource,
such
as:
retrieving
byte
ranges
Finding
the
size
of
the
content
before
retrieving
it
(hough
this
can
be
achieved
using
a
HEAD
request
)
Stream
content
from
Binary?
generating
content
dynamically
on
the
fly
Servers
are
free
to
support
these
features,
useful,
but
they
are
not
required.
2.35.3.6
Search
This
specification
does
not
support
searching
on
Binary
resources.
2.35.3.7
Patch
The
semantics
of
a
PATCH
operation
on
a
Binary
resource
are
not
currently
specified.
normative
part
of
the
specification.