{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Appointment",
  "name": "DataStandardsWalesAppointmentProfile",
  "status": "draft",
  "date": "2023-03-28T11:46:07.9909458+00:00",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "APPT.1",
      "name": "PMS Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment",
        "path": "Appointment",
        "mapping": [
          {
            "identity": "PMS.1",
            "map": "APPOINTMENT"
          }
        ]
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "min": 1,
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "https://wales.nhs.uk/appointment/id/pms"
          }
        ]
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "min": 1,
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "BOOKED_SLOTS->APSL_ID"
          }
        ]
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "definition": "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.\r\n\r\nWill default to booked",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "ACTION_REQUESTS->STATUS"
          }
        ]
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "mapping": [
          {
            "identity": "PMS.1",
            "map": "TEST",
            "comment": "comment"
          }
        ]
      },
      {
        "id": "Appointment.cancelationReason.coding.system",
        "path": "Appointment.cancelationReason.coding.system",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason"
          }
        ]
      },
      {
        "id": "Appointment.cancelationReason.coding.code",
        "path": "Appointment.cancelationReason.coding.code",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "ACTION_REQUEST->CANCN_RSN"
          }
        ]
      },
      {
        "id": "Appointment.specialty.coding.code",
        "path": "Appointment.specialty.coding.code",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "REFERRALS->SPEC_CODE"
          }
        ]
      },
      {
        "id": "Appointment.appointmentType.coding.system",
        "path": "Appointment.appointmentType.coding.system",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AppointmentReasonCode"
          }
        ]
      },
      {
        "id": "Appointment.appointmentType.coding.code",
        "path": "Appointment.appointmentType.coding.code",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "BOOKED_SLOT->APPT_TYPE"
          }
        ]
      },
      {
        "id": "Appointment.priority",
        "path": "Appointment.priority",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "BOOKED_SLOT.URGENCY"
          }
        ]
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "REFERRALS->SPEC_CODE | LOCATION->NAME"
          }
        ]
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "short": "Appointment Start Date Time",
        "definition": "Date time of the current appointment booking (if there is a current appointment booking to a Directly Bookable Service)\r\n \"start\": \"2021-06-13T12:30:00+00:00\",",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "APPT_SLOTS->SESSION_DATE"
          }
        ]
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "short": "Appointment End Date Time",
        "definition": "Date/Time that the appointment is to conclude.\r\n\r\n\"end\": \"2021-06-13T12:45:00+00:00\",",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "APPT_SLOTS->SESSION_DATE"
          }
        ]
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "APPT_SLOTS-->DURN_MINS"
          }
        ]
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "BOOKED_SLOT->DATE_BOOKED | BOOKED_SLOT->TIME_BOOKED"
          }
        ]
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "mapping": [
          {
            "identity": "APPT.1",
            "map": "ACTION_REQUEST->REMARKS"
          }
        ]
      }
    ]
  }
}