{
  "resourceType": "StructureDefinition",
  "url": "https://npcr.se/fhir/StructureDefinition/npcr-biopsy-results-unclear-biopsy-observation",
  "name": "NPCR_Biopsy_Results_Unclear_Biopsy_Observation",
  "status": "draft",
  "description": "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).\n\nSource variables covered (8 NPCR Variabelbeskrivning variables, all D_Oklar prefix):\n- D_AntOklar → component:coresCount (integer)\n- D_AntOklarSakn → component:coresCountMissing (boolean)\n- D_OklarCa → component:coresWithCancerCount (integer)\n- D_OklarCaSakn → component:coresWithCancerMissing (boolean)\n- D_OklarmmCa → component:totalCancerMm (decimal, mm)\n- D_OklarmmCaSakn → component:totalCancerMmMissing (boolean)\n- D_Oklarbioplangd → component:totalBiopsyLength (decimal, mm)\n- D_Oklarbioplangdsakn → component:totalBiopsyLengthMissing (boolean)\n\nDesign rationale — structurally identical to systematic biopsy:\nThe 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.).\n\nClinical context (per NPCR Variabelbeskrivning):\nD_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.\n\nTerminology binding — documentation gap (Observation.code):\nNPCR 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.\n\nConditional requirements (per NPCR Beteende/logik) — documented but not enforced:\n- D_AntOklar is obligatoriskt when D_OklarBiopsi = 1 AND D_AntOklarSakn != true\n- D_OklarCa is obligatoriskt when D_OklarBiopsi = 1 AND D_OklarCaSakn != true\n- D_OklarmmCa is obligatoriskt when D_OklarBiopsi = 1 AND D_OklarmmCaSakn != true\n- D_Oklarbioplangd is obligatoriskt when D_OklarBiopsi = 1 AND D_Oklarbioplangdsakn != true",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "mustSupport": true
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "fixedCode": "final",
        "mustSupport": true
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.category.coding.system",
        "path": "Observation.category.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/observation-category"
      },
      {
        "id": "Observation.category.coding.code",
        "path": "Observation.category.coding.code",
        "fixedCode": "laboratory"
      },
      {
        "id": "Observation.category.coding.display",
        "path": "Observation.category.coding.display",
        "fixedString": "Laboratory"
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "mustSupport": true
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://npcr.se/fhir/StructureDefinition/npcr-patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "code"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresCount",
        "path": "Observation.component",
        "sliceName": "coresCount",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresCount.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "coresCount"
            }
          ]
        }
      },
      {
        "id": "Observation.component:coresCount.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresCountMissing",
        "path": "Observation.component",
        "sliceName": "coresCountMissing",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresCountMissing.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "coresCountMissing"
            }
          ]
        }
      },
      {
        "id": "Observation.component:coresCountMissing.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresWithCancerCount",
        "path": "Observation.component",
        "sliceName": "coresWithCancerCount",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresWithCancerCount.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "coresWithCancerCount"
            }
          ]
        }
      },
      {
        "id": "Observation.component:coresWithCancerCount.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresWithCancerMissing",
        "path": "Observation.component",
        "sliceName": "coresWithCancerMissing",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:coresWithCancerMissing.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "coresWithCancerMissing"
            }
          ]
        }
      },
      {
        "id": "Observation.component:coresWithCancerMissing.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalCancerMm",
        "path": "Observation.component",
        "sliceName": "totalCancerMm",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalCancerMm.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "totalCancerMm"
            }
          ]
        }
      },
      {
        "id": "Observation.component:totalCancerMm.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalCancerMm.value[x].unit",
        "path": "Observation.component.value[x].unit",
        "fixedString": "mm"
      },
      {
        "id": "Observation.component:totalCancerMm.value[x].system",
        "path": "Observation.component.value[x].system",
        "fixedUri": "http://unitsofmeasure.org"
      },
      {
        "id": "Observation.component:totalCancerMm.value[x].code",
        "path": "Observation.component.value[x].code",
        "fixedCode": "mm"
      },
      {
        "id": "Observation.component:totalCancerMmMissing",
        "path": "Observation.component",
        "sliceName": "totalCancerMmMissing",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalCancerMmMissing.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "totalCancerMmMissing"
            }
          ]
        }
      },
      {
        "id": "Observation.component:totalCancerMmMissing.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalBiopsyLength",
        "path": "Observation.component",
        "sliceName": "totalBiopsyLength",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalBiopsyLength.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "totalBiopsyLength"
            }
          ]
        }
      },
      {
        "id": "Observation.component:totalBiopsyLength.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalBiopsyLength.value[x].unit",
        "path": "Observation.component.value[x].unit",
        "fixedString": "mm"
      },
      {
        "id": "Observation.component:totalBiopsyLength.value[x].system",
        "path": "Observation.component.value[x].system",
        "fixedUri": "http://unitsofmeasure.org"
      },
      {
        "id": "Observation.component:totalBiopsyLength.value[x].code",
        "path": "Observation.component.value[x].code",
        "fixedCode": "mm"
      },
      {
        "id": "Observation.component:totalBiopsyLengthMissing",
        "path": "Observation.component",
        "sliceName": "totalBiopsyLengthMissing",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:totalBiopsyLengthMissing.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-biopsy-results-observation-types",
              "code": "totalBiopsyLengthMissing"
            }
          ]
        }
      },
      {
        "id": "Observation.component:totalBiopsyLengthMissing.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}