<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="digidot-ChargeItem-no" />
  <url value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
  <version value="0.3.0" />
  <name value="DigidotChargeItemNo" />
  <title value="DigiDOT ChargeItem (NO)" />
  <status value="draft" />
  <date value="2026-11-23" />
  <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-chargeitem).&#xA;&#xA;Profile base: FHIR R4 ChargeItem.&#xA;&#xA;One priced dental service linked to an Encounter and, when applicable, one performed Procedure: its description, quantity and calculated total fee before allocation to the patient or a benefit payer. A price code is optional. The required priceOverride is the full fee for the entire quantity, not a unit price or payment result. No price extension is used." />
  <purpose value="Retain the EHR-calculated full fee and quantity for each priced service, linked to an Encounter and to its performed Procedure when one exists. Support procedure-level financial reporting and reconciliation with linked reimbursement claims. Pricing, entitlement, invoicing and settlement remain in the EHR or financial system." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ChargeItem" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ChargeItem" />
  <derivation value="constraint" />
  <differential>
    <element id="ChargeItem">
      <path value="ChargeItem" />
      <short value="Priced dental service with quantity and total fee" />
      <definition value="One priced service for one patient and one Encounter, with a Procedure link when the service has one. The quantity may count procedures or images, or express billable consultation minutes. The total fee covers the entire quantity before allocation between patient, public funding and insurance; it is not the provider's internal production cost." />
      <comment value="This is the full fee before payer allocation, not the provider's internal cost or money collected. A ChargeItem may exist without a Claim. Subtracting linked requested amounts yields the amount not included in those claims; it does not establish final patient liability." />
      <constraint>
        <key value="digidot-status-known" />
        <severity value="error" />
        <human value="Do not use unknown as a default or an unmapped lifecycle status." />
        <expression value="status != 'unknown'" />
      </constraint>
      <constraint>
        <key value="dd-fin-money-complete" />
        <severity value="error" />
        <human value="Every supplied Money must state both its value and currency. Missing amounts must not be represented as zero." />
        <expression value="descendants().ofType(Money).all(value.exists() and currency.exists())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
      <constraint>
        <key value="dd-ci-quantity-positive" />
        <severity value="error" />
        <human value="The priced quantity must be greater than zero." />
        <expression value="quantity.value &gt; 0" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
      <constraint>
        <key value="dd-ci-performed-service" />
        <severity value="error" />
        <human value="Use this profile for an actual provided service, not a planned charge." />
        <expression value="status != 'planned'" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.implicitRules">
      <path value="ChargeItem.implicitRules" />
      <comment value="The shared exchange rules apply; no additional implicit processing rules are used." />
      <max value="0" />
    </element>
    <element id="ChargeItem.contained">
      <path value="ChargeItem.contained" />
      <comment value="Referenced resources are stored separately and linked using literal references." />
      <max value="0" />
    </element>
    <element id="ChargeItem.extension">
      <path value="ChargeItem.extension" />
      <comment value="The total fee is carried in the standard R4 priceOverride field; no resource-level extensions are used." />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.modifierExtension">
      <path value="ChargeItem.modifierExtension" />
      <comment value="No resource-level modifier extensions are defined for this financial draft." />
      <max value="0" />
    </element>
    <element id="ChargeItem.identifier">
      <path value="ChargeItem.identifier" />
      <short value="Stable identifier of the financial record in the source system" />
      <definition value="Business identifier used to recognise the same financial record across submissions and corrections. Repeated delivery must not create another charge or claim. Retain the source system and value; do not use a new identifier for a simple retry." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.identifier.system">
      <path value="ChargeItem.identifier.system" />
      <min value="1" />
    </element>
    <element id="ChargeItem.identifier.value">
      <path value="ChargeItem.identifier.value" />
      <min value="1" />
    </element>
    <element id="ChargeItem.definitionUri">
      <path value="ChargeItem.definitionUri" />
      <max value="0" />
    </element>
    <element id="ChargeItem.definitionCanonical">
      <path value="ChargeItem.definitionCanonical" />
      <max value="0" />
    </element>
    <element id="ChargeItem.status">
      <path value="ChargeItem.status" />
      <comment value="Billing lifecycle of the line, not the payment status of the patient. Free care to the patient does not by itself mean that a service is not billable to any payer." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.partOf">
      <path value="ChargeItem.partOf" />
      <max value="0" />
    </element>
    <element id="ChargeItem.code">
      <path value="ChargeItem.code" />
      <short value="Priced service description and optional price code" />
      <definition value="Describe the priced service, such as a restoration, intraoral images or a consultation billed by time. A coding may identify the applied price-list entry. The clinical procedure coding is held on the referenced Procedure; a reimbursement tariff belongs on Claim.item.productOrService." />
      <comment value="A price code may come from the EHR, clinic or county price list. Identify that actual code system and code; a local EHR code is allowed. The inherited FHIR example binding is not an adopted Norwegian price list. The price code does not replace a reimbursement tariff in Claim." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.code.coding.system">
      <path value="ChargeItem.code.coding.system" />
      <min value="1" />
    </element>
    <element id="ChargeItem.code.coding.code">
      <path value="ChargeItem.code.coding.code" />
      <min value="1" />
    </element>
    <element id="ChargeItem.code.text">
      <path value="ChargeItem.code.text" />
      <min value="1" />
    </element>
    <element id="ChargeItem.subject">
      <path value="ChargeItem.subject" />
      <comment value="Reference the MPI-managed Patient using the agreed literal patient reference. Do not create a Patient in DENT as part of the financial submission. Identifier-only and contained references are not permitted. The receiving service checks patient identity and consistency across the linked clinical and financial resources." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Patient" />
      </type>
      <constraint>
        <key value="chargeitem-subject-literal" />
        <severity value="error" />
        <human value="A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.subject.reference">
      <path value="ChargeItem.subject.reference" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.subject.identifier">
      <path value="ChargeItem.subject.identifier" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.context">
      <path value="ChargeItem.context" />
      <definition value="The Encounter in which the priced procedure occurred." />
      <comment value="The patient and Encounter must agree with the referenced Procedure; the receiving service checks this across resources." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Encounter-no" />
      </type>
      <constraint>
        <key value="chargeitem-context-literal" />
        <severity value="error" />
        <human value="A resource reference must contain a literal reference; identifier-only and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.context.reference">
      <path value="ChargeItem.context.reference" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.context.identifier">
      <path value="ChargeItem.context.identifier" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.occurrence[x]">
      <path value="ChargeItem.occurrence[x]" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.performer">
      <path value="ChargeItem.performer" />
      <max value="0" />
    </element>
    <element id="ChargeItem.performingOrganization">
      <path value="ChargeItem.performingOrganization" />
      <comment value="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." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Organization" />
      </type>
      <constraint>
        <key value="chargeitem-performingorganization-literal" />
        <severity value="error" />
        <human value="A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.performingOrganization.reference">
      <path value="ChargeItem.performingOrganization.reference" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.performingOrganization.identifier">
      <path value="ChargeItem.performingOrganization.identifier" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.requestingOrganization">
      <path value="ChargeItem.requestingOrganization" />
      <max value="0" />
    </element>
    <element id="ChargeItem.costCenter">
      <path value="ChargeItem.costCenter" />
      <max value="0" />
    </element>
    <element id="ChargeItem.quantity">
      <path value="ChargeItem.quantity" />
      <short value="Number of services, images or billable time units" />
      <definition value="Quantity covered by the total price. Use UCUM 1 for a count, with a descriptive unit such as procedure or image; use min for minutes. A per-block price uses the number of blocks, not the number of minutes." />
      <comment value="Quantity covered by the complete priceOverride amount. Do not multiply priceOverride by this quantity; it already covers all supplied units. Claim quantities follow their own tariff basis." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.quantity.value">
      <path value="ChargeItem.quantity.value" />
      <min value="1" />
    </element>
    <element id="ChargeItem.quantity.comparator">
      <path value="ChargeItem.quantity.comparator" />
      <max value="0" />
    </element>
    <element id="ChargeItem.quantity.unit">
      <path value="ChargeItem.quantity.unit" />
      <min value="1" />
    </element>
    <element id="ChargeItem.quantity.system">
      <path value="ChargeItem.quantity.system" />
      <min value="1" />
      <fixedUri value="http://unitsofmeasure.org" />
    </element>
    <element id="ChargeItem.quantity.code">
      <path value="ChargeItem.quantity.code" />
      <min value="1" />
    </element>
    <element id="ChargeItem.bodysite">
      <path value="ChargeItem.bodysite" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.factorOverride">
      <path value="ChargeItem.factorOverride" />
      <max value="0" />
    </element>
    <element id="ChargeItem.priceOverride">
      <path value="ChargeItem.priceOverride" />
      <short value="Total fee for the entire charge (not a unit price)" />
      <definition value="The total price of this charge, overriding any list price associated with its code. DigiDOT uses this explicitly supplied amount as the full fee for the entire quantity before allocation between patient, public funding and insurance." />
      <comment value="The EHR calculates and sends the complete line fee and currency. Do not multiply this amount by quantity again. Example: two images at NOK 150 each have quantity 2 and priceOverride NOK 300. A known zero fee is represented by value 0, not by omitting the amount. This is not internal production cost, reimbursement requested, or money collected. Claim.item.unitPrice is a per-unit amount on a separate claim line; its requested line amount is unitPrice multiplied by that line's quantity." />
      <min value="1" />
      <max value="1" />
      <example>
        <label value="Full fee for two images at NOK 150 each; quantity is 2" />
        <valueMoney>
          <value value="300" />
          <currency value="NOK" />
        </valueMoney>
      </example>
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.priceOverride.value">
      <path value="ChargeItem.priceOverride.value" />
      <min value="1" />
    </element>
    <element id="ChargeItem.priceOverride.currency">
      <path value="ChargeItem.priceOverride.currency" />
      <min value="1" />
    </element>
    <element id="ChargeItem.overrideReason">
      <path value="ChargeItem.overrideReason" />
      <max value="0" />
    </element>
    <element id="ChargeItem.enterer">
      <path value="ChargeItem.enterer" />
      <definition value="Practitioner or practitioner role that recorded the financial line." />
      <comment value="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." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole" />
      </type>
      <constraint>
        <key value="chargeitem-enterer-literal" />
        <severity value="error" />
        <human value="A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.enterer.reference">
      <path value="ChargeItem.enterer.reference" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.enterer.identifier">
      <path value="ChargeItem.enterer.identifier" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.enteredDate">
      <path value="ChargeItem.enteredDate" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.reason">
      <path value="ChargeItem.reason" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.service">
      <path value="ChargeItem.service" />
      <short value="The Procedure to which this fee belongs" />
      <definition value="The performed Procedure for this priced service, when one exists. Several charge lines may refer to the same Procedure. Split a charge covering several Procedures into allocated lines." />
      <comment value="Include the Procedure whenever the service has a related performed Procedure. A priced form or other administrative service may have none. The receiving service checks patient and Encounter consistency when a Procedure is linked." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Procedure-no" />
      </type>
      <constraint>
        <key value="chargeitem-service-literal" />
        <severity value="error" />
        <human value="A resource reference must contain a literal reference; identifier-only and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.service.reference">
      <path value="ChargeItem.service.reference" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ChargeItem.service.identifier">
      <path value="ChargeItem.service.identifier" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="ChargeItem.product[x]">
      <path value="ChargeItem.product[x]" />
      <max value="0" />
    </element>
    <element id="ChargeItem.account">
      <path value="ChargeItem.account" />
      <max value="0" />
    </element>
    <element id="ChargeItem.note.author[x]">
      <path value="ChargeItem.note.author[x]" />
      <definition value="The individual responsible for making the annotation." />
      <comment value="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. An authorString may be retained where this Annotation choice permits it; if authorReference is used, the literal-reference rule applies." />
      <type>
        <code value="string" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner" />
        <targetProfile value="http://hl7.no/fhir/StructureDefinition/no-basis-Organization" />
      </type>
      <constraint>
        <key value="chargeitem-note-author-x-literal" />
        <severity value="error" />
        <human value="A shared-resource reference must contain a literal reference value; identifiers and contained references are not permitted." />
        <expression value="($this is Reference) implies (reference.hasValue() and identifier.empty() and reference.startsWith('#').not())" />
        <source value="https://novari.no/fhir/digidot/StructureDefinition/digidot-ChargeItem-no" />
      </constraint>
    </element>
    <element id="ChargeItem.supportingInformation">
      <path value="ChargeItem.supportingInformation" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>