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