This page is part of the FHIR Specification (v0.06: DSTU 1 Ballot 2). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Atom Feeds 2.6

One common operation performed with resources is to gather a collection of resources into a single XML instance. In FHIR this is referred to as "bundling" the resources together. The resource bundle is not just a list of references to resources, but includes their whole content. These resource bundles are useful for a variety of different reasons, including:

Whenever resources are gathered into a collection, this is done using the Atom format (http://tools.ietf.org/html/rfc4287), following this template:

<feed xmlns="http://www.w3.org/2005/Atom">
  <title><!-- 1..1 string Text statement of purpose --></title>
  <updated><!-- 1..1 instant When the bundle was built --></updated>
  <id><!-- 1..1 uri Unique uri for this bundle --></id>
  <link rel="self" href="[building application url]"><!-- 0..1 --></link>

  <entry><!-- Zero+ -->
    <title><!-- 1..1 string Text summary of resource --></title>
    <link rel="self" href="Version Specific reference to Resource"><!-- 0..1 --></link>
    <id><!-- 1..1 uri Logical Id (uri) for this resource --></id>
    <updated><!-- 1..1 instant Last Updated for resource --></updated>
    <published><!-- 0..1 instant Time resource copied into the feed --></published>
    <author><!-- Who created resource? -->
      <name><!-- 1..1 string Name of Human or Device that authored the resource --></name>
      <uri><!-- 0..1 uri Link to the resource for the author --></uri>
    </author>
    <category term="[Resource Type]" scheme="http://hl7.org/fhir/resource-types"><!-- 1..1 --></category>  
    <content type="text/xml"><!-- 1..1 -->
      <[ResourceName] xmlns="http://hl7.org/fhir">
        <!-- Content for the resource -->
      </[ResourceName]>
    </content>
    <summary type="xhtml"><!-- 0..1 -->
      <div xmlns="http://www.w3.org/1999/xhtml"><!-- Narrative from resource --></div>
    </summary>
  </entry>
  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
    <!-- 0..1 Enveloped Digital Signature (see Atom section 5.1) -->
  </Signature>
</feed>

Notes 2.6.1

Bundling versions - deletion 2.6.2

When returning a set of resources or versions of a resource, an entry might indicate that the entry has been deleted. Deleted resources are represented in an atom feed as defined by rfc6721.txt:

<feed xmlns="http://www.w3.org/2005/Atom">
  ... feed elements and other entries ...
  <at:deleted-entry xmlns:at="http://purl.org/atompub/tombstones/1.0"
      ref="[Logical Id for deleted resource]" when="instant [when deleted]">
    <link rel="self" href="[Version Specific reference to Resource]"><!-- 0..1 --></link>
  </at:deleted-entry>
  ... other entries ...

A deleted resource returns a 410 error if it is accessed through the RESTful interface.

Binary Resources 2.6.3

There are situations where it is useful or required to represent binary resources in the bundle. These are resources that are referred to from FHIR Resources (usually via a URI) where it is convenient to include these in the feed directly rather than leaving them by reference.

When binary resources are represented in the feed, they are enclosed as base64 encoded content along with a content-type, which is the mime-type as it would be specified in HTTP:

  ...
  <entry>
    ...
    <category term="Binary" scheme="http://hl7.org/fhir/resource-types"><!-- 1..1 --></category>
    <content type="text/xml"><!-- 1..1 -->
      <Binary xmlns="http://hl7.org/fhir" contentType="[mime type]">[Base64 Content]</Binary>
    </content>
    <summary type="xhtml"><!-- 0..1 -->
      <div xmlns="http://www.w3.org/1999/xhtml">Binary resource</div>
    </summary>
  </entry>
  ...

The summary should be some equivalent to "Binary Resource" in an appropriate language.

Resolving references to Resources 2.6.4

Readers of the resources bundles should always look through the resources in the atom feed when a resource reference is encountered. The resource reference may have the resource type and a relative url, which is the id of the target, like this:

  <institution>
    <type>Organization</type>
    <id>23</id>
  </institution>

A reader trying to find the resource this institution element identifies should always look through the entries in the atom feed prior to looking anywhere else for the institution. If that organization is in the feed, it would look like this:

   .. feed ..
  <entry>
    .. 
    <id>http://acme.com/fhir/organization/@23<id>
    .. 
    <category term="Organization" scheme="http://hl7.org/fhir/resource-types"/>

    <content type="text/xml">
      <Organization xmlns="http://hl7.org/fhir">
         <!-- other Content for the resource -->
      </Organization>
    </content>
  ... feed ...

It would also be possible to locate the resource by an absolute url. In this case, the id element contains a reference to the location of the resource:

  <institution>
    <type>Organization</type>
    <id>http://acme.com/fhir/organization/@23</id>
  </institution>

If there is no resource in the atom feed with an appropriate URL, then the application may try accessing the provided URL directly or use some other implementation-specific method for resolving how to find the resource. Note that this example used a FHIR RESTful URL, but this is not required.

Implementation Notes 2.6.5


This is an old version of FHIR retained for archive purposes. Do not use for anything else
Implementers are welcome to experiment with the content defined here, but should note that the contents are subject to change without prior notice.
© HL7.org 2011 - 2012. FHIR v0.06 generated on Tue, Dec 4, 2012 00:04+1100. License