<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="digidot-Device-no" />
  <url value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Device-no" />
  <version value="0.1.0-test" />
  <name value="DigidotDeviceNo" />
  <title value="DigiDot Device (NO)" />
  <status value="draft" />
  <date value="2026-08-28" />
  <publisher value="Novari AS - DigiDOT" />
  <description value="Draft DigiDOT profile for an optional, identifiable dental device that must be retained and referenced as its own FHIR resource. It supports patient-associated devices such as implants, prostheses and orthodontic appliances, and clinically or traceability-relevant dental equipment when the source records a concrete device instance." />
  <purpose value="Use this profile only when a concrete device needs its own identity and relationship in the shared record. A patient-associated device references the patient. Equipment used by a clinic may instead reference its owner and/or location. Do not create a Device merely to repeat a generic device type that is already represented in procedure coding." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Device" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Device" />
  <derivation value="constraint" />
  <differential>
    <element id="Device">
      <path value="Device" />
      <constraint>
        <key value="dev-type-recommended" />
        <severity value="warning" />
        <human value="DigiDOT dental devices should include Device.type when the device is clinically relevant." />
        <expression value="type.exists()" />
      </constraint>
      <constraint>
        <key value="dev-context-recommended" />
        <severity value="warning" />
        <human value="DigiDOT dental devices should normally reference a patient, owner or location so the device context is clear." />
        <expression value="patient.exists() or owner.exists() or location.exists()" />
      </constraint>
    </element>
    <element id="Device.identifier">
      <path value="Device.identifier" />
      <short value="Device identifier when available." />
      <definition value="Use Device.identifier for local device identifiers or supplier identifiers when they are available. Do not invent identifiers for generic device categories that do not need longitudinal tracking." />
      <mustSupport value="true" />
    </element>
    <element id="Device.udiCarrier">
      <path value="Device.udiCarrier" />
      <short value="Unique Device Identifier carrier when available." />
    </element>
    <element id="Device.status">
      <path value="Device.status" />
      <short value="FHIR device availability status." />
    </element>
    <element id="Device.manufacturer">
      <path value="Device.manufacturer" />
      <short value="Manufacturer." />
    </element>
    <element id="Device.lotNumber">
      <path value="Device.lotNumber" />
      <short value="Lot or batch number." />
    </element>
    <element id="Device.serialNumber">
      <path value="Device.serialNumber" />
      <short value="Serial number." />
    </element>
    <element id="Device.deviceName">
      <path value="Device.deviceName" />
      <short value="Name used for the device." />
    </element>
    <element id="Device.type">
      <path value="Device.type" />
      <short value="Dental device type." />
      <definition value="Record the clinically relevant type of the represented device. Prefer an agreed SNOMED CT device concept when available. The DigiDOT Device Type ValueSet is a draft, extensible starting point while the final terminology binding is agreed." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="Dental device categories. Use these categories when they cover the intended device; use a more precise SNOMED CT device concept when available." />
        <valueSet value="https://novari.no/fhir/digidot/ValueSet/digidot-device-type" />
      </binding>
    </element>
    <element id="Device.patient">
      <path value="Device.patient" />
      <short value="Patient associated with the device." />
      <definition value="Use Device.patient for patient-associated dental devices, such as an implant, prosthesis or orthodontic appliance that belongs to one patient." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Device.owner">
      <path value="Device.owner" />
      <short value="Owning organization." />
      <definition value="Use Device.owner when the device is owned by a clinic, county or other organization rather than being patient-associated." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="Device.location">
      <path value="Device.location" />
      <short value="Device location." />
      <definition value="Use Device.location for clinic-owned devices or devices whose current physical location is relevant." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Location" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
    </element>
    <element id="Device.note">
      <path value="Device.note" />
      <short value="Clinical or administrative note." />
    </element>
    <element id="Device.parent">
      <path value="Device.parent" />
      <short value="Parent device." />
      <definition value="Use Device.parent only when a device is a component of another represented device." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Device-no" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
    </element>
  </differential>
</StructureDefinition>