Kerndatensatz Senologie
0.9.0 - ci-build

Kerndatensatz Senologie - Local Development build (v0.9.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

StructureMap: SenologieToObdsHistologie

Official URL: https://www.senologie.org/fhir/StructureMap/SenologieToObdsHistologie Version: 0.9.0
Draft as of 2026-05-04 Computable Name: SenologieToObdsHistologie

title: Senologie Histologie Observations to oBDS Histologie BackboneElement status: draft

map "https://www.senologie.org/fhir/StructureMap/SenologieToObdsHistologie" = "SenologieToObdsHistologie"

// title: Senologie Histologie Observations to oBDS Histologie BackboneElement
// status: draft

uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source
uses "http://hl7.org/fhir/StructureDefinition/Observation" alias Observation as source
uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as source
uses "https://www.senologie.org/fhir/StructureDefinition/obds-meldung" alias OBDSMeldung as target

// Known limitation: Sub-groups use `target tgt : BackboneElement`. See
// SenologieToObdsTNM.map for details on SM_TARGET_PATH errors.
// ============================================================================
// Gemeinsame Histologie-Map: Extrahiert Histologiebefunde aus MII Onko
// Observations und mappt auf das oBDS Histologie-BackboneElement.
// Wird von Diagnose, OP und Verlauf importiert.
// MII Onko Histologie-Profile:
// - mii-pr-onko-histologie-icdo3 (LOINC 59847-4): Morphologie + Freitext
// - mii-pr-onko-grading (LOINC 59542-1): Histopathologisches Grading
// - mii-pr-onko-anzahl-untersuchte-lymphknoten (LOINC 21894-1)
// - mii-pr-onko-anzahl-befallene-lymphknoten (LOINC 21893-3)
// - mii-pr-onko-anzahl-untersuchte-sentinel-lymphknoten (LOINC 92832-5)
// - mii-pr-onko-anzahl-befallene-sentinel-lymphknoten (LOINC 92831-7)
// Die Histologie-Observation (59847-4) ist die Haupt-Ressource.
// Grading und Lymphknoten koennen als components in der Haupt-Observation
// oder als separate Observations vorliegen.
// ============================================================================
// ============================================================================
// MapHistologie: Observation (Histologie ICD-O-3) -> oBDS Histologie
// Verarbeitet die Haupt-Histologie-Observation und extrahiert Morphologie,
// Grading und Lymphknoten-Daten aus deren components.
// ============================================================================
group MapHistologie(source src : Observation, target tgt : BackboneElement) {
  // Histologie_ID: aus Observation.identifier
  src.identifier as id then {
    id.value as v -> tgt.histologieID = v "SetHistologieID";
  } "MapHistologieID";
  // Tumor_Histologiedatum: aus Observation.effectiveDateTime
  src.effective as eff where $this.is(dateTime) -> tgt.tumorHistologiedatum = eff "SetHistologiedatum";
  // Histologie_EinsendeNr: aus Observation.identifier (Pathologie-Einsende-Nr)
  src.identifier as id where system = 'http://pathologie.charite.de/fhir/sid/einsende-nr' then {
    id.value as v -> tgt.histologieEinsendeNr = v "SetEinsendeNr";
  } "MapEinsendeNr";
  // Morphologie_ICD_O: aus Observation.value (ICD-O Morphologie)
  src.value as val then {
    val.coding as c where system = 'urn:oid:2.16.840.1.113883.6.43.1' -> tgt.morphologieICDO as morph then {
      c.code as cd -> morph.code = cd "SetMorphCode";
      c.version as v -> morph.version = v "SetMorphVersion";
    } "MapMorphCoding";
  } "MapMorphologie";
  // Morphologie_Freitext: aus Observation.value.text
  src.value as val then {
    val.text as t -> tgt.morphologieFreitext = t "SetMorphFreitext";
  } "MapMorphFreitext";
  // Grading: aus component (LOINC 59542-1) mit Uebersetzung SNOMED -> oBDS
  src.component as comp where code.coding.exists(code = '59542-1') then {
    comp.value as val then {
      val.coding as c -> tgt.grading = translate(c, 'https://www.senologie.org/fhir/ConceptMap/cm-sct-to-obds-grading', 'code') "TranslateGrading";
    } "MapGradingValue";
  } "MapGrading";
  // LK_untersucht: Anzahl untersuchter Lymphknoten (LOINC 21894-1)
  src.component as comp where code.coding.exists(code = '21894-1') then {
    comp.value as val -> tgt.lkUntersucht = val "SetLKUntersucht";
  } "MapLKUntersucht";
  // LK_befallen: Anzahl befallener Lymphknoten (LOINC 21893-3)
  src.component as comp where code.coding.exists(code = '21893-3') then {
    comp.value as val -> tgt.lkBefallen = val "SetLKBefallen";
  } "MapLKBefallen";
  // Sentinel_LK_untersucht (LOINC 92832-5)
  src.component as comp where code.coding.exists(code = '92832-5') then {
    comp.value as val -> tgt.sentinelLKUntersucht = val "SetSentinelLKUntersucht";
  } "MapSentinelLKUntersucht";
  // Sentinel_LK_befallen (LOINC 92831-7)
  src.component as comp where code.coding.exists(code = '92831-7') then {
    comp.value as val -> tgt.sentinelLKBefallen = val "SetSentinelLKBefallen";
  } "MapSentinelLKBefallen";
}