{
  "resourceType": "StructureDefinition",
  "id": "set-context-transaction-bundle",
  "text": {
    "status": "additional",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>This profile defines constraints on the FHIR Bundle resource used in the <code>resources</code> input parameter of the <code>$set-context</code> operation to support the writing of clinical context data to the SoFA FHIR server before launching a SMART app. Its primary purpose is to constrain the resources a Point of Care (PoC) system can include—such as Patient, Encounter, or Practitioner—when invoking the operation, ensuring that the necessary clinical context is available to and interpretable by the SMART on FHIR app.</p><p>The Bundle SHALL be of type <code>transaction</code>, meaning all operations within the Bundle are processed atomically. If any operation fails, the entire transaction SHALL be rolled back to maintain system consistency. Resources included in the Bundle, where profiled, SHALL conform to the specified <a href=\"https://simplifier.net/ca-core\">CA Core+</a> profiles and types defined by the jurisdictional implementation. The SoFA system SHALL reject any Bundle containing unsupported resource types or resources that violate these constraints.</p></div>"
  },
  "url": "http://fhir.infoway-inforoute.ca/io/HALO/StructureDefinition/set-context-transaction-bundle",
  "name": "SetContextTransactionBundle",
  "status": "draft",
  "description": "A profile of Bundle capturing the resources to be populated within the SoFA as a result of the $set-context operation.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "fixedCode": "transaction"
      },
      {
        "id": "Bundle.entry.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1
      },
      {
        "id": "Bundle.entry.request",
        "path": "Bundle.entry.request",
        "min": 1
      },
      {
        "id": "Bundle.entry.request.method",
        "path": "Bundle.entry.request.method",
        "fixedCode": "POST"
      }
    ]
  }
}