{
  "resourceType": "StructureDefinition",
  "id": "AppointmentResponse",
  "meta": {
    "lastUpdated": "2021-01-01T21:58:31.578+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Workflow"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 3
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "pa"
    },
    {
      "url": "http://hl7.org/fhir/build/StructureDefinition/entered-in-error-status",
      "valueCode": ".participantStatus=entered-in-error"
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/AppointmentResponse",
  "version": "4.6.0",
  "name": "AppointmentResponse",
  "status": "draft",
  "date": "2021-01-01T21:58:31+00:00",
  "publisher": "Health Level Seven International (Patient Administration)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/pafm/index.cfm"
        }
      ]
    }
  ],
  "description": "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.",
  "fhirVersion": "4.6.0",
  "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": "AppointmentResponse",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DomainResource",
  "derivation": "specialization",
  "differential": {
    "element": [
      {
        "id": "AppointmentResponse",
        "path": "AppointmentResponse",
        "short": "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection",
        "definition": "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.",
        "min": 0,
        "max": "*",
        "constraint": [
          {
            "key": "apr-1",
            "severity": "error",
            "human": "Either the participantType or actor must be specified",
            "expression": "participantType.exists() or actor.exists()",
            "xpath": "(exists(f:participantType) or exists(f:actor))",
            "source": "http://hl7.org/fhir/StructureDefinition/AppointmentResponse"
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request"
          },
          {
            "identity": "rim",
            "map": "Act[@moodCode &lt;= 'PRMS']"
          },
          {
            "identity": "ical",
            "map": "VEVENT"
          },
          {
            "identity": "w5",
            "map": "workflow.scheduling"
          }
        ]
      },
      {
        "id": "AppointmentResponse.identifier",
        "path": "AppointmentResponse.identifier",
        "short": "External Ids for this item",
        "definition": "This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.identifier"
          },
          {
            "identity": "w5",
            "map": "FiveWs.identifier"
          },
          {
            "identity": "rim",
            "map": ".id"
          },
          {
            "identity": "ical",
            "map": "UID"
          }
        ]
      },
      {
        "id": "AppointmentResponse.appointment",
        "path": "AppointmentResponse.appointment",
        "short": "Appointment this response relates to",
        "definition": "Appointment that this response is replying to.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Appointment"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.basedOn"
          },
          {
            "identity": "rim",
            "map": "scheduleRequest.ActAppointmentRequest[@moodCode &lt;= 'ARQ']"
          }
        ]
      },
      {
        "id": "AppointmentResponse.start",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/committee-notes",
            "valueString": "Should we include the existing times, or rely on resource histories. Decision to wait for implementer feedback to see if these are used."
          }
        ],
        "path": "AppointmentResponse.start",
        "short": "Time from appointment, or requested new start time",
        "definition": "Date/Time that the appointment is to take place, or requested new start time.",
        "comment": "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "instant"
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.occurrence[x]"
          },
          {
            "identity": "w5",
            "map": "FiveWs.init"
          },
          {
            "identity": "rim",
            "map": ".effectiveTime.low"
          }
        ]
      },
      {
        "id": "AppointmentResponse.end",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/committee-notes",
            "valueString": "Should we include the existing times, or rely on resource histories. Decision to wait for implementer feedback to see if these are used."
          }
        ],
        "path": "AppointmentResponse.end",
        "short": "Time from appointment, or requested new end time",
        "definition": "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "instant"
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.occurrence[x]"
          },
          {
            "identity": "w5",
            "map": "FiveWs.done[x]"
          },
          {
            "identity": "rim",
            "map": ".effectiveTime.high"
          }
        ]
      },
      {
        "id": "AppointmentResponse.participantType",
        "path": "AppointmentResponse.participantType",
        "short": "Role of participant in the appointment",
        "definition": "Role of participant in the appointment.",
        "comment": "The role of the participant can be used to declare what the actor will be doing in the scope of the referenced appointment.\r\rIf the actor is not specified, then it is expected that the actor will be filled in at a later stage of planning.\r\rThis value SHALL be the same as specified on the referenced Appointment so that they can be matched, and subsequently updated.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ParticipantType"
            }
          ],
          "strength": "extensible",
          "description": "Role of participant in encounter.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-participant-type"
        },
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.performerType"
          },
          {
            "identity": "rim",
            "map": "(performer | reusableDevice | subject | location).@typeCode"
          },
          {
            "identity": "ical",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AppointmentResponse.actor",
        "path": "AppointmentResponse.actor",
        "short": "Person(s), Location, HealthcareService, or Device",
        "definition": "A Person, Location, HealthcareService, or Device that is participating in the appointment.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/HealthcareService",
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.performer"
          },
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "v2",
            "map": "PID-3-Patient ID List"
          },
          {
            "identity": "rim",
            "map": "performer.person | reusableDevice.manufacturedDevice | subject.patient | location.serviceDeliveryLocation"
          },
          {
            "identity": "ical",
            "map": "ATTENDEE: (Need to provide the common name CN and also the MAILTO properties from the practitioner resource)"
          }
        ]
      },
      {
        "id": "AppointmentResponse.participantStatus",
        "path": "AppointmentResponse.participantStatus",
        "short": "accepted | declined | tentative | needs-action",
        "definition": "Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.",
        "comment": "This element is labeled as a modifier because the status contains the code entered-in-error that marks the participant as not currently valid.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Not known why this is labelled a modifier",
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ParticipantStatus"
            }
          ],
          "strength": "required",
          "description": "The Participation status of an appointment.",
          "valueSet": "http://hl7.org/fhir/ValueSet/participationstatus"
        },
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.status"
          },
          {
            "identity": "rim",
            "map": "(performer | reusableDevice | subject | location).statusCode"
          },
          {
            "identity": "ical",
            "map": "ATTENDEE;CN=\"Brian Postlethwaite\";RSVP=TRUE:mailto:BPostlethwaite@data.com (rsvpparam | partstatparam)"
          }
        ]
      },
      {
        "id": "AppointmentResponse.comment",
        "path": "AppointmentResponse.comment",
        "short": "Additional comments",
        "definition": "Additional comments about the appointment.",
        "comment": "This comment is particularly important when the responder is declining, tentatively accepting or requesting another time to indicate the reasons why.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Request.note"
          },
          {
            "identity": "rim",
            "map": ".subjectOf.observation[@moodCode = 'EVN'][code = 'annotation'].value"
          },
          {
            "identity": "ical",
            "map": "COMMENT"
          }
        ]
      }
    ]
  }
}