FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions

Example StructureDefinition/Reference (XML)

Modeling and Methodology Work GroupMaturity Level: N/AStandards Status: Informative

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

StructureDefinition for Reference

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

<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Reference"/> 
  <text> 
    <status value="generated"/> 
    <div xmlns="http://www.w3.org/1999/xhtml">
      <table border="0" cellpadding="0" cellspacing="0" style="border: 0px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align:
       top;">
        <tr style="border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align:
         top">
          <th class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="The logical name of the element">Name</a> 
          </th> 
          <th class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Information about the use of the element">Flags</a> 
          </th> 
          <th class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Minimum and Maximum # of times the the element can appear in the instance">Card.</a> 
          </th> 
          <th class="hierarchy" style="width: 100px">
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Reference to the type of the element">Type</a> 
          </th> 
          <th class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Additional information about the element">Description &amp; Constraints</a> 
            <span style="float: right">
              <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Legend for this format">
                <img alt="doco" src="data:(snipped in html view)" style="background-color: inherit"/> 
              </a> 
            </span> 
          </th> 
        </tr> 
        <tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color:
         white">
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(data:image/png;bas
          e64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAACCAYAAACg/LjIAAAAJUlEQVR4Xu3IIQEAAAgDsHd9/w4EQIOamFnaBgAA4M
          MKAACAKwNp30CqZFfFmwAAAABJRU5ErkJggg==)">
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: white; background-color: inherit" title="Element"/>  
            <a href="references-definitions.html#Reference" title="Reference : A reference from one resource to another.">Reference</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="elementdefinition-definitions.html#ElementDefinition.isSummary" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is included in summaries">Σ</a> 
            <a href="versions.html#std-process" style="padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold;
             color: black; background-color: #e6ffe6" title="Standards Status = Normative">N</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px"/> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="types.html#Element">Element</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">A reference from one resource to another
            <br/>  
            <span style="font-style: italic" title="ref-1">+ Rule: SHALL have a contained resource if a local reference is provided</span> 
            <br/>  
            <span style="font-style: italic" title="ref-2">+ Rule: At least one of reference, identifier and display SHALL be present (unless
               an extension is provided).</span> 
            <br/>  
            <br/>  Elements defined in Ancestors: 
            <a href="types.html#Element" title="Unique id for the element within a resource (for internal references). This may
             be any string value that does not contain spaces.">id</a> , 
            <a href="types.html#Element" title="May be used to represent additional information that is not part of the basic definition
             of the element. To make the use of extensions safe and managable, there is a strict
             set of governance applied to the definition and use of extensions. Though any implementer
             can define an extension, there is a set of requirements that SHALL be met as part
             of the definition of the extension.">extension</a> 
          </td> 
        </tr> 

        <tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color:
         #F7F7F7">
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image:
           url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAACCAYAAACg/LjIAAAALUlEQVR4Xu3IoREAIAw
          EwfT6/ddA0GBAxO3NrLlKUj9263wAAAAvrgEAADClAVWFQIBRHMicAAAAAElFTkSuQmCC)">
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: #F7F7F7; background-color: inherit" title="Primitive Data Type"/>  
            <a href="references-definitions.html#Reference.reference" title="Reference.reference : A reference to a location at which the other resource is
             found. The reference may be a relative reference, in which case it is relative
             to the service base URL, or an absolute URL that resolves to the location where
             the resource is found. The reference may be version specific or not. If the reference
             is not to a FHIR RESTful server, then it should be assumed to be version specific.
             Internal fragment references (start with '#') refer to contained resources.">reference</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">
            <a href="elementdefinition-definitions.html#ElementDefinition.isSummary" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is included in summaries">Σ</a> 
            <a href="conformance-rules.html#constraints" style="padding-left: 3px; padding-right: 3px; border: 1px maroon solid; font-weight: bold;
             color: #301212; background-color: #fdf4f4;" title="This element has or is affected by some invariants">C</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">0..1</td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">
            <a href="datatypes.html#string">string</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">Literal reference, Relative, internal or absolute URL
            <br/>  
          </td> 
        </tr> 

        <tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color:
         white">
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(data:image/png;bas
          e64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAACCAYAAACg/LjIAAAALUlEQVR4Xu3IoREAIAwEwfT6/ddA0GBAxO3NrLlKUj
          9263wAAAAvrgEAADClAVWFQIBRHMicAAAAAElFTkSuQmCC)">
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: white; background-color: inherit" title="Primitive Data Type"/>  
            <a href="references-definitions.html#Reference.type" title="Reference.type : The expected type of the target of the reference. If both Reference.type
             and Reference.reference are populated and Reference.reference is a FHIR URL, both
             SHALL be consistent.

