{
  "resourceType": "StructureDefinition",
  "id": "digidot-Appointment-no",
  "url": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no",
  "version": "0.2.0-test",
  "name": "DigidotAppointmentNo",
  "title": "DigiDOT Appointment (NO)",
  "status": "draft",
  "date": "2026-09-16",
  "publisher": "Novari AS - DigiDOT",
  "description": "One dental appointment for exactly one patient. Stores scheduling status, planned time or requested window, participants and optional links to planned care and the care episodes intentionally addressed by the booking.",
  "purpose": "Use for proposed, booked, fulfilled, cancelled and missed appointments. It schedules care; it does not document that care occurred. One Appointment may lead to more than one actual Encounter; each Encounter references the appointment. Clinical narrative belongs in Dental Contact Note. This is a shared appointment record, not a replacement for the source scheduling engine.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.no/fhir/StructureDefinition/no-basis-Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment",
        "path": "Appointment",
        "constraint": [
          {
            "key": "appt-positive-time",
            "severity": "error",
            "human": "A scheduled appointment ends after it starts.",
            "expression": "start.empty() or end > start"
          }
        ]
      },
      {
        "id": "Appointment.implicitRules",
        "path": "Appointment.implicitRules",
        "max": "0"
      },
      {
        "id": "Appointment.contained",
        "path": "Appointment.contained",
        "max": "0"
      },
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "closed"
        }
      },
      {
        "id": "Appointment.extension:virtualService",
        "path": "Appointment.extension",
        "sliceName": "virtualService",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-virtual-service"
            ]
          }
        ]
      },
      {
        "id": "Appointment.extension:group",
        "path": "Appointment.extension",
        "sliceName": "group",
        "max": "0"
      },
      {
        "id": "Appointment.extension:partOf",
        "path": "Appointment.extension",
        "sliceName": "partOf",
        "max": "0"
      },
      {
        "id": "Appointment.modifierExtension",
        "path": "Appointment.modifierExtension",
        "max": "0"
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "short": "Stable source business identifiers",
        "min": 1,
        "max": "*"
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "min": 1
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "min": 1
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "mustSupport": true,
        "definition": "Scheduling lifecycle using the native R4 codes. Map source states through an agreed supplier mapping. A source value such as Active must not be assumed to mean booked or fulfilled. Historical scheduled dates do not prove attendance or care delivery."
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "max": "0"
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "max": "0"
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "max": "1",
        "min": 0,
        "mustSupport": true,
        "short": "Administrative appointment type",
        "definition": "Administrative style of booking using the inherited no-basis type slices where applicable. Preserve a source appointment type through a documented terminology mapping. Clinical service codes belong on the planned ServiceRequest; do not duplicate the same source field in appointmentType and serviceType without distinct meanings."
      },
      {
        "id": "Appointment.reasonCode",
        "path": "Appointment.reasonCode",
        "max": "0"
      },
      {
        "id": "Appointment.reasonReference",
        "path": "Appointment.reasonReference",
        "max": "0"
      },
      {
        "id": "Appointment.priority",
        "path": "Appointment.priority",
        "constraint": [
          {
            "key": "appt-priority-range",
            "severity": "error",
            "human": "Scheduling priority must be between 0 (undefined) and 9.",
            "expression": "$this <= 9"
          }
        ]
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "short": "Brief booking label",
        "definition": "Short human-readable purpose for the appointment list, for example examination or restoration visit. Do not store clinical findings, completed treatment or the journal narrative here."
      },
      {
        "id": "Appointment.supportingInformation",
        "path": "Appointment.supportingInformation",
        "short": "Care episodes intentionally addressed by this booking",
        "definition": "Optional literal references to defined care-responsibility episodes addressed by this booking. Use them when such responsibility is represented; reuse the appropriate shared identity. A booking does not require an artificial episode, and links to ServiceRequest remain independently useful. Do not attach all open episodes by default.",
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-EpisodeOfCare-no"
            ]
          }
        ],
        "mustSupport": true,
        "min": 0
      },
      {
        "id": "Appointment.supportingInformation.reference",
        "path": "Appointment.supportingInformation.reference",
        "min": 1
      },
      {
        "id": "Appointment.supportingInformation.identifier",
        "path": "Appointment.supportingInformation.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "short": "Requested care duration when known",
        "definition": "May express requested duration before a time is booked, or care time excluding planned breaks. It need not equal end minus start."
      },
      {
        "id": "Appointment.slot",
        "path": "Appointment.slot",
        "max": "0"
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "max": "1",
        "min": 0,
        "mustSupport": true,
        "short": "Practical internal booking comments",
        "definition": "Practical internal scheduling information that cannot be represented in another scheduling element. Do not use this field for clinical findings, treatment results or the clinical journal note. Patient-facing attendance information belongs in patientInstruction."
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "short": "Practical instructions for attending the appointment"
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-ServiceRequest-no"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.reference",
        "path": "Appointment.basedOn.reference",
        "min": 1
      },
      {
        "id": "Appointment.basedOn.identifier",
        "path": "Appointment.basedOn.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "actor.type"
            }
          ],
          "rules": "closed"
        }
      },
      {
        "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",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "definition": "Use a literal reference to a no-basis Practitioner resource when the actor is an individual practitioner. Identifier-only HPR/FNR references are not permitted. Official practitioner identifiers belong on the referenced Practitioner resource. Other explicitly allowed resource target types retain their own clinical responsibility.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Location",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson"
            ]
          }
        ],
        "constraint": [
          {
            "key": "digidot-appointment-actor-identifier",
            "severity": "error",
            "human": "Use a literal resource reference; identifier-only practitioner references are not permitted.",
            "expression": "reference.exists() and identifier.empty()"
          }
        ]
      },
      {
        "id": "Appointment.participant.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.participant.actor.type",
        "path": "Appointment.participant.actor.type",
        "min": 1,
        "constraint": [
          {
            "key": "digidot-appointment-actor-type",
            "severity": "error",
            "human": "Declare the resource type of the actor.",
            "expression": "$this = 'Patient' or $this = 'Practitioner' or $this = 'PractitionerRole' or $this = 'Location' or $this = 'RelatedPerson'"
          }
        ]
      },
      {
        "id": "Appointment.participant.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Appointment.participant.status",
        "path": "Appointment.participant.status",
        "mustSupport": true,
        "definition": "The participant's recorded acceptance state. An actor being listed is not evidence of acceptance. Document the source event or agreed booking workflow supporting the value; needs-action means a response is needed, not an arbitrary unknown fallback."
      },
      {
        "id": "Appointment.participant:patient",
        "path": "Appointment.participant",
        "sliceName": "patient",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.participant:patient.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:patient.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1
      },
      {
        "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",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitioner",
        "path": "Appointment.participant",
        "sliceName": "practitioner",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Appointment.participant:practitioner.actor",
        "path": "Appointment.participant.actor",
        "definition": "Use a literal reference to a no-basis Practitioner resource when the actor is an individual practitioner. Identifier-only HPR/FNR references are not permitted. Official practitioner identifiers belong on the referenced Practitioner resource. Other explicitly allowed resource target types retain their own clinical responsibility.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:practitioner.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1,
        "max": "1"
      },
      {
        "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",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Appointment.participant:role",
        "path": "Appointment.participant",
        "sliceName": "role",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Appointment.participant:role.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:role.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1
      },
      {
        "id": "Appointment.participant:role.actor.type",
        "path": "Appointment.participant.actor.type",
        "min": 1,
        "fixedUri": "PractitionerRole"
      },
      {
        "id": "Appointment.participant:role.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.participant:location",
        "path": "Appointment.participant",
        "sliceName": "location",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Appointment.participant:location.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Location"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:location.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1
      },
      {
        "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",
        "max": "0"
      },
      {
        "id": "Appointment.participant:relatedPerson",
        "path": "Appointment.participant",
        "sliceName": "relatedPerson",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Appointment.participant:relatedPerson.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "Appointment.participant:relatedPerson.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1
      },
      {
        "id": "Appointment.participant:relatedPerson.actor.type",
        "path": "Appointment.participant.actor.type",
        "min": 1,
        "fixedUri": "RelatedPerson"
      },
      {
        "id": "Appointment.participant:relatedPerson.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "max": "0"
      }
    ]
  }
}