{
  "resourceType": "StructureDefinition",
  "id": "sgrdv-source-lock-notification-message-header",
  "url": "http://sante.quebec/fhir/StructureDefinition/sgrdv-source-lock-notification-message-header",
  "name": "SGRDVSourceLockNotificationMessageHeader",
  "title": "MessageHeader de notification de verrou — Surface Systèmes source",
  "status": "active",
  "experimental": true,
  "description": "MessageHeader des notifications d'événements de verrou émises par SGRDV vers un système source via $process-message. SGRDV agit comme autorité du verrou : les ajouts, prolongations et retraits sont propagés aux DMÉ par ce canal ; le DMÉ n'expose pas d'opération $lock transactionnelle. eventCoding identifie l'événement (lock-create, lock-extend, lock-release). source.endpoint identifie SGRDV de manière fixe. destination.endpoint identifie le DMÉ/SIP-C destinataire (URL technique, variable). focus pointe en logical reference vers l'Appointment (1..1) et le ou les Slots (1..*) concernés — les ressources cibles ne sont pas matérialisées dans le Bundle, le DMÉ est l'autorité d'origine de ces ressources. L'extension lock-end-time porte l'heure de fin du verrou. id sert de corrélation FHIR-natif (en complément de l'en-tête HTTP X-Correlation-Id). Le moment de l'événement est porté par Bundle.timestamp (FHIR R4 ne définit pas de MessageHeader.timestamp).",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MessageHeader",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MessageHeader",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MessageHeader.id",
        "path": "MessageHeader.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension",
        "path": "MessageHeader.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "MessageHeader.extension:lockEndTime",
        "path": "MessageHeader.extension",
        "sliceName": "lockEndTime",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://sante.quebec/fhir/StructureDefinition/sgrdv-lock-end-time"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:lockEndTime.value[x]",
        "path": "MessageHeader.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x]",
        "path": "MessageHeader.event[x]",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://sante.quebec/fhir/ValueSet/sgrdv-source-notification-events-vs"
        }
      },
      {
        "id": "MessageHeader.event[x].system",
        "path": "MessageHeader.event[x].system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x].code",
        "path": "MessageHeader.event[x].code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination",
        "path": "MessageHeader.destination",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.endpoint",
        "path": "MessageHeader.destination.endpoint",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver",
        "path": "MessageHeader.destination.receiver",
        "max": "0"
      },
      {
        "id": "MessageHeader.source",
        "path": "MessageHeader.source",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.name",
        "path": "MessageHeader.source.name",
        "min": 1,
        "fixedString": "SGRDV",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.endpoint",
        "path": "MessageHeader.source.endpoint",
        "fixedUrl": "http://sante.quebec/fhir/source/sgrdv",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus",
        "path": "MessageHeader.focus",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "closed"
        },
        "min": 2,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment",
        "path": "MessageHeader.focus",
        "sliceName": "appointment",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Appointment"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.reference",
        "path": "MessageHeader.focus.reference",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus:appointment.type",
        "path": "MessageHeader.focus.type",
        "min": 1,
        "fixedUri": "Appointment",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.identifier",
        "path": "MessageHeader.focus.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.type",
        "path": "MessageHeader.focus.identifier.type",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.type.coding",
        "path": "MessageHeader.focus.identifier.type.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.type.coding.system",
        "path": "MessageHeader.focus.identifier.type.coding.system",
        "fixedUri": "http://sante.quebec/fhir/CodeSystem/sgrdv-identifier-type"
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.type.coding.code",
        "path": "MessageHeader.focus.identifier.type.coding.code",
        "fixedCode": "IdDispoDME"
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.system",
        "path": "MessageHeader.focus.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:appointment.identifier.value",
        "path": "MessageHeader.focus.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot",
        "path": "MessageHeader.focus",
        "sliceName": "slot",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Slot"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.reference",
        "path": "MessageHeader.focus.reference",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus:slot.type",
        "path": "MessageHeader.focus.type",
        "min": 1,
        "fixedUri": "Slot",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.identifier",
        "path": "MessageHeader.focus.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.identifier.type",
        "path": "MessageHeader.focus.identifier.type",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.identifier.type.coding",
        "path": "MessageHeader.focus.identifier.type.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.identifier.type.coding.system",
        "path": "MessageHeader.focus.identifier.type.coding.system",
        "fixedUri": "http://sante.quebec/fhir/CodeSystem/sgrdv-identifier-type"
      },
      {
        "id": "MessageHeader.focus:slot.identifier.type.coding.code",
        "path": "MessageHeader.focus.identifier.type.coding.code",
        "fixedCode": "IdSlotDME"
      },
      {
        "id": "MessageHeader.focus:slot.identifier.system",
        "path": "MessageHeader.focus.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus:slot.identifier.value",
        "path": "MessageHeader.focus.identifier.value",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}