The type is the Canonical URL of Resource Definition that is the type this reference
             refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/
             e.g. &quot;Patient&quot; is a reference to http://hl7.org/fhir/StructureDefinition/Patient.
             Absolute URLs are only allowed for logical models (and can only be used in references
             in logical models, not resources).">type</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="elementdefinition-definitions.html#ElementDefinition.isSummary" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is included in summaries">Σ</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">0..1</td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="datatypes.html#uri">uri</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">Type the reference refers to (e.g. &quot;Patient&quot;) - must be a resource in
             resources
            <br/>  Binding: 
            <a href="valueset-resource-types.html" title="Aa resource (or, for logical models, the URI of the logical model).">Resource Types</a>  (
            <a href="terminologies.html#extensible" title="To be conformant, the concept in this element SHALL be from the specified value
             set if any of the codes within the value set can apply to the concept being communicated.
              If the value set does not cover the concept (based on human review), alternate
             codings (or, data type allowing, text) may be included instead.">Extensible</a> )
            <br/>  
          </td> 
        </tr> 

        <tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color:
         #F7F7F7">
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image:
           url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAACCAYAAACg/LjIAAAALUlEQVR4Xu3IoREAIAw
          EwfT6/ddA0GBAxO3NrLlKUj9263wAAAAvrgEAADClAVWFQIBRHMicAAAAAElFTkSuQmCC)">
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: #F7F7F7; background-color: inherit" title="Data Type"/>  
            <a href="references-definitions.html#Reference.identifier" title="Reference.identifier : An identifier for the target resource. This is used when
             there is no way to reference the other resource directly, either because the entity
             it represents is not available through a FHIR server, or because there is no way
             for the author of the resource to convert a known identifier to an actual location.
             There is no requirement that a Reference.identifier point to something that is
             actually exposed as a FHIR instance, but it SHALL point to a business concept that
             would be expected to be exposed as a FHIR instance, and that instance would need
             to be of a FHIR resource type allowed by the reference.">identifier</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">
            <a href="elementdefinition-definitions.html#ElementDefinition.isSummary" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is included in summaries">Σ</a> 
            <a href="conformance-rules.html#constraints" style="padding-left: 3px; padding-right: 3px; border: 1px maroon solid; font-weight: bold;
             color: #301212; background-color: #fdf4f4;" title="This element has or is affected by some invariants">C</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">0..1</td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">
            <a href="datatypes.html#Identifier">Identifier</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px
           #F0F0F0 solid; padding:0px 4px 0px 4px">Logical reference, when literal reference is not known
            <br/>  
          </td> 
        </tr> 

        <tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color:
         white">
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(data:image/png;bas
          e64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAACCAYAAACg/LjIAAAAJUlEQVR4Xu3IIQEAAAgDsHd9/w4EQIOamFnaBgAA4M
          MKAACAKwNp30CqZFfFmwAAAABJRU5ErkJggg==)">
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: inherit"/> 
            <img alt="." class="hierarchy" src="data:(snipped in html view)" style="background-color: white; background-color: inherit" title="Primitive Data Type"/>  
            <a href="references-definitions.html#Reference.display" title="Reference.display : Plain text narrative that identifies the resource in addition
             to the resource reference.">display</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="elementdefinition-definitions.html#ElementDefinition.isSummary" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is included in summaries">Σ</a> 
            <a href="languages.html#translatable" style="padding-left: 3px; padding-right: 3px; color: black; null" title="This element is a candidate for being translated">T</a> 
            <a href="conformance-rules.html#constraints" style="padding-left: 3px; padding-right: 3px; border: 1px maroon solid; font-weight: bold;
             color: #301212; background-color: #fdf4f4;" title="This element has or is affected by some invariants">C</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">0..1</td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">
            <a href="datatypes.html#string">string</a> 
          </td> 
          <td class="hierarchy" style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0
           solid; padding:0px 4px 0px 4px">Text alternative for the resource
            <br/>  
          </td> 
        </tr> 

        <tr> 
          <td class="hierarchy" colspan="5">
            <br/>  
            <a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Legend for this format">
              <img alt="doco" src="data:(snipped in html view)" style="background-color: inherit"/>  Documentation for this format
            </a> 
          </td> 
        </tr> 
      </table> 
    </div> 
  </text> 
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="normative"/> 
  </extension> 
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
    <valueCode value="4.0.0"/> 
  </extension> 
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="has-target"/> 
  </extension> 
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="fhir"/> 
  </extension> 
  <url value="http://hl7.org/fhir/StructureDefinition/Reference"/> 
  <version value="6.0.0-cibuild"/> 
  <name value="Reference"/> 
  <status value="active"/> 
  <experimental value="false"/> 
  <date value="2024-03-27T11:56:58+00:00"/> 
  <publisher value="HL7 International / FHIR Infrastructure"/> 
  <contact> 
    <telecom> 
      <system value="url"/> 
      <value value="http://hl7.org/fhir"/> 
    </telecom> 
  </contact> 
  <contact> 
    <telecom> 
      <system value="url"/> 
      <value value="http://www.hl7.org/Special/committees/fiwg"/> 
    </telecom> 
  </contact> 
  <description value="Reference Type: A reference from one resource to another."/> 
  <jurisdiction> 
    <coding> 
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/> 
      <code value="001"/> 
      <display value="World"/> 
    </coding> 
  </jurisdiction> 
  <fhirVersion value="6.0.0-cibuild"/> 
  <mapping> 
    <identity value="rim"/> 
    <uri value="http://hl7.org/v3"/> 
    <name value="RIM Mapping"/> 
  </mapping> 
  <kind value="complex-type"/> 
  <abstract value="false"/> 
  <type value="Reference"/> 
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DataType"/> 
  <derivation value="specialization"/> 
  <snapshot> 
    <element id="Reference">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative"/> 
      </extension> 
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0"/> 
      </extension> 
      <path value="Reference"/> 
      <short value="A reference from one resource to another"/> 
      <definition value="A reference from one resource to another."/> 
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable
       (allowing for access control, temporary unavailability, etc.). Resolution can be
       either by retrieval from the URL, or, where applicable by resource type, by treating
       an absolute reference as a canonical URL and looking it up in a local registry/repository."/> 
      <min value="0"/> 
      <max value="*"/> 
      <base> 
        <path value="Reference"/> 
        <min value="0"/> 
        <max value="*"/> 
      </base> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <constraint> 
        <key value="ref-1"/> 
        <severity value="error"/> 
        <human value="SHALL have a contained resource if a local reference is provided"/> 
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace
        ('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%reso
        urce))"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Reference"/> 
      </constraint> 
      <constraint> 
        <key value="ref-2"/> 
        <severity value="error"/> 
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension
         is provided)."/> 
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Reference"/> 
      </constraint> 
      <isModifier value="false"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="n/a,The target of a resource reference is a RIM entry point (Act, Role, or Entity)"/> 
      </mapping> 
    </element> 
    <element id="Reference.id">
      <path value="Reference.id"/> 
      <representation value="xmlAttr"/> 
      <short value="Unique id for inter-element referencing"/> 
      <definition value="Unique id for the element within a resource (for internal references). This may
       be any string value that does not contain spaces."/> 
      <min value="0"/> 
      <max value="1"/> 
      <base> 
        <path value="Element.id"/> 
        <min value="0"/> 
        <max value="1"/> 
      </base> 
      <!--  Note: special primitive values have a FHIRPath system type. e.g. this is compiler
       magic (j)  -->
      <type> 
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="id"/> 
        </extension> 
        <code value="http://hl7.org/fhirpath/System.String"/> 
      </type> 
      <condition value="ele-1"/> 
      <isModifier value="false"/> 
      <isSummary value="false"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="n/a"/> 
      </mapping> 
    </element> 
    <element id="Reference.extension">
      <path value="Reference.extension"/> 
      <slicing> 
        <discriminator> 
          <type value="value"/> 
          <path value="url"/> 
        </discriminator> 
        <description value="Extensions are always sliced by (at least) url"/> 
        <rules value="open"/> 
      </slicing> 
      <short value="Additional content defined by implementations"/> 
      <definition value="May be used to represent additional information that is not part of the basic definition
       of the element. To make the use of extensions safe and managable, there is a strict
       set of governance applied to the definition and use of extensions. Though any implementer
       can define an extension, there is a set of requirements that SHALL be met as part
       of the definition of the extension."/> 
      <comment value="There can be no stigma associated with the use of extensions by any application,
       project, or standard - regardless of the institution or jurisdiction that uses
       or defines the extensions.  The use of extensions is what allows the FHIR specification
       to retain a core level of simplicity for everyone."/> 
      <alias value="extensions"/> 
      <alias value="user content"/> 
      <min value="0"/> 
      <max value="*"/> 
      <base> 
        <path value="Element.extension"/> 
        <min value="0"/> 
        <max value="*"/> 
      </base> 
      <type> 
        <code value="Extension"/> 
      </type> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <isModifier value="false"/> 
      <isSummary value="false"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="n/a"/> 
      </mapping> 
    </element> 
    <element id="Reference.reference">
      <path value="Reference.reference"/> 
      <short value="Literal reference, Relative, internal or absolute URL"/> 
      <definition value="A reference to a location at which the other resource is found. The reference may
       be a relative reference, in which case it is relative to the service base URL,
       or an absolute URL that resolves to the location where the resource is found. The
       reference may be version specific or not. If the reference is not to a FHIR RESTful
       server, then it should be assumed to be version specific. Internal fragment references
       (start with '#') refer to contained resources."/> 
      <comment value="Using absolute URLs provides a stable scalable approach suitable for a cloud/web
       context, while using relative/logical references provides a flexible approach suitable
       for use when trading across closed eco-system boundaries.   Absolute URLs do not
       need to point to a FHIR RESTful server, though this is the preferred approach.
       If the URL conforms to the structure &quot;[type]/[id]&quot; then it should be
       assumed that the reference is to a FHIR RESTful server."/> 
      <min value="0"/> 
      <max value="1"/> 
      <base> 
        <path value="Reference.reference"/> 
        <min value="0"/> 
        <max value="1"/> 
      </base> 
      <type> 
        <code value="string"/> 
      </type> 
      <condition value="ref-2"/> 
      <condition value="ref-1"/> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <isModifier value="false"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
    <element id="Reference.type">
      <path value="Reference.type"/> 
      <short value="Type the reference refers to (e.g. &quot;Patient&quot;) - must be a resource in
       resources"/> 
      <definition value="The expected type of the target of the reference. If both Reference.type and Reference.refere
      nce are populated and Reference.reference is a FHIR URL, both SHALL be consistent.

