This
page
is
part
of
the
FHIR
Specification
(v4.3.0:
R4B
(v5.0.0:
R5
-
STU
).
The
This
is
the
current
published
version
which
supercedes
in
it's
permanent
home
(it
will
always
be
available
at
this
version
is
5.0.0
.
URL).
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R5
R4B
FHIR
Infrastructure
Work
Group
|
Maturity
Level
:
|
|
Security Category : Business |
Compartments
:
|
The SubscriptionStatus resource describes the state of a Subscription during notifications.
This
document
contains
information
about
the
SubscriptionStatus
resource
and
details
specific
to
options
in
it.
It
is
defined
as
part
of
the
topic-based
model
of
See
Subscriptions
(Publish
/
Subscribe
pattern).
for
general
information
about
using
Subscriptions
in
FHIR.
The
SubscriptionStatus
resource
is
used
to
convey
information
about
the
current
state
of
a
Subscription
and
the
contents
of
a
notification.
Information
contained
within
a
SubscriptionStatus
falls
into
three
categories:
Information
to
identify
the
relevant
Subscription
(e.g.,
a
reference
during
client
notifications.
It
is
not
persisted
or
allowed
to
a
Subscription
,
SubscriptionTopic
)
Information
about
the
current
state
of
the
Subscription
(e.g.,
Subscription
status,
number
of
events
the
Subscription
has
generated)
Information
about
the
current
notification
(e.g.,
notification
type,
the
events
in
this
notification)
be
referenced
by
other
resources
except
as
described
below.
The
SubscriptionStatus
resource
is
used
in
topic-based
FHIR
Subscriptions.
This
resource
is
designed
only
to
be
used
to
convey
state
information
the
Subscriptions
Framework
.
Information
about
a
subscription
the
Boundaries
and
notification
during
various
operations,
for
example
included
with
notifications
or
as
Relationships
both
within
the
result
Subscriptions
Framework
and
to
other
areas
of
a
status
request.
the
FHIR
specification
can
be
found
here
.
No
resources
refer
to
references
for
this
resource
directly.
This
resource
does
not
implement
any
patterns.
Resource.
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
DomainResource |
Status
information
about
a
Subscription
provided
during
event
notification
+ Rule: + Rule: Status messages must contain status Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension |
|
|
Σ C | 0..1 | code |
requested
|
active
|
error
|
off
|
entered-in-error
Binding: |
|
?! Σ C | 1..1 | code |
handshake
|
heartbeat
|
event-notification
|
query-status
|
query-event
Binding: |
|
Σ | 0..1 |
|
Events
since
the
Subscription
was
created
|
|
C | 0..* | BackboneElement |
Detailed
information
about
any
events
relevant
to
this
notification
|
|
1..1 |
|
|
|
|
0..1 | instant |
The
instant
this
event
occurred
|
|
|
0..1 | Reference ( Any ) |
|
|
|
0..* | Reference ( Any ) |
|
|
|
Σ | 1..1 | Reference ( Subscription ) |
Reference
to
the
Subscription
responsible
for
this
notification
|
|
Σ | 0..1 | canonical ( SubscriptionTopic ) |
Reference
to
the
SubscriptionTopic
this
notification
relates
to
|
|
Σ | 0..* | CodeableConcept |
List
of
errors
on
the
subscription
Binding: Subscription Error Codes ( Example ) |
Documentation
for
this
format
|
||||
See the Extensions for this resource
UML Diagram ( Legend )
XML Template
<SubscriptionStatus xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension -->
< < < < < < <</focus> <</additionalContext><status value="[code]"/><!-- I 0..1 requested | active | error | off | entered-in-error --> <type value="[code]"/><!-- I 1..1 handshake | heartbeat | event-notification | query-status | query-event --> <eventsSinceSubscriptionStart value="[integer64]"/><!-- 0..1 Events since the Subscription was created --> <notificationEvent> <!-- I 0..* Detailed information about any events relevant to this notification --> <eventNumber value="[integer64]"/><!-- 1..1 Sequencing index of this event --> <timestamp value="[instant]"/><!-- 0..1 The instant this event occurred --> <focus><!-- 0..1 Reference(Any) Reference to the primary resource or information of this event --></focus> <additionalContext><!-- 0..* Reference(Any) References related to the focus resource and/or context of this event --></additionalContext> </notificationEvent> <subscription><!-- 1..1 Reference(Subscription) Reference to the Subscription responsible for this notification --></subscription> <topic><!-- 0..1 canonical(SubscriptionTopic) Reference to the SubscriptionTopic this notification relates to --></topic> <error><!-- 0..* CodeableConcept List of errors on the subscription --></error> </SubscriptionStatus>
JSON Template
{
"resourceType" : "SubscriptionStatus",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"
"
"
"
"
"
"
"
"status" : "<code>", // I requested | active | error | off | entered-in-error
"type" : "<code>", // I R! handshake | heartbeat | event-notification | query-status | query-event
"eventsSinceSubscriptionStart" : "<integer64>", // Events since the Subscription was created
"notificationEvent" : [{ // I Detailed information about any events relevant to this notification
"eventNumber" : "<integer64>", // R! Sequencing index of this event
"timestamp" : "<instant>", // The instant this event occurred
"focus" : { Reference(Any) }, // Reference to the primary resource or information of this event
"additionalContext" : [{ Reference(Any) }] // References related to the focus resource and/or context of this event
}],
"subscription" : { Reference(Subscription) }, // R! Reference to the Subscription responsible for this notification
"
"topic" : "<canonical(SubscriptionTopic)>", // Reference to the SubscriptionTopic this notification relates to
"error" : [{ CodeableConcept }] // List of errors on the subscription
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:SubscriptionStatus; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension
fhir: fhir: fhir: fhir: fhir: fhir: fhir: fhir: ], ...; fhir: fhir: fhir:fhir:status [ code ] ; # 0..1 I requested | active | error | off | entered-in-error fhir:type [ code ] ; # 1..1 I handshake | heartbeat | event-notification | query-status | query-event fhir:eventsSinceSubscriptionStart [ integer64 ] ; # 0..1 Events since the Subscription was created fhir:notificationEvent ( [ # 0..* I Detailed information about any events relevant to this notification fhir:eventNumber [ integer64 ] ; # 1..1 Sequencing index of this event fhir:timestamp [ instant ] ; # 0..1 The instant this event occurred fhir:focus [ Reference(Any) ] ; # 0..1 Reference to the primary resource or information of this event fhir:additionalContext ( [ Reference(Any) ] ... ) ; # 0..* References related to the focus resource and/or context of this event ] ... ) ; fhir:subscription [ Reference(Subscription) ] ; # 1..1 Reference to the Subscription responsible for this notification fhir:topic [ canonical(SubscriptionTopic) ] ; # 0..1 Reference to the SubscriptionTopic this notification relates to fhir:error ( [ CodeableConcept ] ... ) ; # 0..* List of errors on the subscription ]
Changes
since
from
both
R4
and
R4B
This
resource
did
not
exist
in
Release
3
R4
See the Full Difference for further information
This
analysis
is
available
for
R4
as
XML
or
JSON
.
Conversions
between
R3
and
R4
for
R4B
as
XML
or
JSON
.
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
DomainResource |
Status
information
about
a
Subscription
provided
during
event
notification
+ Rule: + Rule: Status messages must contain status Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension |
|
|
Σ C | 0..1 | code |
requested
|
active
|
error
|
off
|
entered-in-error
Binding: |
|
?! Σ C | 1..1 | code |
handshake
|
heartbeat
|
event-notification
|
query-status
|
query-event
Binding: |
|
Σ | 0..1 |
|
Events
since
the
Subscription
was
created
|
|
C | 0..* | BackboneElement |
Detailed
information
about
any
events
relevant
to
this
notification
|
|
1..1 |
|
|
|
|
0..1 | instant |
The
instant
this
event
occurred
|
|
|
0..1 | Reference ( Any ) |
|
|
|
0..* | Reference ( Any ) |
|
|
|
Σ | 1..1 | Reference ( Subscription ) |
Reference
to
the
Subscription
responsible
for
this
notification
|
|
Σ | 0..1 | canonical ( SubscriptionTopic ) |
Reference
to
the
SubscriptionTopic
this
notification
relates
to
|
|
Σ | 0..* | CodeableConcept |
List
of
errors
on
the
subscription
Binding: Subscription Error Codes ( Example ) |
Documentation
for
this
format
|
||||
See the Extensions for this resource
XML Template
<SubscriptionStatus xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension -->
< < < < < < <</focus> <</additionalContext><status value="[code]"/><!-- I 0..1 requested | active | error | off | entered-in-error --> <type value="[code]"/><!-- I 1..1 handshake | heartbeat | event-notification | query-status | query-event --> <eventsSinceSubscriptionStart value="[integer64]"/><!-- 0..1 Events since the Subscription was created --> <notificationEvent> <!-- I 0..* Detailed information about any events relevant to this notification --> <eventNumber value="[integer64]"/><!-- 1..1 Sequencing index of this event --> <timestamp value="[instant]"/><!-- 0..1 The instant this event occurred --> <focus><!-- 0..1 Reference(Any) Reference to the primary resource or information of this event --></focus> <additionalContext><!-- 0..* Reference(Any) References related to the focus resource and/or context of this event --></additionalContext> </notificationEvent> <subscription><!-- 1..1 Reference(Subscription) Reference to the Subscription responsible for this notification --></subscription> <topic><!-- 0..1 canonical(SubscriptionTopic) Reference to the SubscriptionTopic this notification relates to --></topic> <error><!-- 0..* CodeableConcept List of errors on the subscription --></error> </SubscriptionStatus>
JSON Template
{
"resourceType" : "SubscriptionStatus",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"
"
"
"
"
"
"
"
"status" : "<code>", // I requested | active | error | off | entered-in-error
"type" : "<code>", // I R! handshake | heartbeat | event-notification | query-status | query-event
"eventsSinceSubscriptionStart" : "<integer64>", // Events since the Subscription was created
"notificationEvent" : [{ // I Detailed information about any events relevant to this notification
"eventNumber" : "<integer64>", // R! Sequencing index of this event
"timestamp" : "<instant>", // The instant this event occurred
"focus" : { Reference(Any) }, // Reference to the primary resource or information of this event
"additionalContext" : [{ Reference(Any) }] // References related to the focus resource and/or context of this event
}],
"subscription" : { Reference(Subscription) }, // R! Reference to the Subscription responsible for this notification
"
"topic" : "<canonical(SubscriptionTopic)>", // Reference to the SubscriptionTopic this notification relates to
"error" : [{ CodeableConcept }] // List of errors on the subscription
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:SubscriptionStatus; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension
fhir: fhir: fhir: fhir: fhir: fhir: fhir: fhir: ], ...; fhir: fhir: fhir:fhir:status [ code ] ; # 0..1 I requested | active | error | off | entered-in-error fhir:type [ code ] ; # 1..1 I handshake | heartbeat | event-notification | query-status | query-event fhir:eventsSinceSubscriptionStart [ integer64 ] ; # 0..1 Events since the Subscription was created fhir:notificationEvent ( [ # 0..* I Detailed information about any events relevant to this notification fhir:eventNumber [ integer64 ] ; # 1..1 Sequencing index of this event fhir:timestamp [ instant ] ; # 0..1 The instant this event occurred fhir:focus [ Reference(Any) ] ; # 0..1 Reference to the primary resource or information of this event fhir:additionalContext ( [ Reference(Any) ] ... ) ; # 0..* References related to the focus resource and/or context of this event ] ... ) ; fhir:subscription [ Reference(Subscription) ] ; # 1..1 Reference to the Subscription responsible for this notification fhir:topic [ canonical(SubscriptionTopic) ] ; # 0..1 Reference to the SubscriptionTopic this notification relates to fhir:error ( [ CodeableConcept ] ... ) ; # 0..* List of errors on the subscription ]
Changes
since
Release
4
from
both
R4
and
R4B
This
resource
did
not
exist
in
Release
3
R4
See the Full Difference for further information
This
analysis
is
available
for
R4
as
XML
or
JSON
.
Conversions
between
R3
and
R4
for
R4B
as
XML
or
JSON
.
See
the
Profiles
&
Extensions
and
the
alternate
Additional
definitions:
Master
Definition
XML
+
JSON
,
XML
Schema
/
Schematron
+
JSON
Schema
,
ShEx
(for
Turtle
)
+
see
the
extensions
,
the
spreadsheet
version
&
the
dependency
analysis
| Path |
|
Type |
|
|---|---|---|---|
| SubscriptionStatus.status | SubscriptionStatusCodes (a valid code from Subscription Status ) | Required |
State values for FHIR Subscriptions. |
| SubscriptionStatus.type | SubscriptionNotificationType | Required |
The type of notification represented by the status message. |
| SubscriptionStatus.error | SubscriptionErrorCodes | Example |
Codes to represent subscription error details |
|
|
Level | Location | Description | Expression |
sst-1
|
Rule | (base) |
|
|
sst-2
|
Rule | (base) | Status messages must contain status | type = 'query-status' implies status.exists() |
This
resource
is
used
to
communicate
information
about
a
Subscription
and
the
events
represented
by
a
notification
bundle.
The
process
of
sending
a
notification
(e.g.,
a
notification
this
status
is
included
with)
can
change
the
status
of
that
subscription.
Servers
SHALL
populate
elements
with
the
most
recent
information
at
the
time
of
generation
(e.g.,
when
a
notification
is
created)
and
receivers
SHOULD
be
aware
that
this
information
might
not
be
current
at
the
time
a
notification
is
processed
(e.g.,
a
subscription
was
active
but
has
subsequently
moved
to
an
error
state).
Subscription
notifications
MAY
contain
PHI.
Applications
are
responsible
for
following
FHIR
security
guidance
and
compliance
with
relevant
security
requirements
(e.g.,
corporate
policy,
government
regulation,
etc.).
Hinting
for
the
allowed
amount
of
PHI
is
available
in
the
relevant
Subscription
resource,
via
the
channel
and
payload
information.
Since Subscription Topic definitions contain human-readable descriptions and definitions, the purpose of a topic may be understood by viewing the resource. Given that canonical links to topics are intended to be resolvable and/or searchable (e.g., indexed in a registry), it is assumed that anyone with a link to a topic also knows what that topic is about. Thus, topics MAY be considered PHI and SHOULD be reviewed before inclusion in a notification.
Hinting about when a canonical topic URL may be included with a notification can be derived from a subscription's payload level. E.g.:
empty
:
SHOULD
NOT
be
present
id-only
:
MAY
be
present
full-resource
:
SHOULD
be
present
Since this specification does not currently define any channel types that guarantee client receipt of notifications, a monotonically-increasing event number is critical to detecting several classes of delivery errors (more information is available at Detecting Delivery Errors ). However, with the availability of custom-defined channels , notifications can be sent across channels that provide guaranteed delivery (e.g., a message queue), which removes the need for global tracking of event numbers.
For
channels
that
do
not
need
event
numbers,
it
is
still
desireable
for
clients
to
have
an
index
for
the
events
present
in
a
notification.
In
all
cases,
a
value
for
SubscriptionStatus.notificationEvent.eventNumber
is
required
-
either
the
number
in-sequence
based
on
the
total
number
of
events
on
a
subscription
or
a
notification-bundle
relative
index
(e.g.,
1,
2,
3,
etc.).
| Element | Delivery Type | Optionality | Notes |
|---|---|---|---|
| SubscriptionStatus.eventsSinceSubscriptionStart | Best Effort | Required |
Servers
SHALL
include
this
value
when
sending
event
notifications
in
order
to
allow
clients
to
detect
missing
events.
This value is inclusive of this notification (e.g., the first event notification sent would include one (1) in this element). |
| SubscriptionStatus.eventsSinceSubscriptionStart | Guaranteed | Optional | Servers MAY include this value when sending event notifications. |
| SubscriptionStatus.notificationEvent.eventNumber | Best Effort | Required |
Event
numbers
SHALL
match
the
index
in
the
subscription
event
sequence.
E.g.,
the
highest-numbered
event
in
the
notification
will
match
the
number
in
eventsSinceSubscriptionStart
. |
| SubscriptionStatus.notificationEvent.eventNumber | Guaranteed | Required | A relative index of events in a single notification, e.g., 1, 2, 3, etc.. |
This specification describes five distinct outbound notification types: Event , Handshake , Heartbeat , Query Status , and Query Event . For each, the notification body is a subscription-notification Bundle with a SubscriptionStatus resource used to convey Subscription and notification details.
The primary notification bundle type is a notification about an event.
| Element | Optionality | Notes |
|---|---|---|
| SubscriptionStatus.status | Recommended |
Current
status
of
the
relevant
subscription
(e.g.,
active
).
|
| SubscriptionStatus.type | Required |
SHALL
be
event-notification
|
| SubscriptionStatus.eventsSinceSubscriptionStart |
|
|
| SubscriptionStatus.notificationEvent | Required | For notifications that include events, this element SHALL be present. Details about specific elements within this structure are included in this table. |
| SubscriptionStatus.notificationEvent.eventNumber |
|
|
| SubscriptionStatus.notificationEvent.timestamp | Recommended |
So
that
clients
can
discover
when
an
event
actually
occurred,
timestamp
is
recommended.
|
| SubscriptionStatus.notificationEvent.focus | Special |
Links
contained
in
the
focus
element
contain
resource
IDs,
so
will
or
will
not
be
present
based
on
the
payload
level
relevant
to
the
notification:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.notificationEvent.additionalContext | Special |
Links
contained
in
the
additionalContext
element
contain
resource
IDs
and
MAY
or
MAY
not
exist.
Presence
is
determined
based
on
the
payload
level
relevant
to
the
notification,
if
they
are
available:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.topic | Optional | See Content and PHI . |
When a connection to an Endpoint is established or re-established, a server MAY send a Handshake notification to the endpoint.
The
client
expectations
upon
receipt
of
a
Handshake
notification
differ
for
each
channel
type
(e.g.,
for
the
rest-hook
channel
type,
a
client
endpoint
responds
to
event
notifications
with
standard
HTTP
response
codes).
| Element | Optionality | Notes |
|---|---|---|
| SubscriptionStatus.status | Recommended |
Current
status
of
the
relevant
subscription
(e.g.,
active
).
|
| SubscriptionStatus.type | Required |
SHALL
be
handshake
|
| SubscriptionStatus.eventsSinceSubscriptionStart | Optional |
For
a
new
Subscription,
if
this
value
is
present
it
SHALL
be
zero
(0).
A sender MAY send a handshake with a non-zero number of events, for example as process for re-establishing communication after an error state. Note: this value SHALL NOT be incremented by sending a
handshake
notification.
|
| SubscriptionStatus.notificationEvent | Special |
A
server
MAY
include
historical
events
for
a
client
with
a
handshake
,
if
any
exist.
For
example,
during
a
reconnection
process,
a
server
MAY
opt
to
include
all
events
since
the
last
successful
transmission
to
the
client.
Details
about
specific
elements
within
this
structure
are
included
in
this
table.
|
| SubscriptionStatus.notificationEvent.eventNumber | Special |
|
| SubscriptionStatus.notificationEvent.timestamp | Special |
If
a
server
is
including
prior
events,
timestamp
is
recommended,
so
that
clients
can
process
historical
events
with
proper
context.
|
| SubscriptionStatus.notificationEvent.focus | Special |
Links
contained
in
the
focus
element
contain
resource
IDs,
so
will
or
will
not
be
present
based
on
the
payload
level
relevant
to
the
notification:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.notificationEvent.additionalContext | Special |
Links
contained
in
the
additionalContext
element
contain
resource
IDs
and
MAY
or
MAY
not
exist.
Presence
is
determined
based
on
the
payload
level
relevant
to
the
notification,
if
they
are
available:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.topic | Optional | See Content and PHI . |
The client is not expected to take any special action in receipt of a Handshake notification beyond the channel-specific requirement for receiving an event notification.
A
heartbeat
notification
is
a
subscription-notification
Bundle
of
type
heartbeat
sent
without
incrementing
the
subscription
event
count,
though
servers
MAY
include
the
most
recent
event
in
the
notification.
For
servers,
heartbeat
notifications
allow
systems
to
ensure
that
the
connection
is
still
alive
and
valid.
For
clients,
heartbeat
notifications
serve
as
a
method
to
detect
errors
in
communication.
Note
that
a
client
is
not
required
to
take
any
action
in
receipt
of
a
heartbeat
beyond
the
channel-specific
requirement
for
receiving
an
event
notification
(e.g.,
accepting
the
notification
bundle
with
an
HTTP
200).
Heartbeat intervals are negotiated while creating a Subscription. If accepted, servers SHOULD send one heartbeat per interval on the accepted subscription.
| Element | Optionality | Notes |
|---|---|---|
| SubscriptionStatus.status | Recommended |
Current
status
of
the
relevant
subscription
(e.g.,
active
).
|
| SubscriptionStatus.type | Required |
SHALL
be
heartbeat
|
| SubscriptionStatus.eventsSinceSubscriptionStart | Recommended |
The
presence
of
this
value
allows
clients
to
detect
missing
notifications.
Recommended
for
subscriptions
with
best-effort
delivery,
optional
for
subscriptions
with
guaranteed
delivery.
Note: this value SHALL NOT be incremented by sending a
heartbeat
notification.
|
| SubscriptionStatus.notificationEvent | Special |
A
server
MAY
include
historical
events
for
a
client
with
a
heartbeat
,
if
any
exist.
For
example,
a
server
MAY
opt
to
include
the
most
recent
event
since
the
last
successful
transmission
to
the
client.
Details
about
specific
elements
within
this
structure
are
included
in
this
table.
|
| SubscriptionStatus.notificationEvent.eventNumber | Special |
|
| SubscriptionStatus.notificationEvent.timestamp | Special |
If
a
server
is
including
any
prior
events,
timestamp
is
recommended,
so
that
clients
can
process
historical
events
with
proper
context.
|
| SubscriptionStatus.notificationEvent.focus | Special |
Links
contained
in
the
focus
element
contain
resource
IDs,
so
will
or
will
not
be
present
based
on
the
payload
level
relevant
to
the
notification:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.notificationEvent.additionalContext | Special |
Links
contained
in
the
additionalContext
element
contain
resource
IDs
and
MAY
or
MAY
not
exist.
Presence
is
determined
based
on
the
payload
level
relevant
to
the
notification,
if
they
are
available:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.topic | Optional | See Content and PHI . |
Clients can ask a server at any time for the current status of a Subscription, for example via the $status operation .
Since
the
$status
operation
is
part
of
the
FHIR
REST
API,
the
guidance
below
assumes
that
a
user
has
been
authenticated
and
is
allowed
access
to
all
relevant
resources.
| Element | Optionality | Notes |
|---|---|---|
| SubscriptionStatus.status | Required |
Current
status
of
the
relevant
subscription
(e.g.,
active
).
|
| SubscriptionStatus.type | Required |
SHALL
be
query-status
|
| SubscriptionStatus.eventsSinceSubscriptionStart |
|
Note: this value SHALL NOT be incremented by sending a
query-status
notification.
|
| SubscriptionStatus.notificationEvent |
|
A
query-status
notification
|
| SubscriptionStatus.topic | Recommended | See Content and PHI , but note that guidance will vary since there is an active user session. |
Some
servers
may
allow
clients
to
ask
for
events
which
have
already
occurred.
Notification
bundles
returned
by
such
operations
or
queries
should
use
occurred,
for
example
via
the
$events
operation
.
Since
the
query-event
$events
type.
operation
is
part
of
the
FHIR
REST
API,
the
guidance
below
assumes
that
a
user
has
been
authenticated
and
the
server
has
filtered
any
results
according
to
what
the
user
is
allowed
access.
| Element | Optionality | Notes |
|---|---|---|
| SubscriptionStatus.status | Recommended |
Current
status
of
the
relevant
subscription
(e.g.,
active
).
|
| SubscriptionStatus.type | Required |
SHALL
be
query-event
.
|
| SubscriptionStatus.eventsSinceSubscriptionStart | Recommended |
This
value
is
allows
clients
to
know
if
they
are
missing
notifications.
Recommended
for
subscriptions
with
best-effort
delivery
and
optional
for
subscriptions
with
guaranteed
delivery.
Note: this value SHALL NOT be incremented by sending a
query-event
bundle.
See Event Numbering for more information. |
| SubscriptionStatus.notificationEvent | Required | For notifications that include events, this element SHALL be present. Details about specific elements within this structure are included in this table. |
| SubscriptionStatus.notificationEvent.eventNumber |
|
|
| SubscriptionStatus.notificationEvent.timestamp | Recommended |
So
that
clients
can
discover
when
an
event
actually
occurred,
timestamp
is
recommended.
|
| SubscriptionStatus.notificationEvent.focus | Special |
Links
contained
in
the
focus
element
contain
resource
IDs,
so
will
or
will
not
be
present
based
on
the
payload
level
relevant
to
the
notification:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.notificationEvent.additionalContext | Special |
Links
contained
in
the
additionalContext
element
contain
resource
IDs
and
MAY
or
MAY
not
exist.
Presence
is
determined
based
on
the
payload
level
relevant
to
the
notification,
if
they
are
available:
Reference.type
element
if
if
the
type
is
not
specified
in
Reference.reference
|
| SubscriptionStatus.topic | Recommended | See Content and PHI , but note that guidance will vary since there is an active user session. |
If
a
server
encounters
errors
while
sending
a
notification,
the
server
may
retry
the
notification
a
fixed
number
of
times
and/or
refer
errors
to
its
own
alert
logs.
If
the
notification
fails,
the
server
SHOULD
set
the
status
of
the
subscription
to
error
.
If
the
error
would
be
useful
to
a
client
(e.g.,
notification
failed
because
the
destination
SSL
certificate
expired),
servers
SHOULD
track
errors
and
provide
details
to
the
client.
If
a
notification
retry
attempt
succeeds,
the
server
SHOULD
update
the
status
to
active
and
MAY
remove
any
error
codes.
If
a
subscription
fails
consistently
a
server
may
choose
set
the
subscription
status
to
The
off
SubscriptionStatus
and
stop
trying
to
send
notifications.
Errors
a
server
wishes
to
make
accessible
to
clients
are
stored
resource
is
key
in
Subscription.error
.
Servers
should
provide
a
mechanism
for
clearing
detecting
various
errors
(e.g.,
when
resetting
a
Subscription.status
back
to
requested
after
an
error).
Since
Subscription.error
represents
server
errors,
a
server
SHOULD
NOT
allow
clients
to
add
errors.
2.47.8.1
Detecting
Delivery
Errors
There
are
several
mechanisms
available
to
subscribers
in
order
to
understand
the
current
state
of
notification
delivery.
Below
are
some
example
error
scenarios
with
details
about
how
a
subscriber
can
detect
the
problem
state.
2.47.8.1.1
Missing
Event
The
diagram
below
shows
how
a
subscriber
can
use
the
SubscriptionStatus.eventsSinceSubscriptionStart
parameter
on
received
notifications
to
determine
that
an
event
has
been
missed.
Diagram
showing
a
missed-event
detection
communication
and
recovery
workflow
In
the
above
sequence,
the
subscriber
tracks
the
eventsSinceSubscriptionStart
of
each
received
notification
(per
Subscription).
When
the
subscriber
received
event
23,
the
subscriber
was
aware
that
the
last
notification
it
received
was
a
single
notification
for
event
21.
The
subscriber
then
waited
an
amount
of
time
to
ensure
that
event
22
was
indeed
missing
(and
not,
for
example,
still
being
processed)
processing.
For
more
information,
see
Managing
Subscriptions
and
started
a
recovery
process.
The
recovery
process
itself
will
vary
by
subscriber,
but
should
be
a
well-understood
method
for
recovering
in
the
event
of
errors.
2.47.8.1.2
Broken
Communication
Errors
The
diagram
below
show
how
a
subscriber
can
use
a
subscription
heartbeat
period
to
determine
errors
which
prevent
notifications
from
reaching
the
endpoint.
Diagram
showing
broken
communication
detection
and
recovery
workflow
In
the
above
sequence,
the
subscriber
is
aware
that
in
the
heartbeatPeriod
has
elapsed
for
a
subscription
without
receiving
any
notifications.
.
Subscriptions
Framework
page.
Clients
are
responsible
for
devising
an
appropriate
method
Search
parameters
for
recovering
from
errors.
Often,
this
process
will
include
a
series
or
batch
of
requests
that
allow
a
client
to
know
resource.
See
also
the
current
state
or
a
request
to
an
$events
operation
when
available.
For
example,
an
application
may
need
to
query
all
relevant
resources
full
list
of
search
parameters
for
a
patient
in
order
to
ensure
nothing
has
been
missed.
Once
an
application
has
returned
to
a
functional
state,
it
should
request
the
subscription
is
reactivated
by
updating
the
status
to
either
requested
or
active
as
appropriate.
2.47.8.1.4
Using
this
resource
,
and
check
the
$events
operation
Extensions
registry
Servers
MAY
choose
to
support
the
$events
operation
defined
for
search
parameters
on
the
Subscription
extensions
related
to
this
resource.
The
$events
operation
allows
clients
to
request
events
which
have
occurred
common
parameters
also
apply.
See
Searching
for
more
information
about
searching
in
the
past.
Servers
which
implement
the
operation
MAY
use
implementation-specific
criteria
to
restrict
availability
of
events
(e.g.,
most
recent
10
events,
events
within
the
past
30
days,
etc.).
REST,
messaging,
and
services.
During
a
recovery
process,
clients
MAY
try
to
retrieve
missing
events
via
the
$events
operation,
which
should
allow
processing
to
continue
as
normal.
(No
search
parameters
for
this
resource)