<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-turp-cysto-observation" />
  <name value="NPCR_Gleason_Score_TURP_Cysto_Observation" />
  <status value="draft" />
  <description value="Gleason score observation for prostate tissue obtained via TUR-P (transurethral resection of prostate) or cystoprostatectomy (bladder + prostate removal). Part of the NPCR Gleason score observation family, consisting of one Summary-level profile (NPCRGleasonScoreObservation) and four source-specific profiles.&#xD;&#xA;&#xD;&#xA;Source variables covered (4 NPCR Variabelbeskrivning variables):&#xD;&#xA;- D_GleasSakn → component:missingFlag&#xD;&#xA;- D_GleasEtt → component:primaryGrade&#xD;&#xA;- D_GleasTva → component:secondaryGrade&#xD;&#xA;- D_GleasSa → component:gleasonSum&#xD;&#xA;&#xD;&#xA;Clinical context: This profile applies when the primary diagnostic method is NOT core needle biopsy — specifically when D_Vavn = 2 (Cystoprostatektomi) or D_Vavn = 5 (TUR-P). In both scenarios, prostate cancer is discovered incidentally during surgery performed for other reasons: TUR-P for benign prostatic hyperplasia (BPH), or cystoprostatectomy for bladder cancer. The Gleason assessment is performed by the pathologist on the surgical specimen rather than on biopsy cores, and is entered directly by the registrar from the pathology report (PAD).&#xD;&#xA;&#xD;&#xA;Dual-role note for source variables: The same variables D_GleasSakn / D_GleasEtt / D_GleasTva / D_GleasSa are also used as the &quot;Summary&quot; group in NPCR, which INCA auto-derives from Syst/Oklar/Rikt for D_Vavn=1 cases. This profile is only populated when D_Vavn = 2 or 5 (direct-entry scenario); the derived-summary role is represented separately by NPCRGleasonScoreObservation with Observation.derivedFrom references.&#xD;&#xA;&#xD;&#xA;The Summary Gleason Observation (NPCRGleasonScoreObservation) may reference this profile via Observation.derivedFrom when D_Vavn = 2 or 5.&#xD;&#xA;&#xD;&#xA;Terminology binding — documentation gap (Observation.code):&#xD;&#xA;NPCR Informationsspecifikation §7 does not provide a section for Gleason score 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.&#xD;&#xA;&#xD;&#xA;Conditional requirements (per NPCR Beteende/logik) — documented but not enforced:&#xD;&#xA;- D_GleasEtt, D_GleasTva, D_GleasSa are obligatoriskt when D_Vavn = 2 OR 5 AND D_GleasSakn != 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]" />
      <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:primaryGrade">
      <path value="Observation.component" />
      <sliceName value="primaryGrade" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:primaryGrade.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types" />
          <code value="primaryGrade" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:primaryGrade.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:secondaryGrade">
      <path value="Observation.component" />
      <sliceName value="secondaryGrade" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:secondaryGrade.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types" />
          <code value="secondaryGrade" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:secondaryGrade.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:gleasonSum">
      <path value="Observation.component" />
      <sliceName value="gleasonSum" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:gleasonSum.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types" />
          <code value="gleasonSum" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:gleasonSum.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:missingFlag">
      <path value="Observation.component" />
      <sliceName value="missingFlag" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:missingFlag.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types" />
          <code value="missingFlag" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:missingFlag.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>