The type is the Canonical URL of Resource Definition that is the type this reference
       refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/
       e.g. &quot;Patient&quot; is a reference to http://hl7.org/fhir/StructureDefinition/Patient.
       Absolute URLs are only allowed for logical models (and can only be used in references
       in logical models, not resources)."/> 
      <comment value="This element is used to indicate the type of  the target of the reference. This
       may be used which ever of the other elements are populated (or not). In some cases,
       the type of the target may be determined by inspection of the reference (e.g. a
       known RESTful URL) or by resolving the target of the reference."/> 
      <min value="0"/> 
      <max value="1"/> 
      <base> 
        <path value="Reference.type"/> 
        <min value="0"/> 
        <max value="1"/> 
      </base> 
      <type> 
        <code value="uri"/> 
      </type> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <isModifier value="false"/> 
      <isSummary value="true"/> 
      <binding> 
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/binding-definition">
          <valueMarkdown value="Aa resource (or, for logical models, the URI of the logical model)."/> 
        </extension> 
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="FHIRResourceTypeExt"/> 
        </extension> 
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/> 
        </extension> 
        <strength value="extensible"/> 
        <description value="Aa resource (or, for logical models, the URI of the logical model)."/> 
        <valueSet value="http://hl7.org/fhir/ValueSet/resource-types"/> 
      </binding> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
    <element id="Reference.identifier">
      <path value="Reference.identifier"/> 
      <short value="Logical reference, when literal reference is not known"/> 
      <definition value="An identifier for the target resource. This is used when there is no way to reference
       the other resource directly, either because the entity it represents is not available
       through a FHIR server, or because there is no way for the author of the resource
       to convert a known identifier to an actual location. There is no requirement that
       a Reference.identifier point to something that is actually exposed as a FHIR instance,
       but it SHALL point to a business concept that would be expected to be exposed as
       a FHIR instance, and that instance would need to be of a FHIR resource type allowed
       by the reference."/> 
      <comment value="When an identifier is provided in place of a reference, any system processing the
       reference will only be able to resolve the identifier to a reference if it understands
       the business context in which the identifier is used. Sometimes this is global
       (e.g. a national identifier) but often it is not. For this reason, none of the
       useful mechanisms described for working with references (e.g. chaining, includes)
       are possible, nor should servers be expected to be able resolve the reference.
       Servers may accept an identifier based reference untouched, resolve it, and/or
       reject it - see CapabilityStatement.rest.resource.referencePolicy. 

