{
  "resourceType": "StructureDefinition",
  "id": "AppointmentMERT",
  "url": "https://intrahealth.com/fhir/mert/StructureDefinition/AppointmentMERT",
  "name": "AppointmentMERT",
  "title": "Appointment (MERT)",
  "status": "draft",
  "description": "This profile describes the Appointment for MERT.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "comment": "Appointment.status is required. MERT supports the base AppointmentStatus codes.",
        "mustSupport": true
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "comment": "If appointment is cancelled, include cancelationReason when available (base example binding).",
        "mustSupport": true
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "comment": "Style of appointment (base preferred binding).",
        "mustSupport": true
      },
      {
        "id": "Appointment.reasonCode",
        "path": "Appointment.reasonCode",
        "comment": "Transport-first: include source reason coding when available; otherwise CodeableConcept.text may be used.",
        "mustSupport": true
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "comment": "Appointment start time (instant). Required for MERT.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "comment": "Appointment end time (instant). Required for MERT.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "actor"
            }
          ],
          "rules": "open",
          "description": "Slice participants by actor type for MERT rules."
        },
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "comment": "MERT requires a Patient participant. Provider and Location participants are optional when available."
      },
      {
        "id": "Appointment.participant:patient",
        "path": "Appointment.participant",
        "sliceName": "patient",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://intrahealth.com/fhir/mert/StructureDefinition/PatientMERT"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:patient.status",
        "path": "Appointment.participant.status",
        "comment": "For MERT, the Patient participant status SHALL be 'accepted' (confirmed).",
        "patternCode": "accepted"
      },
      {
        "id": "Appointment.participant:provider",
        "path": "Appointment.participant",
        "sliceName": "provider",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:provider.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://intrahealth.com/fhir/mert/StructureDefinition/PractitionerMERT"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:provider.status",
        "path": "Appointment.participant.status",
        "comment": "For MERT, the Provider participant status SHALL be 'accepted'.",
        "patternCode": "accepted"
      },
      {
        "id": "Appointment.participant:location",
        "path": "Appointment.participant",
        "sliceName": "location",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:location.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:location.status",
        "path": "Appointment.participant.status",
        "comment": "For MERT, the Location participant status SHALL be 'accepted'.",
        "patternCode": "accepted"
      }
    ]
  }
}