<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://npcr.se/fhir/StructureDefinition/npcr-biopsy-results-unclear-biopsy-observation" />
  <name value="NPCR_Biopsy_Results_Unclear_Biopsy_Observation" />
  <status value="draft" />
  <description value="Biopsy results observation for prostate tissue when both targeted and systematic biopsies were taken but cannot be distinguished in the PAD-utlåtande (pathology report). Part of the NPCR biopsy results observation family, consisting of three source-specific profiles (Targeted, Systematic, Unclear).&#xA;&#xA;Source variables covered (8 NPCR Variabelbeskrivning variables, all D_Oklar prefix):&#xA;- D_AntOklar → component:coresCount (integer)&#xA;- D_AntOklarSakn → component:coresCountMissing (boolean)&#xA;- D_OklarCa → component:coresWithCancerCount (integer)&#xA;- D_OklarCaSakn → component:coresWithCancerMissing (boolean)&#xA;- D_OklarmmCa → component:totalCancerMm (decimal, mm)&#xA;- D_OklarmmCaSakn → component:totalCancerMmMissing (boolean)&#xA;- D_Oklarbioplangd → component:totalBiopsyLength (decimal, mm)&#xA;- D_Oklarbioplangdsakn → component:totalBiopsyLengthMissing (boolean)&#xA;&#xA;Design rationale — structurally identical to systematic biopsy:&#xA;The Unclear profile uses the same 8-component structure as the Systematic profile because the underlying clinical measurement is the same (aggregate metrics across all cores), differing only in the source distinction: Unclear represents combined targeted + systematic biopsies where the PAD report does not separate the two sources. Because of this structural identity, Systematic and Unclear share the same component slice names (coresCount, coresWithCancerCount, totalCancerMm, totalBiopsyLength) — only the underlying NPCR variable names differ (D_Biop vs D_OklarBiop, etc.).&#xA;&#xA;Clinical context (per NPCR Variabelbeskrivning):&#xA;D_OklarBiopsi captures cases where both targeted and systematic biopsies were taken, but the pathology report (PAD) reports findings as a combined assessment without separating the two biopsy sources. This is documented as a separate biopsy modality in NPCR with its own complete variable set.&#xA;&#xA;Terminology binding — documentation gap (Observation.code):&#xA;NPCR Informationsspecifikation §7 does not provide a section for biopsy results identification. Observation.code is Must Support but without fixed value or terminology binding, consistent with other NPCR observation profiles. Resource identification relies on meta.profile.&#xA;&#xA;Conditional requirements (per NPCR Beteende/logik) — documented but not enforced:&#xA;- D_AntOklar is obligatoriskt when D_OklarBiopsi = 1 AND D_AntOklarSakn != true&#xA;- D_OklarCa is obligatoriskt when D_OklarBiopsi = 1 AND D_OklarCaSakn != true&#xA;- D_OklarmmCa is obligatoriskt when D_OklarBiopsi = 1 AND D_OklarmmCaSakn != true&#xA;- D_Oklarbioplangd is obligatoriskt when D_OklarBiopsi = 1 AND D_Oklarbioplangdsakn != true" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <fixedCode value="final" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category.coding.system">
      <path value="Observation.category.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/observation-category" />
    </element>
    <element id="Observation.category.coding.code">
      <path value="Observation.category.coding.code" />
      <fixedCode value="laboratory" />
    </element>
    <element id="Observation.category.coding.display">
      <path value="Observation.category.coding.display" />
      <fixedString value="Laboratory" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://npcr.se/fhir/StructureDefinition/npcr-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresCount">
      <path value="Observation.component" />
      <sliceName value="coresCount" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresCount.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="coresCount" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:coresCount.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresCountMissing">
      <path value="Observation.component" />
      <sliceName value="coresCountMissing" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresCountMissing.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="coresCountMissing" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:coresCountMissing.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresWithCancerCount">
      <path value="Observation.component" />
      <sliceName value="coresWithCancerCount" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresWithCancerCount.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="coresWithCancerCount" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:coresWithCancerCount.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresWithCancerMissing">
      <path value="Observation.component" />
      <sliceName value="coresWithCancerMissing" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:coresWithCancerMissing.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="coresWithCancerMissing" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:coresWithCancerMissing.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalCancerMm">
      <path value="Observation.component" />
      <sliceName value="totalCancerMm" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalCancerMm.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="totalCancerMm" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:totalCancerMm.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalCancerMm.value[x].unit">
      <path value="Observation.component.value[x].unit" />
      <fixedString value="mm" />
    </element>
    <element id="Observation.component:totalCancerMm.value[x].system">
      <path value="Observation.component.value[x].system" />
      <fixedUri value="http://unitsofmeasure.org" />
    </element>
    <element id="Observation.component:totalCancerMm.value[x].code">
      <path value="Observation.component.value[x].code" />
      <fixedCode value="mm" />
    </element>
    <element id="Observation.component:totalCancerMmMissing">
      <path value="Observation.component" />
      <sliceName value="totalCancerMmMissing" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalCancerMmMissing.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="totalCancerMmMissing" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:totalCancerMmMissing.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalBiopsyLength">
      <path value="Observation.component" />
      <sliceName value="totalBiopsyLength" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalBiopsyLength.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="totalBiopsyLength" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:totalBiopsyLength.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalBiopsyLength.value[x].unit">
      <path value="Observation.component.value[x].unit" />
      <fixedString value="mm" />
    </element>
    <element id="Observation.component:totalBiopsyLength.value[x].system">
      <path value="Observation.component.value[x].system" />
      <fixedUri value="http://unitsofmeasure.org" />
    </element>
    <element id="Observation.component:totalBiopsyLength.value[x].code">
      <path value="Observation.component.value[x].code" />
      <fixedCode value="mm" />
    </element>
    <element id="Observation.component:totalBiopsyLengthMissing">
      <path value="Observation.component" />
      <sliceName value="totalBiopsyLengthMissing" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:totalBiopsyLengthMissing.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types" />
          <code value="totalBiopsyLengthMissing" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:totalBiopsyLengthMissing.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>