When both an identifier and a literal reference are provided, the literal reference
       is preferred. Applications processing the resource are allowed - but not required
       - to check that the identifier matches the literal reference

Applications converting a logical reference to a literal reference may choose to
       leave the logical reference present, or remove it.

Reference is intended to point to a structure that can potentially be expressed
       as a FHIR resource, though there is no need for it to exist as an actual FHIR resource
       instance - except in as much as an application wishes to actual find the target
       of the reference. The content referred to be the identifier must meet the logical
       constraints implied by any limitations on what resource types are permitted for
       the reference.  For example, it would not be legitimate to send the identifier
       for a drug prescription if the type were Reference(Observation|DiagnosticReport).
        One of the use-cases for Reference.identifier is the situation where no FHIR representation
       exists (where the type is Reference (Any).

This element only allows for a single identifier. In the case where additional
       identifiers are required, use the [http://hl7.org/fhir/StructureDefinition/additionalIdentifi
      er](https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-additionalIdentifier.htm
      l) extension."/> 
      <min value="0"/> 
      <max value="1"/> 
      <base> 
        <path value="Reference.identifier"/> 
        <min value="0"/> 
        <max value="1"/> 
      </base> 
      <type> 
        <code value="Identifier"/> 
      </type> 
      <condition value="ref-2"/> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <isModifier value="false"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value=".identifier"/> 
      </mapping> 
    </element> 
    <element id="Reference.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/> 
      </extension> 
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/> 
      </extension> 
      <path value="Reference.display"/> 
      <short value="Text alternative for the resource"/> 
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference."/> 
      <comment value="This is generally not the same as the Resource.text of the referenced resource.
        The purpose is to identify what's being referenced, not to fully describe it."/> 
      <min value="0"/> 
      <max value="1"/> 
      <base> 
        <path value="Reference.display"/> 
        <min value="0"/> 
        <max value="1"/> 
      </base> 
      <type> 
        <code value="string"/> 
      </type> 
      <condition value="ref-2"/> 
      <constraint> 
        <key value="ele-1"/> 
        <severity value="error"/> 
        <human value="All FHIR elements must have a @value or children"/> 
        <expression value="hasValue() or (children().count() &gt; id.count())"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Element"/> 
      </constraint> 
      <isModifier value="false"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
  </snapshot> 
  <differential> 
    <element id="Reference">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative"/> 
      </extension> 
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0"/> 
      </extension> 
      <path value="Reference"/> 
      <short value="A reference from one resource to another"/> 
      <definition value="A reference from one resource to another."/> 
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable
       (allowing for access control, temporary unavailability, etc.). Resolution can be
       either by retrieval from the URL, or, where applicable by resource type, by treating
       an absolute reference as a canonical URL and looking it up in a local registry/repository."/> 
      <min value="0"/> 
      <max value="*"/> 
      <constraint> 
        <key value="ref-1"/> 
        <severity value="error"/> 
        <human value="SHALL have a contained resource if a local reference is provided"/> 
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace
        ('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%reso
        urce))"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Reference"/> 
      </constraint> 
      <constraint> 
        <key value="ref-2"/> 
        <severity value="error"/> 
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension
         is provided)."/> 
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()"/> 
        <source value="http://hl7.org/fhir/StructureDefinition/Reference"/> 
      </constraint> 
      <mapping> 
        <identity value="rim"/> 
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)"/> 
      </mapping> 
    </element> 
    <element id="Reference.reference">
      <path value="Reference.reference"/> 
      <short value="Literal reference, Relative, internal or absolute URL"/> 
      <definition value="A reference to a location at which the other resource is found. The reference may
       be a relative reference, in which case it is relative to the service base URL,
       or an absolute URL that resolves to the location where the resource is found. The
       reference may be version specific or not. If the reference is not to a FHIR RESTful
       server, then it should be assumed to be version specific. Internal fragment references
       (start with '#') refer to contained resources."/> 
      <comment value="Using absolute URLs provides a stable scalable approach suitable for a cloud/web
       context, while using relative/logical references provides a flexible approach suitable
       for use when trading across closed eco-system boundaries.   Absolute URLs do not
       need to point to a FHIR RESTful server, though this is the preferred approach.
       If the URL conforms to the structure &quot;[type]/[id]&quot; then it should be
       assumed that the reference is to a FHIR RESTful server."/> 
      <min value="0"/> 
      <max value="1"/> 
      <type> 
        <code value="string"/> 
      </type> 
      <condition value="ref-2"/> 
      <condition value="ref-1"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
    <element id="Reference.type">
      <path value="Reference.type"/> 
      <short value="Type the reference refers to (e.g. &quot;Patient&quot;) - must be a resource in
       resources"/> 
      <definition value="The expected type of the target of the reference. If both Reference.type and Reference.refere
      nce are populated and Reference.reference is a FHIR URL, both SHALL be consistent.

