<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="6920398f-7e22-4e37-9c30-ebc5a97d5caa" />
  <meta>
    <lastUpdated value="2020-11-20T08:02:50.321+00:00" />
  </meta>
  <url value="https://fhir.cambio.se/StructureDefinition/AppointmentCoreSe" />
  <name value="AppointmentCoreSe" />
  <status value="draft" />
  <date value="2020-11-16T08:25:23.4374471+00:00" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="ical" />
    <uri value="http://ietf.org/rfc/2445" />
    <name value="iCalendar" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Appointment" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Appointment" />
  <derivation value="constraint" />
  <snapshot />
  <differential>
    <element id="Appointment.extension">
      <path value="Appointment.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.extension:serviceProvider">
      <path value="Appointment.extension" />
      <sliceName value="serviceProvider" />
      <type>
        <code value="Extension" />
        <profile value="https://cambio.se/fhir/StructureDefinition/common-serviceProvider" />
      </type>
    </element>
    <element id="Appointment.extension:permittedPatientActions">
      <path value="Appointment.extension" />
      <sliceName value="permittedPatientActions" />
      <type>
        <code value="Extension" />
        <profile value="http://cambio.se/fhir/StructureDefinition/common-permittedPatientActions/v1" />
      </type>
    </element>
    <element id="Appointment.identifier.type">
      <path value="Appointment.identifier.type" />
      <max value="0" />
    </element>
    <element id="Appointment.identifier.system">
      <path value="Appointment.identifier.system" />
      <min value="1" />
    </element>
    <element id="Appointment.identifier.value">
      <path value="Appointment.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.identifier.period">
      <path value="Appointment.identifier.period" />
      <max value="0" />
    </element>
    <element id="Appointment.identifier.assigner">
      <path value="Appointment.identifier.assigner" />
      <comment value="Removed as this is not supported by Cambio applications" />
      <max value="0" />
    </element>
    <element id="Appointment.status">
      <path value="Appointment.status" />
      <definition value="The overall status of the Appointment" />
      <comment value="If the Appointment's status is &quot;cancelled&quot; then all participants are expected to have their calendars released for the appointment period, and as such any Slots that were marked as BUSY can be re-set to FREE.&#xA;&#xA;This element is labeled as a modifier because the status contains the code entered-in-error that mark the Appointment as not currently valid.&#xD;&#xA;&#xD;&#xA;Supported statuses:&#xD;&#xA;waitlist, booked, arrived, fulfilled, cancelled, noshow, entered-in-error" />
    </element>
    <element id="Appointment.serviceCategory">
      <path value="Appointment.serviceCategory" />
      <comment value="This is removed as in COSMIC this is represented by a HealthcareService. See extension HealthcareServiceReference." />
      <max value="0" />
    </element>
    <element id="Appointment.serviceType">
      <path value="Appointment.serviceType" />
      <comment value="Cambio products do not support a specific coded service. This would be represented as dedicated activity resources or similar instead of just plain codes on the Appointment." />
      <max value="0" />
    </element>
    <element id="Appointment.appointmentType">
      <path value="Appointment.appointmentType" />
      <comment value="COSMIC supports the following:&#xD;&#xA;EMERGENCY, FOLLOWUP, ROUTINE, WALKIN&#xD;&#xA;&#xD;&#xA;ROUTINE is used as &quot;New&quot; as opposed to &quot;Follow-Up&quot;" />
    </element>
    <element id="Appointment.priority">
      <path value="Appointment.priority" />
      <comment value="Not supported" />
      <max value="0" />
    </element>
    <element id="Appointment.description">
      <path value="Appointment.description" />
      <comment value="." />
    </element>
    <element id="Appointment.start">
      <path value="Appointment.start" />
      <comment value="Start time of the appointment. This does not have to be the same as the Slot start time." />
    </element>
    <element id="Appointment.end">
      <path value="Appointment.end" />
      <comment value="End time of the appointment" />
    </element>
    <element id="Appointment.slot.type">
      <path value="Appointment.slot.type" />
      <fixedUri value="Slot" />
    </element>
    <element id="Appointment.slot.identifier.use">
      <path value="Appointment.slot.identifier.use" />
      <max value="0" />
    </element>
    <element id="Appointment.slot.identifier.type">
      <path value="Appointment.slot.identifier.type" />
      <max value="0" />
    </element>
    <element id="Appointment.slot.identifier.period">
      <path value="Appointment.slot.identifier.period" />
      <max value="0" />
    </element>
    <element id="Appointment.slot.identifier.assigner">
      <path value="Appointment.slot.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Appointment.patientInstruction">
      <path value="Appointment.patientInstruction" />
      <comment value="." />
    </element>
    <element id="Appointment.participant">
      <path value="Appointment.participant" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="actor.type" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.participant:patient">
      <path value="Appointment.participant" />
      <sliceName value="patient" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:patient.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="Appointment.participant:patient.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
      <fixedUri value="Patient" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier">
      <path value="Appointment.participant.actor.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.participant:patient.actor.identifier.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:personnummer">
      <path value="Appointment.participant.actor.identifier" />
      <sliceName value="personnummer" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:personnummer.use">
      <path value="Appointment.participant.actor.identifier.use" />
      <fixedCode value="official" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:personnummer.system">
      <path value="Appointment.participant.actor.identifier.system" />
      <definition value="Skatteverket Person-id för någon som är folkbokförd i Sverige enligt SKV704." />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.3.1" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:personnummer.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:samordningsnummer">
      <path value="Appointment.participant.actor.identifier" />
      <sliceName value="samordningsnummer" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:samordningsnummer.system">
      <path value="Appointment.participant.actor.identifier.system" />
      <short value="OID for Coordination number" />
      <definition value="If the patient has a Coordination number (Sammordningsnummer ) instead of social security number (personnummer) should it be use" />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.3.3" />
    </element>
    <element id="Appointment.participant:patient.actor.identifier:samordningsnummer.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:location">
      <path value="Appointment.participant" />
      <sliceName value="location" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:location.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
    </element>
    <element id="Appointment.participant:location.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
      <fixedUri value="Location" />
    </element>
    <element id="Appointment.participant:location.actor.identifier">
      <path value="Appointment.participant.actor.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId">
      <path value="Appointment.participant.actor.identifier" />
      <sliceName value="HSAId" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.use">
      <path value="Appointment.participant.actor.identifier.use" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.type">
      <path value="Appointment.participant.actor.identifier.type" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.system">
      <path value="Appointment.participant.actor.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.4.1" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.period">
      <path value="Appointment.participant.actor.identifier.period" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:location.actor.identifier:HSAId.assigner">
      <path value="Appointment.participant.actor.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:practitioner">
      <path value="Appointment.participant" />
      <sliceName value="practitioner" />
    </element>
    <element id="Appointment.participant:practitioner.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
    </element>
    <element id="Appointment.participant:practitioner.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
      <fixedUri value="Practitioner" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier">
      <path value="Appointment.participant.actor.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId">
      <path value="Appointment.participant.actor.identifier" />
      <sliceName value="HSAId" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.use">
      <path value="Appointment.participant.actor.identifier.use" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.type">
      <path value="Appointment.participant.actor.identifier.type" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.system">
      <path value="Appointment.participant.actor.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.4.1" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.period">
      <path value="Appointment.participant.actor.identifier.period" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:practitioner.actor.identifier:HSAId.assigner">
      <path value="Appointment.participant.actor.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device">
      <path value="Appointment.participant" />
      <sliceName value="device" />
    </element>
    <element id="Appointment.participant:device.type">
      <path value="Appointment.participant.type" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
    </element>
    <element id="Appointment.participant:device.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
      <fixedUri value="Device" />
    </element>
    <element id="Appointment.participant:device.actor.identifier.use">
      <path value="Appointment.participant.actor.identifier.use" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device.actor.identifier.type">
      <path value="Appointment.participant.actor.identifier.type" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device.actor.identifier.system">
      <path value="Appointment.participant.actor.identifier.system" />
      <comment value="This could e.g. be a serial number system for the device" />
      <requirements value="." />
    </element>
    <element id="Appointment.participant:device.actor.identifier.value">
      <path value="Appointment.participant.actor.identifier.value" />
      <comment value="Could be unique serial number for the device" />
    </element>
    <element id="Appointment.participant:device.actor.identifier.period">
      <path value="Appointment.participant.actor.identifier.period" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device.actor.identifier.assigner">
      <path value="Appointment.participant.actor.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:device.period">
      <path value="Appointment.participant.period" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:healthcareService">
      <path value="Appointment.participant" />
      <sliceName value="healthcareService" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:healthcareService.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/HealthcareService" />
      </type>
    </element>
    <element id="Appointment.participant:healthcareService.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:healthcareService.status">
      <path value="Appointment.participant.status" />
      <fixedCode value="accepted" />
    </element>
    <element id="Appointment.participant:practitionerRole">
      <path value="Appointment.participant" />
      <sliceName value="practitionerRole" />
    </element>
    <element id="Appointment.participant:practitionerRole.actor">
      <path value="Appointment.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
    </element>
    <element id="Appointment.participant:practitionerRole.actor.type">
      <path value="Appointment.participant.actor.type" />
      <min value="1" />
      <fixedUri value="PractitionerRole" />
    </element>
    <element id="Appointment.requestedPeriod">
      <path value="Appointment.requestedPeriod" />
      <definition value="Suggested or targeted date range for when the appointment should occur" />
      <comment value="This maps to COSMIC's notification date" />
      <max value="1" />
    </element>
  </differential>
</StructureDefinition>