<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="test-digidot-RecallServiceRequest-no" />
  <url value="http://novari.no/fhir/digidot/StructureDefinition/test-digidot-RecallServiceRequest-no" />
  <version value="0.1.0-test" />
  <name value="TestDigidotRecallServiceRequestNo" />
  <title value="TEST DigiDot Recall ServiceRequest (NO)" />
  <status value="draft" />
  <date value="2026-05-28" />
  <publisher value="Novari AS - DigiDOT" />
  <description value="TEST comparison draft. Not for production use. DigiDOT profile for a regular dental recall need or next due window. This profile represents the plan/request layer. Proposed or booked time slots are represented separately with no-basis-Appointment using Appointment.basedOn, and the actual contact is represented with Encounter." />
  <purpose value="Use this profile for the recall need or next due timing. Scheduling remains Appointment, the actual visit remains Encounter, and a fixed recall cadence can be expressed with native FHIR occurrenceTiming.repeat." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://novari.no/fhir/digidot/StructureDefinition/test-digidot-ServiceRequest-no" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest">
      <path value="ServiceRequest" />
      <constraint>
        <key value="recall-due-window" />
        <severity value="error" />
        <human value="A recall ServiceRequest must include occurrence[x] to describe the next due date or due window." />
        <expression value="occurrence.exists()" />
      </constraint>
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <short value="Lifecycle status of the recall need." />
      <definition value="Use active while the recall still needs to be fulfilled, completed when the recall contact has happened or the cycle is closed, revoked when the recall is cancelled, and on-hold when it is temporarily paused." />
    </element>
    <element id="ServiceRequest.intent">
      <path value="ServiceRequest.intent" />
      <short value="Recall is represented as a plan." />
      <fixedCode value="plan" />
    </element>
    <element id="ServiceRequest.category">
      <path value="ServiceRequest.category" />
      <short value="Recall category marker." />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://novari.no/fhir/digidot/CodeSystem/test-digidot-service-request-category" />
          <code value="dental-recall" />
        </coding>
      </patternCodeableConcept>
      <binding>
        <strength value="required" />
        <valueSet value="http://novari.no/fhir/digidot/ValueSet/test-digidot-service-request-category" />
      </binding>
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <short value="Recall examination or service being planned." />
      <definition value="Use an agreed SNOMED CT concept for the recall examination or service. The example uses 185349003 |Encounter for check up (procedure)| until DigiDOT terminology work agrees a more precise dental recall concept." />
      <patternCodeableConcept>
        <coding>
          <system value="http://snomed.info/sct" />
          <code value="185349003" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="ServiceRequest.occurrence[x]">
      <path value="ServiceRequest.occurrence[x]" />
      <short value="Next recall timing, due date or due window." />
      <definition value="Use occurrenceTiming when a fixed recall cadence should be exchanged, for example repeat.frequency = 1, repeat.period = 12 and repeat.periodUnit = mo for 12-month recall. Use occurrencePeriod when only the next due window is exchanged. Appointment remains the scheduling resource for proposed or booked times." />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <type>
        <code value="Timing" />
      </type>
    </element>
  </differential>
</StructureDefinition>