{
  "resourceType": "StructureDefinition",
  "id": "CA-eReC-Appointment",
  "url": "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Appointment",
  "name": "Appointment",
  "status": "draft",
  "description": "The resource involves booking one (or a series) of appointment(s) between the patient and the practitioner(s) for a specific date/time. The encounter may be a scheduled referral or an econsult.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.meta",
        "path": "Appointment.meta",
        "mustSupport": true
      },
      {
        "id": "Appointment.meta.profile",
        "path": "Appointment.meta.profile",
        "mustSupport": true,
        "comment": "Implementers should be aware that some Canadian jurisdictions require vendors to use meta.profile to declare which FHIR profile(s) and version(s) the resource conforms to."
      },
      {
        "id": "Appointment.text",
        "path": "Appointment.text",
        "mustSupport": true
      },
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Appointment.extension:AppointmentClass",
        "path": "Appointment.extension",
        "sliceName": "AppointmentClass",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-Appointment.class"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:AppointmentClass.extension",
        "path": "Appointment.extension.extension",
        "max": "0"
      },
      {
        "id": "Appointment.extension:AppointmentClass.value[x]",
        "path": "Appointment.extension.value[x]",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://terminology.hl7.org/ValueSet/encounter-class"
        }
      },
      {
        "id": "Appointment.extension:VirtualService",
        "path": "Appointment.extension",
        "sliceName": "VirtualService",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-Appointment.virtualService"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "mustSupport": true
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "mustSupport": true
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "mustSupport": true
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "comment": "𝗦𝗨𝗣𝗣𝗢𝗥𝗧: One of end or minutesDuration must be supported."
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "comment": "𝗦𝗨𝗣𝗣𝗢𝗥𝗧: One of end or minutesDuration must be supported."
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "mustSupport": true
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "mustSupport": true
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "comment": "If systems are capturing instructions to a patient independently from other comments, they SHOULD use the patientInstruction field."
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.reference",
        "path": "Appointment.basedOn.reference",
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier",
        "path": "Appointment.basedOn.identifier",
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier.use",
        "path": "Appointment.basedOn.identifier.use",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier.system",
        "path": "Appointment.basedOn.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier.value",
        "path": "Appointment.basedOn.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.type",
        "path": "Appointment.participant.type",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Location"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor.identifier.system",
        "path": "Appointment.participant.actor.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor.identifier.value",
        "path": "Appointment.participant.actor.identifier.value",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}