<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="hn-basis-schedule" />
  <url value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-schedule" />
  <version value="1.3.2" />
  <name value="HnBasisSchedule" />
  <title value="HnBasisSchedule" />
  <status value="draft" />
  <description value="FHIR Schedule brukes for å hente timebøker tilgjengelige for timebestilling for innbygger. Profilen er basert på R4." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="NO" />
      <display value="Norway" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Schedule" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Schedule" />
  <derivation value="constraint" />
  <differential>
    <element id="Schedule.extension">
      <path value="Schedule.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Schedule.extension:freeSlotPlanningHorizon">
      <path value="Schedule.extension" />
      <sliceName value="freeSlotPlanningHorizon" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://helsenorge.no/fhir/StructureDefinition/hn-extension-free-slot-planningHorizon" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Schedule.identifier">
      <path value="Schedule.identifier" />
      <short value="Identifer must be UUID/GUID" />
      <definition value="Identifer must be UUID/GUID" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Schedule.identifier.system">
      <path value="Schedule.identifier.system" />
      <min value="1" />
    </element>
    <element id="Schedule.identifier.value">
      <path value="Schedule.identifier.value" />
      <min value="1" />
    </element>
    <element id="Schedule.identifier.assigner">
      <path value="Schedule.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Organization" />
      </type>
    </element>
    <element id="Schedule.active">
      <path value="Schedule.active" />
      <patternBoolean value="true" />
    </element>
    <element id="Schedule.serviceCategory">
      <path value="Schedule.serviceCategory" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://hl7.org/fhir/ValueSet/service-category" />
      </binding>
    </element>
    <element id="Schedule.serviceCategory.coding">
      <path value="Schedule.serviceCategory.coding" />
      <constraint>
        <key value="inv-4" />
        <severity value="error" />
        <human value="If code is used in a codable consept the system must be used" />
        <expression value="code &gt; '' implies (system &gt; '' )" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-schedule" />
      </constraint>
    </element>
    <element id="Schedule.serviceCategory.coding.system">
      <path value="Schedule.serviceCategory.coding.system" />
      <min value="1" />
    </element>
    <element id="Schedule.serviceType">
      <path value="Schedule.serviceType" />
      <short value="Type timebok" />
      <min value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://helsenorge.no/fhir/ValueSet/hn-schedule-type-vs" />
      </binding>
    </element>
    <element id="Schedule.serviceType.coding">
      <path value="Schedule.serviceType.coding" />
      <constraint>
        <key value="inv-4" />
        <severity value="error" />
        <human value="If code is used in a codable consept the system must be used" />
        <expression value="code &gt; '' implies (system &gt; '' )" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-schedule" />
      </constraint>
    </element>
    <element id="Schedule.serviceType.coding.system">
      <path value="Schedule.serviceType.coding.system" />
      <min value="1" />
    </element>
    <element id="Schedule.specialty.coding">
      <path value="Schedule.specialty.coding" />
      <constraint>
        <key value="inv-4" />
        <severity value="error" />
        <human value="If code is used in a codable consept the system must be used" />
        <expression value="code &gt; '' implies (system &gt; '' )" />
        <source value="http://helsenorge.no/fhir/StructureDefinition/hn-basis-schedule" />
      </constraint>
    </element>
    <element id="Schedule.actor">
      <path value="Schedule.actor" />
      <short value="Currently only HealthcareService or Practitioner (basic and no-basic profiles) are referenced as valid actors." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/HealthcareService" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-HealthcareService" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner" />
      </type>
    </element>
    <element id="Schedule.actor.type">
      <path value="Schedule.actor.type" />
      <min value="1" />
    </element>
    <element id="Schedule.comment">
      <path value="Schedule.comment" />
      <short value="Comments regarding the scheduler." />
      <definition value="Comments regarding the scheduler including short information about the timebook." />
    </element>
  </differential>
</StructureDefinition>