The type is the Canonical URL of Resource Definition that is the type this reference
       refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/
       e.g. &quot;Patient&quot; is a reference to http://hl7.org/fhir/StructureDefinition/Patient.
       Absolute URLs are only allowed for logical models (and can only be used in references
       in logical models, not resources)."/> 
      <comment value="This element is used to indicate the type of  the target of the reference. This
       may be used which ever of the other elements are populated (or not). In some cases,
       the type of the target may be determined by inspection of the reference (e.g. a
       known RESTful URL) or by resolving the target of the reference."/> 
      <min value="0"/> 
      <max value="1"/> 
      <type> 
        <code value="uri"/> 
      </type> 
      <isSummary value="true"/> 
      <binding> 
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/binding-definition">
          <valueMarkdown value="Aa resource (or, for logical models, the URI of the logical model)."/> 
        </extension> 
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="FHIRResourceTypeExt"/> 
        </extension> 
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/> 
        </extension> 
        <strength value="extensible"/> 
        <description value="Aa resource (or, for logical models, the URI of the logical model)."/> 
        <valueSet value="http://hl7.org/fhir/ValueSet/resource-types"/> 
      </binding> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
    <element id="Reference.identifier">
      <path value="Reference.identifier"/> 
      <short value="Logical reference, when literal reference is not known"/> 
      <definition value="An identifier for the target resource. This is used when there is no way to reference
       the other resource directly, either because the entity it represents is not available
       through a FHIR server, or because there is no way for the author of the resource
       to convert a known identifier to an actual location. There is no requirement that
       a Reference.identifier point to something that is actually exposed as a FHIR instance,
       but it SHALL point to a business concept that would be expected to be exposed as
       a FHIR instance, and that instance would need to be of a FHIR resource type allowed
       by the reference."/> 
      <comment value="When an identifier is provided in place of a reference, any system processing the
       reference will only be able to resolve the identifier to a reference if it understands
       the business context in which the identifier is used. Sometimes this is global
       (e.g. a national identifier) but often it is not. For this reason, none of the
       useful mechanisms described for working with references (e.g. chaining, includes)
       are possible, nor should servers be expected to be able resolve the reference.
       Servers may accept an identifier based reference untouched, resolve it, and/or
       reject it - see CapabilityStatement.rest.resource.referencePolicy. 

