{
  "resourceType": "StructureDefinition",
  "id": "digidot-Appointment-no",
  "url": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no",
  "version": "0.7.0",
  "name": "DigidotAppointmentNo",
  "title": "DigiDOT Appointment (NO)",
  "status": "draft",
  "date": "2026-11-02",
  "publisher": "Novari AS - DigiDOT",
  "description": "Readiness: [In review](https://simplifier.net/guide/Visual-overview/Home/Review-status-and-releases.page.md?version=current#readiness-appointment).\n\nProfile base: no-basis-Appointment (hl7.fhir.no.basis 2.2.2) (http://hl7.no/fhir/StructureDefinition/no-basis-Appointment).\n\nOne dental appointment for exactly one patient. Uses the fixed Dental service category, optional dental specialty and clinical reason, 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"
          },
          {
            "key": "appt-one-patient",
            "severity": "error",
            "human": "Exactly one participant must be identifiable as the Patient.",
            "expression": "participant.where(actor.type = 'Patient' or actor.type = 'http://hl7.org/fhir/StructureDefinition/Patient' or actor.reference.matches('(^|/)Patient/[^/]+(/_history/[^/]+)?$') or actor.resolve().ofType(Patient).exists()).count() = 1"
          }
        ]
      },
      {
        "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 when available",
        "min": 0,
        "max": "*",
        "mustSupport": true,
        "definition": "Stable business identifiers for this record. If the source EHR or external system has a stable business identifier, it SHALL be included and preserved with its assigning system and value. The element is optional when no such identifier is available. Each supplied identifier SHALL contain system and value. Do not copy the local FHIR resource id merely to populate this element.",
        "comment": "MustSupport requires producers to support conveying available source identifiers and receivers to support preserving them; it does not require inventing an identifier when none is available. Any additional identifier-assignment and matching requirements belong in the exchange contract. An integration-assigned identifier requires governed assignment and a persistent mapping across retries; never generate a fresh identifier on each submission. Different records retain their own identities, even when they share the same patient or care episode. Resource references and FHIR server id rules are unchanged."
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "min": 1,
        "max": "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",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "short": "Dental service category",
        "definition": "All appointments in this dental profile use service category 10 |Dental| from the FHIR R4 ServiceCategory code system. The coding is fixed; a human-readable display or text may be supplied."
      },
      {
        "id": "Appointment.serviceCategory.coding",
        "path": "Appointment.serviceCategory.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.serviceCategory.coding.system",
        "path": "Appointment.serviceCategory.coding.system",
        "min": 1,
        "max": "1",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/service-category"
      },
      {
        "id": "Appointment.serviceCategory.coding.code",
        "path": "Appointment.serviceCategory.coding.code",
        "min": 1,
        "max": "1",
        "fixedCode": "10"
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "max": "0"
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "min": 0,
        "max": "1",
        "short": "Dental specialty required for this booking, when relevant",
        "definition": "Use only when the appointment requires a particular dental specialty. Choose from the dental subset of the FHIR R4 practice-setting codes; do not populate a specialty merely because the appointment is dental.",
        "binding": {
          "strength": "required",
          "valueSet": "https://novari.no/fhir/digidot/ValueSet/digidot-appointment-dental-specialties"
        }
      },
      {
        "id": "Appointment.specialty.coding",
        "path": "Appointment.specialty.coding",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-Coding-SCTpre-no"
            ]
          }
        ],
        "short": "One precoordinated SNOMED CT dental specialty",
        "definition": "One Coding conforming to the DigiDOT SCTpre profile, including the SNOMED CT edition release URI. Choose a concept from the bound dental specialty ValueSet."
      },
      {
        "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",
        "short": "Precoordinated clinical reason for this appointment",
        "definition": "Optional coded reason for booking the appointment. Use one precoordinated SNOMED CT Clinical finding or Finding with explicit context concept per reason; its context must accurately describe the indication. Use reasonReference when the relevant Condition or Observation is separately stored. A routine recall booking need not invent a clinical reason; basedOn can identify the planned ServiceRequest.",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://novari.no/fhir/digidot/ValueSet/digidot-service-request-reasons"
        }
      },
      {
        "id": "Appointment.reasonCode.coding",
        "path": "Appointment.reasonCode.coding",
        "short": "One precoordinated SNOMED CT reason code",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding",
            "profile": [
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-Coding-SCTpre-no"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.reasonReference",
        "path": "Appointment.reasonReference",
        "short": "Existing clinical finding or observation behind the booking",
        "definition": "Reference an existing DigiDOT Condition or Observation that explains why the appointment is scheduled. Use a literal reference to the stored record. This is independent of basedOn, which links the appointment to a planned ServiceRequest.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-Condition-no",
              "https://novari.no/fhir/digidot/StructureDefinition/digidot-Observation-no"
            ]
          }
        ],
        "mustSupport": true,
        "constraint": [
          {
            "key": "appointment-reasonreference-literal",
            "severity": "error",
            "human": "A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted.",
            "expression": "($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())",
            "source": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no"
          }
        ],
        "comment": "Use a literal reference to a separately stored resource conforming to the permitted target profile. Identifier-only and contained references are not permitted. The receiving service must check target existence and profile conformance."
      },
      {
        "id": "Appointment.reasonReference.reference",
        "path": "Appointment.reasonReference.reference",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.reasonReference.identifier",
        "path": "Appointment.reasonReference.identifier",
        "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.",
        "mustSupport": true
      },
      {
        "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,
        "constraint": [
          {
            "key": "appointment-supportinginformation-literal",
            "severity": "error",
            "human": "A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted.",
            "expression": "($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())",
            "source": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no"
          }
        ],
        "comment": "Use a literal reference to a separately stored resource conforming to the permitted target profile. Identifier-only and contained references are not permitted. The receiving service must check target existence and profile conformance."
      },
      {
        "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,
        "constraint": [
          {
            "key": "appointment-basedon-literal",
            "severity": "error",
            "human": "A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted.",
            "expression": "($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())",
            "source": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no"
          }
        ],
        "comment": "Use a literal reference to a separately stored resource conforming to the permitted target profile. Identifier-only and contained references are not permitted. The receiving service must check target existence and profile conformance."
      },
      {
        "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",
        "comment": "Exactly one Patient participant is required. Every participant must reference a separately stored permitted actor. Reference.type is optional; the resource-level invariant identifies the patient from its declared type, literal reference or resolved resource. Other permitted participant types remain optional and repeatable."
      },
      {
        "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": "A separately stored Patient, Practitioner, PractitionerRole, RelatedPerson or Location participating in the appointment, conforming to the permitted no-basis target profile. Include the one Patient and the other known participants; do not invent an actor for an unassigned booking.",
        "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"
            ]
          }
        ],
        "comment": "Use a literal Reference.reference to a separately stored resource conforming to the permitted national target profile. Identifier-only and contained references are not permitted. Official identifiers belong on the target resource. Reuse a confirmed resource in central storage; if no matching resource exists, register it before persisting the clinical reference. The receiving service must check target existence and profile conformance; the profile alone does not perform identity matching or prove that a resource exists in central storage.",
        "constraint": [
          {
            "key": "appointment-participant-actor-literal",
            "severity": "error",
            "human": "A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted.",
            "expression": "($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())",
            "source": "https://novari.no/fhir/digidot/StructureDefinition/digidot-Appointment-no"
          }
        ]
      },
      {
        "id": "Appointment.participant.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1,
        "max": "1"
      },
      {
        "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."
      }
    ]
  }
}