<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="digidot-Helsegruppe-no" />
  <url value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Helsegruppe-no" />
  <version value="0.6.0" />
  <name value="DigidotHelsegruppeNo" />
  <title value="DigiDOT Health Group Extension (NO)" />
  <status value="draft" />
  <date value="2026-11-03" />
  <publisher value="Novari AS - DigiDOT" />
  <description value="Readiness: [In development](https://simplifier.net/guide/Visual-overview/Home/Review-status-and-releases.page.md?version=current#readiness-helsegruppe).&#xA;&#xA;Optional health-group classification applied to the patient at the start of one Encounter. Preserves the contact context independently of later changes in the patient's health-group membership." />
  <purpose value="The selected health group applied at the start of this Encounter. Select the Patient health-group period covering the calendar date of Encounter.period.start in the Europe/Oslo time zone. Use the contact date even for late entry; do not copy today's classification into a past contact. If a contact crosses a group boundary, retain its start-date classification. Later Patient changes do not automatically rewrite this value. Correct an erroneous classification only through the agreed traceable correction workflow. The receiving service must check the Patient period and code; standalone profile validation cannot perform this cross-resource workflow check. The extension remains optional (0..1) for now; a future mandatory requirement is a separate decision. Absence means that no contact classification is recorded, not that the patient has no entitlement. Use DigiDOT Patient Health Group for repeatable patient-level periods. The supplied code list remains draft and does not itself establish eligibility or payment rights." />
  <fhirVersion value="4.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="Encounter" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <short value="Optional contact-specific health-group classification" />
      <definition value="The selected health group applied at the start of this Encounter. Select the Patient health-group period covering the calendar date of Encounter.period.start in the Europe/Oslo time zone. Use the contact date even for late entry; do not copy today's classification into a past contact. If a contact crosses a group boundary, retain its start-date classification. Later Patient changes do not automatically rewrite this value. Correct an erroneous classification only through the agreed traceable correction workflow. The receiving service must check the Patient period and code; standalone profile validation cannot perform this cross-resource workflow check. The extension remains optional (0..1) for now; a future mandatory requirement is a separate decision. Absence means that no contact classification is recorded, not that the patient has no entitlement." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Extension.extension">
      <path value="Extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Helsegruppe-no" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <short value="Health group applied for the contact" />
      <definition value="One coded classification applied at contact start. An unknown group must not be replaced by an invented default. Use the calendar-year and priority rules agreed for the classification date." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Select one of the current health-group codes in the DigiDOT Health Groups ValueSet. Grouping concepts, retired codes, alternative code systems and text-only classifications are not permitted. Assignment rules are defined separately in the CodeSystem and MPI workflows." />
        <valueSet value="https://novari.no/fhir/digidot/ValueSet/digidot-helsegruppe" />
      </binding>
    </element>
    <element id="Extension.value[x].coding">
      <path value="Extension.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Extension.value[x].coding.system">
      <path value="Extension.value[x].coding.system" />
      <min value="1" />
    </element>
    <element id="Extension.value[x].coding.code">
      <path value="Extension.value[x].coding.code" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>