{
  "resourceType": "StructureDefinition",
  "url": "https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-observation",
  "name": "NPCR_Gleason_Score_Observation",
  "status": "draft",
  "description": "Patient-level \"Summary\" Gleason score observation, representing the overall Gleason assessment of a patient's prostate cancer regardless of the specimen source. This is the primary Profile in the NPCR Gleason score observation family and the Observation a clinician would reference when answering \"what is this patient's Gleason score?\".\r\n\r\nSource variables covered (4 NPCR Variabelbeskrivning variables, dual-role):\r\n- D_GleasSakn → component:missingFlag\r\n- D_GleasEtt → component:primaryGrade\r\n- D_GleasTva → component:secondaryGrade\r\n- D_GleasSa → component:gleasonSum\r\n\r\nRelationship to source-specific Gleason observations:\r\nA Summary Gleason Observation (this Profile) is conceptually derived from one or more source-specific Gleason observations. FHIR's Observation.derivedFrom element represents this relationship, referencing instances of:\r\n- NPCRGleasonScoreTargetedBiopsyObservation\r\n- NPCRGleasonScoreSystematicBiopsyObservation\r\n- NPCRGleasonScoreUnclearBiopsyObservation\r\n- NPCRGleasonScoreTURPCystoObservation\r\n\r\nDerivation logic (per NPCR INCA) — documented but outside this Profile's enforcement scope:\r\n- D_Vavn = 1 (core needle biopsy): INCA automatically derives Summary from source observations by priority: first available of Systematic → Unclear → Targeted. When this Profile is used, derivedFrom should reference the chosen source.\r\n- D_Vavn = 2 (Cystoprostatektomi) or 5 (TUR-P): Registrar directly enters Summary from the pathology report. derivedFrom may reference the corresponding NPCRGleasonScoreTURPCystoObservation, or the relationship may be implicit (Summary is the primary representation in these scenarios).\r\n\r\nThe derivation rule itself is implementation logic belonging to the INCA integration layer or a downstream transformation, beyond the scope of this pre-implementation feasibility study. This Profile provides the structural capability to represent both the Summary value and its derivation relationship; the derivation process is left to implementers.\r\n\r\nTerminology binding — documentation gap (Observation.code):\r\nNPCR 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.\r\n\r\nRationale for a dedicated Summary Profile:\r\nEvery NPCR-registered prostate cancer case has a patient-level Gleason assessment (when histopathology is available). Separating this from the source-specific observations allows clinical queries and downstream reporting systems to work with a single canonical Gleason value per patient, while preserving the ability to audit the underlying source data. This design aligns with FHIR's Observation.derivedFrom usage pattern (\"Related resource that the observation is made from ... a transformation or translation of the source observations to the observation\").",
  "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]",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.derivedFrom",
        "path": "Observation.derivedFrom",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-targeted-biopsy-observation",
              "https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-systematic-biopsy-observation",
              "https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-unclear-biopsy-observation",
              "https://npcr.se/fhir/StructureDefinition/npcr-gleason-score-turp-cysto-observation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "code"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.component:primaryGrade",
        "path": "Observation.component",
        "sliceName": "primaryGrade",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:primaryGrade.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types",
              "code": "primaryGrade"
            }
          ]
        }
      },
      {
        "id": "Observation.component:primaryGrade.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:secondaryGrade",
        "path": "Observation.component",
        "sliceName": "secondaryGrade",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:secondaryGrade.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types",
              "code": "secondaryGrade"
            }
          ]
        }
      },
      {
        "id": "Observation.component:secondaryGrade.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:gleasonSum",
        "path": "Observation.component",
        "sliceName": "gleasonSum",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:gleasonSum.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types",
              "code": "gleasonSum"
            }
          ]
        }
      },
      {
        "id": "Observation.component:gleasonSum.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component:missingFlag",
        "path": "Observation.component",
        "sliceName": "missingFlag",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Observation.component:missingFlag.code",
        "path": "Observation.component.code",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://npcr.se/fhir/CodeSystem/npcr-gleason-observation-types",
              "code": "missingFlag"
            }
          ]
        },
        "mustSupport": true
      },
      {
        "id": "Observation.component:missingFlag.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}