{
  "resourceType": "StructureDefinition",
  "id": "MaiaRiskAssessmentResultBundle",
  "url": "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRiskAssessmentResultBundle",
  "version": "1.0.0",
  "name": "MaiaRiskAssessmentResultBundle",
  "title": "MaiaRiskAssessmentResultBundle",
  "status": "draft",
  "experimental": false,
  "date": "2025-04-30",
  "publisher": "Tiplu GmbH",
  "description": "This profile defines the structure of the result bundle returned by the MaiaRiskAssessmentRequest operation. It contains all relevant resources associated with risk predictions and rule-based evaluations for a specific case, including RiskAssessments, referenced ServiceRequests, risk definitions, and recorded user interactions.",
  "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",
        "patternCode": "collection",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:RiskAssessment",
        "path": "Bundle.entry",
        "sliceName": "RiskAssessment",
        "short": "All RiskAssessment resources in the Bundle, where the filter takes effect.",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:RiskAssessment.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "RiskAssessment",
            "profile": [
              "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRuleBasedEvaluation",
              "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRiskPredictionModel"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:ServiceRequest",
        "path": "Bundle.entry",
        "sliceName": "ServiceRequest",
        "short": "All referenced ServiceRequests, referenced in the RiskAssessment resources in the Bundle.",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:ServiceRequest.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "ServiceRequest",
            "profile": [
              "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRuleBasedEvaluationServiceRequestHint"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:RiskAssessmentDefinition",
        "path": "Bundle.entry",
        "sliceName": "RiskAssessmentDefinition",
        "short": "All referenced MaiaRiskAssessmentDefinitions, referenced in the RiskAssessment resources in the Bundle.",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:RiskAssessmentDefinition.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Basic",
            "profile": [
              "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRiskAssessmentDefinition"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Interaction",
        "path": "Bundle.entry",
        "sliceName": "Interaction",
        "short": "All MaiaRuleBasedEvaluationInteraction that references to a MaiaRuleBasedEvaluation in the Bundle.",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Interaction.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Provenance",
            "profile": [
              "https://tiplu.de/fhir/maia/StructureDefinition/MaiaRuleBasedEvaluationInteraction"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}