When both an identifier and a literal reference are provided, the literal reference
       is preferred. Applications processing the resource are allowed - but not required
       - to check that the identifier matches the literal reference

Applications converting a logical reference to a literal reference may choose to
       leave the logical reference present, or remove it.

Reference is intended to point to a structure that can potentially be expressed
       as a FHIR resource, though there is no need for it to exist as an actual FHIR resource
       instance - except in as much as an application wishes to actual find the target
       of the reference. The content referred to be the identifier must meet the logical
       constraints implied by any limitations on what resource types are permitted for
       the reference.  For example, it would not be legitimate to send the identifier
       for a drug prescription if the type were Reference(Observation|DiagnosticReport).
        One of the use-cases for Reference.identifier is the situation where no FHIR representation
       exists (where the type is Reference (Any).

This element only allows for a single identifier. In the case where additional
       identifiers are required, use the [http://hl7.org/fhir/StructureDefinition/additionalIdentifi
      er](https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-additionalIdentifier.htm
      l) extension."/> 
      <min value="0"/> 
      <max value="1"/> 
      <type> 
        <code value="Identifier"/> 
      </type> 
      <condition value="ref-2"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value=".identifier"/> 
      </mapping> 
    </element> 
    <element id="Reference.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/> 
      </extension> 
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/> 
      </extension> 
      <path value="Reference.display"/> 
      <short value="Text alternative for the resource"/> 
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference."/> 
      <comment value="This is generally not the same as the Resource.text of the referenced resource.
        The purpose is to identify what's being referenced, not to fully describe it."/> 
      <min value="0"/> 
      <max value="1"/> 
      <type> 
        <code value="string"/> 
      </type> 
      <condition value="ref-2"/> 
      <isSummary value="true"/> 
      <mapping> 
        <identity value="rim"/> 
        <map value="N/A"/> 
      </mapping> 
    </element> 
  </differential> 
</StructureDefinition> 

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.