{
  "resourceType": "StructureDefinition",
  "id": "set-context-output-parameters",
  "text": {
    "status": "additional",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>Referenced within the <code>$set-context</code> OperationDefinition in the <a href=\"https://hl7.org/fhir/r4/operationdefinition-definitions.html#OperationDefinition.outputProfile\">OperationDefinition.outputProfile</a> element, this profile provides additional constraints on the <a href=\"https://hl7.org/fhir/r4/Parameters.html\">Parameters</a> resource returned in the response to an invocation of the operation. While the <a href=\"https://hl7.org/fhir/r4/OperationDefinition.html\">OperationDefinition</a> resource typically allows for sufficient rule definition, FHIR R4 imposes a limitation: <code>Rule: A targetProfile can only be specified for parameters of type Reference or Canonical</code> (i.e., resource-typed parameters cannot be profiled using the <a href=\"https://hl7.org/fhir/r4/operationdefinition-definitions.html#OperationDefinition.parameter.targetProfile\">OperationDefinition.parameter.targetProfile</a> element). This limitation was addressed in FHIR R5 to accommodate such use cases, but for FHIR R4, the SetContextOutputParameters profile ensures that the <code>resourcesResponse</code> Bundle parameter in the response for <code>$set-context</code> is restricted to Bundles conforming to the SetContextTransactionResponseBundle profile.</p></div>"
  },
  "url": "http://fhir.infoway-inforoute.ca/io/HALO/StructureDefinition/set-context-output-parameters",
  "name": "SetContextOutputParameters",
  "status": "draft",
  "description": "A profile capturing more nuanced rules for the output Parameters resource returned by the $set-context operation that cannot be captured within the OperationDefinition itself.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Parameters",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Parameters",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Parameters.parameter",
        "path": "Parameters.parameter",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "name"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Parameters.parameter:launchID",
        "path": "Parameters.parameter",
        "sliceName": "launchID",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Parameters.parameter:launchID.name",
        "path": "Parameters.parameter.name",
        "fixedString": "launchID"
      },
      {
        "id": "Parameters.parameter:launchID.value[x]",
        "path": "Parameters.parameter.value[x]",
        "min": 1,
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Parameters.parameter:launchID.resource",
        "path": "Parameters.parameter.resource",
        "max": "0"
      },
      {
        "id": "Parameters.parameter:launchID.part",
        "path": "Parameters.parameter.part",
        "max": "0"
      },
      {
        "id": "Parameters.parameter:outcome",
        "path": "Parameters.parameter",
        "sliceName": "outcome",
        "min": 1,
        "max": "*"
      },
      {
        "id": "Parameters.parameter:outcome.name",
        "path": "Parameters.parameter.name",
        "fixedString": "outcome"
      },
      {
        "id": "Parameters.parameter:outcome.value[x]",
        "path": "Parameters.parameter.value[x]",
        "max": "0"
      },
      {
        "id": "Parameters.parameter:outcome.resource",
        "path": "Parameters.parameter.resource",
        "type": [
          {
            "code": "OperationOutcome"
          }
        ]
      },
      {
        "id": "Parameters.parameter:outcome.part",
        "path": "Parameters.parameter.part",
        "max": "0"
      },
      {
        "id": "Parameters.parameter:resourcesResponse",
        "path": "Parameters.parameter",
        "sliceName": "resourcesResponse",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Parameters.parameter:resourcesResponse.name",
        "path": "Parameters.parameter.name",
        "fixedString": "resourcesResponse"
      },
      {
        "id": "Parameters.parameter:resourcesResponse.value[x]",
        "path": "Parameters.parameter.value[x]",
        "max": "0"
      },
      {
        "id": "Parameters.parameter:resourcesResponse.resource",
        "path": "Parameters.parameter.resource",
        "min": 1,
        "type": [
          {
            "code": "Bundle",
            "profile": [
              "http://fhir.infoway-inforoute.ca/io/HALO/StructureDefinition/set-context-transaction-response-bundle"
            ]
          }
        ]
      },
      {
        "id": "Parameters.parameter:resourcesResponse.part",
        "path": "Parameters.parameter.part",
        "max": "0"
      }
    ]
  }
}