<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="set-context-transaction-response-bundle" />
  <text>
    <status value="additional" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>This profile defines constraints on the FHIR Bundle resource used in the <code>resourcesResponse</code> output parameter of the <code>$set-context</code> operation response. The Bundle SHALL be of type transaction-response and SHALL communicate the results of the transaction executed in response to the SetContextTransactionBundle submitted during the operation invocation. Systems receiving and processing the input transaction Bundle SHALL return this Bundle in the response to detail the outcomes of the transaction, including resource creations, updates, or failures. Point of Care (PoC) systems writing resources to the SoFA via the <code>$set-context</code> operation, SHOULD store a mapping between the local IDs of the resources submitted and the resource IDs returned in this Bundle. This mapping is not only recommended for traceability purposes, but also to enable PoC systems to reconcile resource updates received through the HALO Subscription mechanism post-launch.</p>
    </div>
  </text>
  <url value="http://fhir.infoway-inforoute.ca/io/HALO/StructureDefinition/set-context-transaction-response-bundle" />
  <name value="SetContextTransactionResponseBundle" />
  <status value="draft" />
  <description value="A Bundle profile which communicates the outcome of the create interaction on the SoFA for each resource included in the input transaction Bundle of the $set-context operation." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <fixedCode value="transaction-response" />
    </element>
    <element id="Bundle.entry.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
    </element>
    <element id="Bundle.entry.response.location">
      <path value="Bundle.entry.response.location" />
      <min value="1" />
    </element>
    <element id="Bundle.entry.response.etag">
      <path value="Bundle.entry.response.etag" />
      <min value="1" />
    </element>
    <element id="Bundle.entry.response.lastModified">
      <path value="Bundle.entry.response.lastModified" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>