{
  "resourceType": "StructureDefinition",
  "id": "sgrdv-audit-bundle",
  "url": "http://sante.quebec/fhir/StructureDefinition/sgrdv-audit-bundle",
  "name": "SGRDVAuditBundle",
  "title": "Bundle d'audit SGRDV (4 entrées)",
  "status": "draft",
  "experimental": true,
  "description": "Bundle de type collection auto-portant représentant un audit affaire SGRDV. Contient exactement 4 entrées : (1) un AuditEvent, (2-3) deux Device acteurs (source + destination, profil SGRDVAuditAgent) et (4) le payload original de la transaction (Parameters, Bundle ou OperationOutcome — type libre). Le discussion-id est porté par Bundle.identifier (type #DiscussionId, 1..1) pour regrouper les Bundles d'un même fil. Le correlation-id et le discussion-id sont portés par les extensions sgrdv-audit-correlation-id et sgrdv-audit-discussion-id sur chaque AuditEvent du Bundle. Ingestion AHDS via POST /Bundle uniquement.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle.id",
        "path": "Bundle.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.identifier",
        "path": "Bundle.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.identifier.type",
        "path": "Bundle.identifier.type",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.identifier.type.coding",
        "path": "Bundle.identifier.type.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Bundle.identifier.type.coding.system",
        "path": "Bundle.identifier.type.coding.system",
        "patternUri": "http://sante.quebec/fhir/CodeSystem/sgrdv-identifier-type"
      },
      {
        "id": "Bundle.identifier.type.coding.code",
        "path": "Bundle.identifier.type.coding.code",
        "patternCode": "DiscussionId"
      },
      {
        "id": "Bundle.identifier.value",
        "path": "Bundle.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "fixedCode": "collection"
      },
      {
        "id": "Bundle.timestamp",
        "path": "Bundle.timestamp",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "resource"
            }
          ],
          "rules": "open"
        },
        "min": 4,
        "max": "4",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:auditEvent",
        "path": "Bundle.entry",
        "sliceName": "auditEvent",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:auditEvent.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "AuditEvent",
            "profile": [
              "http://sante.quebec/fhir/StructureDefinition/sgrdv-audit-event"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:device",
        "path": "Bundle.entry",
        "sliceName": "device",
        "min": 2,
        "max": "2",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:device.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Device",
            "profile": [
              "http://sante.quebec/fhir/StructureDefinition/sgrdv-audit-agent"
            ]
          }
        ]
      }
    ]
  }
}