Release 5

This page is part of the FHIR Specification (v5.0.0: R5 - STU). This is the current published version in it's permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4

Example Bundle/bundle-references (XML)

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

Raw XML (canonical form + also see XML Format Specification)

An example bundle that demonstrates various reference resolution paths (id = "bundle-references")

<?xml version="1.0" encoding="UTF-8"?>

<Bundle xmlns="http://hl7.org/fhir">
  <id value="bundle-references"/> 
  <type value="collection"/> 

      <!--    A patient that already has an id on a server    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Patient/23"/> 
    <resource> 
      <Patient> 
         <id value="23"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p style="border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;"><b> Anonymous Patient</b>  (no stated gender), DoB Unknown ( id: 1234567)</p> <hr/>  </div> </text> <identifier> 
           <system value="http://example.org/ids"/> 
           <value value="1234567"/> 
         </identifier> 
      </Patient> 
    </resource> 
  </entry> 
  
      <!--    A patient that doesn't have a persistent home - but it does have 
      a UUID assigned for this bundle "locally identified"    -->
  <entry> 
    <fullUrl value="urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d"/> 
    <resource> 
      <Patient> 
        <id value="temp"/> 
      <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p style="border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;"><b> Anonymous Patient</b>  (no stated gender), DoB Unknown</p> <hr/>  </div> </text> </Patient> 
    </resource> 
  </entry> 
  
      <!--    a relative resource reference    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/123"/> 
    <resource> 
      <Observation> 
        <id value="123"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="123"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;123&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">Patient/23</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
              <!--    this is reference to the first patient above    -->
          <reference value="Patient/23"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 

      <!--    an absolute reference    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/124"/> 
    <resource> 
      <Observation> 
        <id value="124"/> 
        <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="124"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;124&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">http://example.org/fhir/Patient/23</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
              <!--    this is reference to the first patient above    -->
          <reference value="http://example.org/fhir/Patient/23"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 

      <!--    reference to a locally identified resource    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/12"/> 
    <resource> 
      <Observation> 
        <id value="12"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="12"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;12&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
              <!--    reference to the second patient above    -->
          <reference value="urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 
  
      <!--    reference that doesn't resolve in this bundle and is resolved externally    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/14"/> 
    <resource> 
      <Observation> 
        <id value="14"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="14"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;14&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">http://example.org/fhir-2/Patient/1</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
              <!--    reference to a patient not found in this bundle    -->
          <reference value="http://example.org/fhir-2/Patient/1"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 
  
  
      <!--    nor does this one (FullUrl base is different)    -->
  <entry> 
    <fullUrl value="http://example.org/fhir-2/Observation/14"/> 
    <resource> 
      <Observation> 
        <id value="14"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="14"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;14&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">Patient/23</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
              <!--    reference to a patient not found in this bundle    -->
          <reference value="Patient/23"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 
  
      <!--    A duplicate patient (#1)    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Patient/45"/> 
    <resource> 
      <Patient> 
         <id value="45"/> 
         <meta> 
           <versionId value="1"/> 
         </meta> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p style="border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;"><b> Name 1</b>  (no stated gender), DoB Unknown</p> <hr/>  </div> </text> <name> 
           <text value="Name 1"/> 
         </name> 
      </Patient> 
    </resource> 
  </entry> 
  
      <!--    A duplicate patient (#2)    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Patient/45"/> 
    <resource> 
      <Patient> 
         <id value="45"/> 
         <meta> 
           <versionId value="2"/> 
         </meta> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p style="border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;"><b> Name 2</b>  (no stated gender), DoB Unknown</p> <hr/>  </div> </text> <name> 
           <text value="Name 2"/> 
         </name> 
      </Patient> 
    </resource> 
  </entry> 
  
      <!--    ambiguous reference .. commented out because the validator calls it an error
  <entry>
    <fullUrl value="http://example.org/fhir/Observation/46"/>
    <resource>
      <Observation>
        <id value="46"/>
         <status value="final"/> 
         <code> 
          <coding> 
            <system value="http://loinc.org"/> 
            <code value="15074-8"/> 
            <display value="Glucose [Moles/volume] in Blood"/> 
          </coding> 
        </code> 
        <subject>
          <reference value="Patient/45"/>
        </subject>
      </Observation>
    </resource>
  </entry>
     -->

      <!--    unambiguous reference    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/47"/> 
    <resource> 
      <Observation> 
        <id value="47"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="47"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;47&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="broken-link.html">Patient/45/_history/2</a> </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
          <reference value="Patient/45/_history/2"/> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 
  
      <!--    idnetifier based reference, resolves to first patient    -->
  <entry> 
    <fullUrl value="http://example.org/fhir/Observation/48"/> 
    <resource> 
      <Observation> 
        <id value="48"/> 
         <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative: Observation</b> <a name="48"> </a> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border:
             1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Observation &quot;48&quot; </p> </div> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <span/>  </p> </div> </text> <status value="final"/>  
         <code>  
          <coding>  
            <system value="http://loinc.org"/>  
            <code value="15074-8"/>  
            <display value="Glucose [Moles/volume] in Blood"/>  
          </coding>  
        </code>  
        <subject> 
           <identifier> 
            <system value="http://example.org/ids"/> 
            <value value="1234567"/> 
          </identifier> 
        </subject> 
      </Observation> 
    </resource> 
  </entry> 
  
  
</Bundle> 

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.