<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HSCICTestProject-spine-message-bundle-1-0" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2016-05-10T13:41:16.153+00:00" />
    <tag>
      <system value="urn:hscic:examples" />
      <code value="Example-qr-1a" />
      <display value="Spine-Message-Bundle-1-0 example containing FGM Query bundled resources from an NHS system that uses Spine RBAC" />
    </tag>
    <tag>
      <system value="urn:hscic:publishOrder" />
      <code value="01" />
    </tag>
    <tag>
      <system value="urn:hscic:examples" />
      <code value="Example-qr-1b" />
      <display value="Spine-Message-Bundle-1-0 example containing FGM Query bundled resources from an NHS system that does not use Spine RBAC" />
    </tag>
  </meta>
  <url value="http://fhir.nhs.net/StructureDefinition/spine-message-bundle-1-0" />
  <version value="0.0.1" />
  <name value="Spine-Message-Bundle-1-0" />
  <display value="Spine-Message-Bundle-1-0" />
  <status value="draft" />
  <publisher value="http://fhir.nhs.net" />
  <date value="2015-04-02T14:21:09+02:00" />
  <description value="This Bundle Resource is constrained for FGM Query messaging requirements. " />
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM" />
  </mapping>
  <kind value="resource" />
  <constrainedType value="Bundle" />
  <abstract value="false" />
  <base value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <snapshot>
    <element>
      <path value="Bundle" />
      <short value="Contains a collection of NHS FGM Query resources" />
      <definition value="A container for a collection of resources." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <constraint>
        <key value="bdl-3" />
        <severity value="error" />
        <human value="entry.transaction when (and only when) a transaction" />
        <xpath value="not(f:entry/f:transaction) or (f:type/@value = 'transaction') or (f:type/@value = 'history')" />
      </constraint>
      <constraint>
        <key value="bdl-4" />
        <severity value="error" />
        <human value="entry.transactionResponse when (and only when) a transaction-response" />
        <xpath value="not(f:entry/f:transactionResponse) or (f:type/@value = 'transaction-response')" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.type" />
      <short value="Bundle identified by bundle type 'message'." />
      <definition value="Indicates the purpose of this bundle - how it was intended to be used." />
      <comments value="It's possible to use a bundle for other purposes (e.g. a document can be accepted as a transaction). This is primarily defined so that there can be specific rules for some of the bundle types." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.type" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <fixedCode value="message" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Indicates the purpose of a bundle- how it was intended to be used" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/DSTU2/valueset-bundle-type.html" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="class" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.total" />
      <short value="If search, the total number of matches" />
      <definition value="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." />
      <comments value="Only used if the bundle is a search result set." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.total" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="unsignedInt" />
      </type>
      <condition value="bdl-1" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.link" />
      <name value="link" />
      <short value="Links related to this Bundle" />
      <definition value="A series of links that provide context to this bundle." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.link" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.link.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comments 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" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.link.relation" />
      <short value="http://www.iana.org/assignments/link-relations/link-relations.xhtml" />
      <definition value="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.link.relation" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.link.url" />
      <short value="Reference details for the link" />
      <definition value="The reference details for the link." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.link.url" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <slicing>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <short value="Entry in the bundle - will have a resource, or information" />
      <definition value="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Bundle.entry" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="bdl-5" />
        <severity value="error" />
        <human value="must be a resource unless there's a transaction or transaction response" />
        <xpath value="f:resource or f:request or f:response" />
      </constraint>
      <constraint>
        <key value="bdl-6" />
        <severity value="error" />
        <human value="The fullUrl element must be present when a resource is present, and not present otherwise" />
        <xpath value="(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))" />
      </constraint>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comments 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" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.entry.link" />
      <short value="Links related to this entry" />
      <definition value="A series of links that provide context to this entry." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Bundle.entry.link" />
        <min value="0" />
        <max value="*" />
      </base>
      <nameReference value="link" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.fullUrl" />
      <short value="Absolute URL for resource (server address, or UUID/OID)" />
      <definition value="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." />
      <comments value="fullUrl may not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then it SHALL end with the Resource.id." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.fullUrl" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.resource" />
      <short value="Resources in this bundle" />
      <definition value="The Resources for the entry." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.resource" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.entry.search" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comments 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" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.entry.search.mode" />
      <short value="match | include | outcome - why this is in the result set" />
      <definition value="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." />
      <comments value="There is only one mode. In some corner cases, a resource may be included because it is both a match and an include. In these circumstances, 'match' takes precedence." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.search.mode" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Why an entry is in the result set - whether it's included as a match or because of an _include requirement." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/search-entry-mode" />
        </valueSetReference>
      </binding>
    </element>
    <element>
      <path value="Bundle.entry.search.score" />
      <short value="Search ranking (between 0 and 1)" />
      <definition value="When searching, the server's search ranking score for the entry." />
      <comments value="Servers are not required to return a ranking score. 1 is most relevant, and 0 is least relevant. Often, search results are sorted by score, but the client may specify a different sort order." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.search.score" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="decimal" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-3" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comments 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" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.entry.request.method" />
      <short value="GET | POST | PUT | DELETE" />
      <definition value="The HTTP verb for this entry in either a update history, or a transaction/ transaction response." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.method" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="HTTP verbs (in the HTTP command line)." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/http-verb" />
        </valueSetReference>
      </binding>
    </element>
    <element>
      <path value="Bundle.entry.request.url" />
      <short value="URL for HTTP equivalent of this entry" />
      <definition value="The URL for this entry, relative to the root (the address to which the request is posted)." />
      <comments value="E.g. for a Patient Create, the method would be &quot;POST&quot; and the URL would be &quot;Patient&quot;. For a Patient Update, the method would be PUT, and the URL would be &quot;Patient/[id]&quot;." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.url" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request.ifNoneMatch" />
      <short value="For managing cache currency" />
      <definition value="If the ETag values match, return a 304 Not modified status. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.ifNoneMatch" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request.ifModifiedSince" />
      <short value="For managing update contention" />
      <definition value="Only perform the operation if the last updated date matches. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.ifModifiedSince" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="instant" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request.ifMatch" />
      <short value="For managing update contention" />
      <definition value="Only perform the operation if the Etag value matches. For more information, see the API section [&quot;Managing Resource Contention&quot;](http.html#concurrency)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.ifMatch" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request.ifNoneExist" />
      <short value="For conditional creates" />
      <definition value="Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [&quot;Conditional Create&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the &quot;?&quot; (not including the &quot;?&quot;)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.request.ifNoneExist" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.response" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-4" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comments 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" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.entry.response.status" />
      <short value="Status return code for entry" />
      <definition value="The status code returned by processing this entry." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.response.status" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response.location" />
      <short value="The location, if the operation returns a location" />
      <definition value="The location header created by processing this operation." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.response.location" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response.etag" />
      <short value="The etag for the resource (if relevant)" />
      <definition value="The etag for the resource, it the operation for the entry produced a versioned resource." />
      <comments value="This has to match the version id in the header if a resource is included." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.response.etag" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response.lastModified" />
      <short value="Server's date time modified" />
      <definition value="The date/time that the resource was modified on the server." />
      <comments value="This has to match the same time in the meta header if a resource is included." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.response.lastModified" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="instant" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature" />
      <short value="XML Digital Signature (base64 encoded)" />
      <definition value="XML Digital Signature - base64 encoded." />
      <comments value="This is base 64 encoded to address issues with json/xml." />
      <requirements value="This element allows capturing signatures on documents. It also allows signatures on messages, transactions or even query responses. It may support content-authentication, non-repudiation or other business cases. This is primarily relevant where the bundle may travel through multiple hops or via other mechanisms where HTTPS non-repudiation is insufficient." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.signature" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Signature" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature.type" />
      <short value="Indication of the reason the entity signed the object(s)" />
      <definition value="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." />
      <comments value="Examples include attesting to: authorship, correct transcription, and witness of specific event. Also known as a &amp;quot;Commitment Type Indication&amp;quot;." />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="Signature.type" />
        <min value="1" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="preferred" />
        <description value="An indication of the reason that an entity signed the object" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/signature-type" />
        </valueSetReference>
      </binding>
    </element>
    <element>
      <path value="Bundle.signature.type.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comments value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.signature.type.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comments value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.signature.type.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.signature.type.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.signature.type.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comments value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.signature.when" />
      <short value="When the signature was created" />
      <definition value="When the digital signature was signed." />
      <comments value="This should agree with the information in the signature." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Signature.when" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="instant" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature.who[x]" />
      <short value="Who signed the signature" />
      <definition value="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." />
      <comments value="This should agree with the information in the signature." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Signature.who[x]" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature.contentType" />
      <short value="The technical format of the signature" />
      <definition value="A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Signature.contentType" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="The mime type of an attachment. Any valid mime type is allowed." />
        <valueSetUri value="http://www.rfc-editor.org/bcp/bcp13.txt" />
      </binding>
    </element>
    <element>
      <path value="Bundle.signature.blob" />
      <short value="The actual signature content (XML DigSig. JWT, picture, etc.)" />
      <definition value="The base64 encoding of the Signature content." />
      <comments value="Where the signature type is an XML DigSig, the signed content is a FHIR Resource(s), the signature is of the XML form of the Resource(s) using  XML-Signature (XMLDIG) &quot;Detached Signature&quot; form." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Signature.blob" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="base64Binary" />
      </type>
      <isSummary value="true" />
    </element>
  </snapshot>
  <differential>
    <element>
      <path value="Bundle" />
      <short value="Contains a collection of NHS FGM Query resources" />
      <definition value="A container for a collection of resources." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <constraint>
        <key value="bdl-3" />
        <severity value="error" />
        <human value="entry.transaction when (and only when) a transaction" />
        <xpath value="not(f:entry/f:transaction) or (f:type/@value = 'transaction') or (f:type/@value = 'history')" />
      </constraint>
      <constraint>
        <key value="bdl-4" />
        <severity value="error" />
        <human value="entry.transactionResponse when (and only when) a transaction-response" />
        <xpath value="not(f:entry/f:transactionResponse) or (f:type/@value = 'transaction-response')" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.type" />
      <short value="Bundle identified by bundle type 'message'." />
      <definition value="Indicates the purpose of this bundle - how it was intended to be used." />
      <comments value="It's possible to use a bundle for other purposes (e.g. a document can be accepted as a transaction). This is primarily defined so that there can be specific rules for some of the bundle types." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Bundle.type" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <fixedCode value="message" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Indicates the purpose of a bundle- how it was intended to be used" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/DSTU2/valueset-bundle-type.html" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="class" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.total" />
      <short value="If search, the total number of matches" />
      <definition value="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." />
      <comments value="Only used if the bundle is a search result set." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.total" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="unsignedInt" />
      </type>
      <condition value="bdl-1" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.link" />
      <name value="link" />
      <short value="Links related to this Bundle" />
      <definition value="A series of links that provide context to this bundle." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.link" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <slicing>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <short value="Entry in the bundle - will have a resource, or information" />
      <definition value="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Bundle.entry" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="bdl-5" />
        <severity value="error" />
        <human value="must be a resource unless there's a transaction or transaction response" />
        <xpath value="f:resource or f:request or f:response" />
      </constraint>
      <constraint>
        <key value="bdl-6" />
        <severity value="error" />
        <human value="The fullUrl element must be present when a resource is present, and not present otherwise" />
        <xpath value="(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))" />
      </constraint>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.resource" />
      <short value="Resources in this bundle" />
      <definition value="The Resources for the entry." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Bundle.entry.resource" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.entry.search" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature" />
      <short value="XML Digital Signature (base64 encoded)" />
      <definition value="XML Digital Signature - base64 encoded." />
      <comments value="This is base 64 encoded to address issues with json/xml." />
      <requirements value="This element allows capturing signatures on documents. It also allows signatures on messages, transactions or even query responses. It may support content-authentication, non-repudiation or other business cases. This is primarily relevant where the bundle may travel through multiple hops or via other mechanisms where HTTPS non-repudiation is insufficient." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Bundle.signature" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Signature" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature.who[x]" />
      <short value="Who signed the signature" />
      <definition value="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." />
      <comments value="This should agree with the information in the signature." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Signature.who[x]" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <isSummary value="true" />
    </element>
  </differential>
</StructureDefinition>