{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.synapxe.sg/StructureDefinition/profile-appointment",
  "name": "Appointment",
  "status": "active",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.contained",
        "path": "Appointment.contained",
        "short": "A grouping of people or organizations with a common purpose",
        "definition": "A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-organization",
              "https://fhir.synapxe.sg/StructureDefinition/profile-practitioner",
              "https://fhir.synapxe.sg/StructureDefinition/profile-location",
              "https://fhir.synapxe.sg/StructureDefinition/profile-servicerequest"
            ]
          }
        ],
        "constraint": [
          {
            "key": "dom-2",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources",
            "expression": "contained.contained.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-4",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",
            "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-3",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource",
            "expression": "contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-6",
            "severity": "warning",
            "human": "A resource should have narrative for robust management",
            "expression": "text.`div`.exists()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-5",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a security label",
            "expression": "contained.meta.security.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "org-1",
            "severity": "error",
            "human": "The organization SHALL at least have a name or an identifier, and possibly more than one",
            "expression": "(identifier.count() + name.count()) > 0",
            "source": "http://hl7.org/fhir/StructureDefinition/Organization"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity, Role, or Act"
          },
          {
            "identity": "w5",
            "map": "administrative.group"
          },
          {
            "identity": "v2",
            "map": "(also see master files messages)"
          },
          {
            "identity": "rim",
            "map": "Organization(classCode=ORG, determinerCode=INST)"
          },
          {
            "identity": "interface",
            "map": "ParticipantContactable"
          },
          {
            "identity": "servd",
            "map": "Organization"
          }
        ]
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Appointment.identifier.id",
        "path": "Appointment.identifier.id",
        "max": "0"
      },
      {
        "id": "Appointment.identifier.extension",
        "path": "Appointment.identifier.extension",
        "max": "0"
      },
      {
        "id": "Appointment.identifier.use",
        "path": "Appointment.identifier.use",
        "max": "0"
      },
      {
        "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",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier",
        "path": "Appointment.identifier",
        "sliceName": "recordIdentifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.id",
        "path": "Appointment.identifier.id",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.extension",
        "path": "Appointment.identifier.extension",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.use",
        "path": "Appointment.identifier.use",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.type",
        "path": "Appointment.identifier.type",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.system",
        "path": "Appointment.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.synapxe.sg/NamingSystem/record-id"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.value",
        "path": "Appointment.identifier.value",
        "min": 1
      },
      {
        "id": "Appointment.identifier:recordIdentifier.period",
        "path": "Appointment.identifier.period",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:recordIdentifier.assigner",
        "path": "Appointment.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier",
        "path": "Appointment.identifier",
        "sliceName": "appointmentIdentifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.id",
        "path": "Appointment.identifier.id",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.extension",
        "path": "Appointment.identifier.extension",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.use",
        "path": "Appointment.identifier.use",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.type",
        "path": "Appointment.identifier.type",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.system",
        "path": "Appointment.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.synapxe.sg/NamingSystem/appointment-id"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.value",
        "path": "Appointment.identifier.value",
        "min": 1
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.period",
        "path": "Appointment.identifier.period",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:appointmentIdentifier.assigner",
        "path": "Appointment.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Appointment.identifier:groupNo",
        "path": "Appointment.identifier",
        "sliceName": "groupNo",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Appointment.identifier:groupNo.system",
        "path": "Appointment.identifier.system",
        "fixedUri": "https://fhir.synapxe.sg/NamingSystem/group-no"
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "example": [
          {
            "label": "Booked",
            "valueCode": "booked"
          }
        ]
      },
      {
        "id": "Appointment.cancellationReason",
        "path": "Appointment.cancellationReason",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/reasonforcancellation"
        }
      },
      {
        "id": "Appointment.cancellationReason.extension",
        "path": "Appointment.cancellationReason.extension",
        "max": "0"
      },
      {
        "id": "Appointment.cancellationReason.coding.system",
        "path": "Appointment.cancellationReason.coding.system",
        "fixedUri": "https://fhir.synapxe.sg/CodeSystem/reasonforcancellation"
      },
      {
        "id": "Appointment.cancellationReason.coding.code",
        "path": "Appointment.cancellationReason.coding.code",
        "example": [
          {
            "label": "Patient Initiated",
            "valueCode": "PATI"
          }
        ]
      },
      {
        "id": "Appointment.class",
        "path": "Appointment.class",
        "short": "inpatient | outpatient",
        "max": "0"
      },
      {
        "id": "Appointment.class.id",
        "path": "Appointment.class.id",
        "max": "0"
      },
      {
        "id": "Appointment.class.extension",
        "path": "Appointment.class.extension",
        "max": "0"
      },
      {
        "id": "Appointment.class.coding",
        "path": "Appointment.class.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.class.coding.id",
        "path": "Appointment.class.coding.id",
        "max": "0"
      },
      {
        "id": "Appointment.class.coding.extension",
        "path": "Appointment.class.coding.extension",
        "max": "0"
      },
      {
        "id": "Appointment.class.coding.system",
        "path": "Appointment.class.coding.system",
        "min": 1,
        "patternUri": "https://fhir.synapxe.sg/CodeSystem/patienttype"
      },
      {
        "id": "Appointment.class.coding.version",
        "path": "Appointment.class.coding.version",
        "max": "0"
      },
      {
        "id": "Appointment.class.coding.code",
        "path": "Appointment.class.coding.code",
        "min": 1
      },
      {
        "id": "Appointment.class.coding.display",
        "path": "Appointment.class.coding.display",
        "min": 1
      },
      {
        "id": "Appointment.class.coding.userSelected",
        "path": "Appointment.class.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Appointment.class.text",
        "path": "Appointment.class.text",
        "max": "0"
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "short": "Patient type code",
        "definition": "Patient type code: Inpatient or Outpatient",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/patient-type"
        }
      },
      {
        "id": "Appointment.serviceCategory.extension",
        "path": "Appointment.serviceCategory.extension",
        "max": "0"
      },
      {
        "id": "Appointment.serviceCategory.coding.system",
        "path": "Appointment.serviceCategory.coding.system",
        "fixedUri": "https://fhir.synapxe.sg/CodeSystem/patient-type"
      },
      {
        "id": "Appointment.serviceCategory.coding.code",
        "path": "Appointment.serviceCategory.coding.code",
        "example": [
          {
            "label": "Inpatient",
            "valueCode": "I"
          },
          {
            "label": "Outpatient",
            "valueCode": "O"
          }
        ]
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "short": "Appointment type code",
        "definition": "Appointment type code: Consultation, Nursing",
        "max": "1"
      },
      {
        "id": "Appointment.serviceType.id",
        "path": "Appointment.serviceType.id",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType.extension",
        "path": "Appointment.serviceType.extension",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType.concept",
        "path": "Appointment.serviceType.concept",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/appointment-type"
        }
      },
      {
        "id": "Appointment.serviceType.concept.extension",
        "path": "Appointment.serviceType.concept.extension",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType.concept.coding.system",
        "path": "Appointment.serviceType.concept.coding.system",
        "fixedUri": "https://fhir.synapxe.sg/CodeSystem/appointment-type"
      },
      {
        "id": "Appointment.serviceType.concept.coding.code",
        "path": "Appointment.serviceType.concept.coding.code",
        "example": [
          {
            "label": "Consultation, Nursing",
            "valueCode": "CON"
          }
        ]
      },
      {
        "id": "Appointment.serviceType.reference",
        "path": "Appointment.serviceType.reference",
        "max": "0"
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Appointment.specialty.extension",
        "path": "Appointment.specialty.extension",
        "max": "0"
      },
      {
        "id": "Appointment.specialty.coding.system",
        "path": "Appointment.specialty.coding.system",
        "fixedUri": "http://snomed.info/sct"
      },
      {
        "id": "Appointment.specialty.coding.code",
        "path": "Appointment.specialty.coding.code",
        "example": [
          {
            "label": "Pediatric Genetics",
            "valueCode": "PGN"
          }
        ]
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "short": "The movement type associated with the appointment can be represented as an admission or visit type",
        "definition": "The movement type associated with the appointment can be represented as an admission or visit type",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/movement-type"
        }
      },
      {
        "id": "Appointment.appointmentType.extension",
        "path": "Appointment.appointmentType.extension",
        "max": "0"
      },
      {
        "id": "Appointment.appointmentType.coding.system",
        "path": "Appointment.appointmentType.coding.system",
        "fixedUri": "https://fhir.synapxe.sg/CodeSystem/movement-type"
      },
      {
        "id": "Appointment.reason",
        "path": "Appointment.reason",
        "min": 1,
        "type": [
          {
            "code": "CodeableReference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-condition",
              "https://fhir.synapxe.sg/StructureDefinition/profile-procedure",
              "https://fhir.synapxe.sg/StructureDefinition/profile-encounter"
            ]
          }
        ]
      },
      {
        "id": "Appointment.reason.id",
        "path": "Appointment.reason.id",
        "max": "0"
      },
      {
        "id": "Appointment.reason.extension",
        "path": "Appointment.reason.extension",
        "max": "0"
      },
      {
        "id": "Appointment.reason.concept",
        "path": "Appointment.reason.concept",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/reason-for-appointment"
        }
      },
      {
        "id": "Appointment.reason.concept.extension",
        "path": "Appointment.reason.concept.extension",
        "max": "0"
      },
      {
        "id": "Appointment.reason.concept.coding.system",
        "path": "Appointment.reason.concept.coding.system",
        "fixedUri": "https://fhir.synapxe.sg/CodeSystem/reason-for-appointment"
      },
      {
        "id": "Appointment.reason.concept.coding.code",
        "path": "Appointment.reason.concept.coding.code",
        "example": [
          {
            "label": "A&E",
            "valueCode": "1"
          }
        ]
      },
      {
        "id": "Appointment.priority",
        "path": "Appointment.priority",
        "max": "0"
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "max": "0"
      },
      {
        "id": "Appointment.replaces",
        "path": "Appointment.replaces",
        "max": "0"
      },
      {
        "id": "Appointment.virtualService",
        "path": "Appointment.virtualService",
        "max": "0"
      },
      {
        "id": "Appointment.supportingInformation",
        "path": "Appointment.supportingInformation",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-location"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Appointment.supportingInformation.id",
        "path": "Appointment.supportingInformation.id",
        "max": "0"
      },
      {
        "id": "Appointment.supportingInformation.extension",
        "path": "Appointment.supportingInformation.extension",
        "max": "0"
      },
      {
        "id": "Appointment.previousAppointment",
        "path": "Appointment.previousAppointment",
        "max": "0"
      },
      {
        "id": "Appointment.originatingAppointment",
        "path": "Appointment.originatingAppointment",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-appointment"
            ]
          }
        ]
      },
      {
        "id": "Appointment.originatingAppointment.id",
        "path": "Appointment.originatingAppointment.id",
        "max": "0"
      },
      {
        "id": "Appointment.originatingAppointment.extension",
        "path": "Appointment.originatingAppointment.extension",
        "max": "0"
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "min": 1
      },
      {
        "id": "Appointment.requestedPeriod",
        "path": "Appointment.requestedPeriod",
        "max": "0"
      },
      {
        "id": "Appointment.slot",
        "path": "Appointment.slot",
        "max": "0"
      },
      {
        "id": "Appointment.account",
        "path": "Appointment.account",
        "max": "0"
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "max": "0"
      },
      {
        "id": "Appointment.cancellationDate",
        "path": "Appointment.cancellationDate",
        "max": "0"
      },
      {
        "id": "Appointment.note",
        "path": "Appointment.note",
        "max": "1"
      },
      {
        "id": "Appointment.note.id",
        "path": "Appointment.note.id",
        "max": "0"
      },
      {
        "id": "Appointment.note.extension",
        "path": "Appointment.note.extension",
        "max": "0"
      },
      {
        "id": "Appointment.note.author[x]",
        "path": "Appointment.note.author[x]",
        "max": "0"
      },
      {
        "id": "Appointment.note.time",
        "path": "Appointment.note.time",
        "max": "0"
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "short": "The referral information of this appointment",
        "definition": "The referral information of this appointment",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-servicerequest"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Appointment.basedOn.id",
        "path": "Appointment.basedOn.id",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn.extension",
        "path": "Appointment.basedOn.extension",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn.identifier",
        "path": "Appointment.basedOn.identifier",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Appointment.subject",
        "path": "Appointment.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-patient"
            ]
          }
        ]
      },
      {
        "id": "Appointment.subject.id",
        "path": "Appointment.subject.id",
        "max": "0"
      },
      {
        "id": "Appointment.subject.extension",
        "path": "Appointment.subject.extension",
        "max": "0"
      },
      {
        "id": "Appointment.subject.identifier",
        "path": "Appointment.subject.identifier",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant.id",
        "path": "Appointment.participant.id",
        "max": "0"
      },
      {
        "id": "Appointment.participant.extension",
        "path": "Appointment.participant.extension",
        "max": "0"
      },
      {
        "id": "Appointment.participant.modifierExtension",
        "path": "Appointment.participant.modifierExtension",
        "max": "0"
      },
      {
        "id": "Appointment.participant.type",
        "path": "Appointment.participant.type",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/appointment-participant-type"
        }
      },
      {
        "id": "Appointment.participant.type.extension",
        "path": "Appointment.participant.type.extension",
        "max": "0"
      },
      {
        "id": "Appointment.participant.type.coding.system",
        "path": "Appointment.participant.type.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
      },
      {
        "id": "Appointment.participant.type.coding.code",
        "path": "Appointment.participant.type.coding.code",
        "example": [
          {
            "label": "Attending clinician",
            "valueCode": "ATND"
          }
        ]
      },
      {
        "id": "Appointment.participant.period",
        "path": "Appointment.participant.period",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-practitioner",
              "https://fhir.synapxe.sg/StructureDefinition/profile-organization"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant.actor.id",
        "path": "Appointment.participant.actor.id",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.extension",
        "path": "Appointment.participant.actor.extension",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant.required",
        "path": "Appointment.participant.required",
        "max": "0"
      },
      {
        "id": "Appointment.recurrenceId",
        "path": "Appointment.recurrenceId",
        "max": "0"
      },
      {
        "id": "Appointment.occurrenceChanged",
        "path": "Appointment.occurrenceChanged",
        "max": "0"
      },
      {
        "id": "Appointment.recurrenceTemplate",
        "path": "Appointment.recurrenceTemplate",
        "max": "0"
      }
    ]
  }
}