{
  "resourceType": "StructureDefinition",
  "id": "profile-DwAppointment",
  "meta": {
    "lastUpdated": "2024-05-03T19:48:37.9773167+00:00"
  },
  "url": "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwAppointment",
  "version": "2.0.0",
  "name": "DwAppointment",
  "status": "active",
  "date": "2026-05-29",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.id",
        "path": "Appointment.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.meta.security",
        "path": "Appointment.meta.security",
        "comment": "Populated when the patient record is restricted."
      },
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Appointment.extension:appointmentEMRCustomStatus",
        "path": "Appointment.extension",
        "sliceName": "appointmentEMRCustomStatus",
        "comment": "Provides the EMR-specific appointment status value as a string.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-AppointmentEMRCustomStatus"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:virtualVisit",
        "path": "Appointment.extension",
        "sliceName": "virtualVisit",
        "comment": "Boolean indicating whether the appointment is a virtual visit.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-VirtualVisit"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:virtualVisitType",
        "path": "Appointment.extension",
        "sliceName": "virtualVisitType",
        "comment": "Provides the type of virtual appointment.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-VirtualVisitType"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "comment": "Pattern: urn:telus:emr:{emrtype}:{emrinstance}:appointment"
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "comment": "This element is labeled as a modifier because the status contains the code entered-in-error that marks the Appointment as not currently valid.",
        "mustSupport": true
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "comment": "Provide cancellation reason where available.",
        "mustSupport": true
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "mustSupport": true
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "mustSupport": true
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "comment": "Format: YYYY-MM-DDThh:mm:ss.sss+zz:zz. If FHIR status is not proposed or cancelled, start must be present; provide data-absent-reason of unknown if missing.",
        "mustSupport": true
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "comment": "Format: YYYY-MM-DDThh:mm:ss.sss+zz:zz. If FHIR status is not proposed or cancelled, end must be present; provide data-absent-reason of unknown if missing.",
        "mustSupport": true
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "mustSupport": true
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "comment": "Date and time the appointment booking was created.",
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "comment": "When the appointment is the result of an internal or external referral, provide the reference to the ServiceRequest.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwServiceRequest"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "comment": "This is 1 to many. Includes patient and provider participants. participant.status is hard-coded to 'accepted' as participation status is not tracked by the EMR.",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient",
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitioner",
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitionerRole",
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwHealthcareService",
              "https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwLocation"
            ]
          }
        ]
      }
    ]
  }
}