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: SenologieToIqtigBrust

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

title: Senologie Condition + Pathologie to IQTIG 18.1 Teildatensatz Brust status: draft

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

// title: Senologie Condition + Pathologie to IQTIG 18.1 Teildatensatz Brust
// status: draft

uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source
uses "http://hl7.org/fhir/StructureDefinition/Condition" alias Condition as source
uses "http://hl7.org/fhir/StructureDefinition/Observation" alias Observation as source
uses "http://hl7.org/fhir/StructureDefinition/ServiceRequest" alias ServiceRequest as source

// Import-only map: no target `uses` declaration — the calling map
// (SenologieToIqtigMammachirurgie181) provides the correct BackboneElement
// context (teildatensatzBrust). Omitting the root-level target type avoids
// SM_TARGET_PATH false positives where the validator would resolve property
// names against iqtig-mammachirurgie-181 root.
// ============================================================================
// Teildatensatz Brust (BRUST): Condition + Observations -> BRUST:*
// Pro betroffener Brustseite wird ein Brust-Teildatensatz erzeugt. Die
// Zuordnung zur Operation erfolgt ueber die laufende Nummer (LNRBRUST).
// Quellen:
// - Condition (Senologie_Diagnose_Maligne / _Benigne) -> Indikation, ICD,
// Seitenlokalisation, Diagnosedatum
// - Observation (BI-RADS, bildgebende Methode, Praeopbefund) -> Befund
// - ServiceRequest (Senologie_OP_Planung) -> Drahtmarkierung, Neoadjuvanz
// - Observation (cTNM, Tumorgroesse klinisch) -> Staging-Felder
// ============================================================================
group MapBrust(source src : Condition, target tgt : BackboneElement) {
  // BRUST:LNRBRUST - Standardwert 1 (kann durch Slicing ueberschrieben werden)
  src -> tgt.laufendeNummer = 1 "SetLnrBrust";
  // BRUST:SEITE - Seitenlokalisation aus Condition.bodySite (SNOMED CT)
  // 24028007=right, 7771000=left, 51440002=bilateral
  src.bodySite as bs then {
    bs.coding as c where system = 'http://snomed.info/sct' then {
      c.code as cd where $this = '24028007' -> tgt.seitenlokalisation = 'R' "SetSeiteR";
      c.code as cd where $this = '7771000' -> tgt.seitenlokalisation = 'L' "SetSeiteL";
      c.code as cd where $this = '51440002' -> tgt.seitenlokalisation = 'B' "SetSeiteB";
    } "MapSeiteSCT";
  } "MapSeitenlokalisation";
  // BRUST:INDIKATION - Indikation aus ICD-10-GM-Code
  // C50.* = maligne (1), D05.* = DCIS (2), D24 = benigne (3), Z40.* = Risikoreduktion (4)
  src.code as code then {
    code.coding as c where system = 'http://fhir.de/CodeSystem/bfarm/icd-10-gm' then {
      c.code as cd where $this.startsWith('C50') -> tgt.indikation = '1' "SetIndikMaligne";
      c.code as cd where $this.startsWith('D05') -> tgt.indikation = '2' "SetIndikDCIS";
      c.code as cd where $this.startsWith('D24') -> tgt.indikation = '3' "SetIndikBenigne";
      c.code as cd where $this.startsWith('Z40') -> tgt.indikation = '4' "SetIndikRisiko";
      c.code as cd where $this.startsWith('Z42') -> tgt.indikation = '5' "SetIndikRekon";
    } "MapIndikationICD";
  } "MapIndikation";
  // BRUST:DIAGICD - ICD-10-GM-Kodierung der Diagnose
  src.code as code then {
    code.coding as c where system = 'http://fhir.de/CodeSystem/bfarm/icd-10-gm' -> tgt.diagnoseICD as icd then {
      c.code as cd -> icd.code = cd "SetICDCode";
      c.version as v -> icd.version = v "SetICDVersion";
    } "MapICDCoding";
  } "MapDiagnoseICD";
  // BRUST:DIAGDATUM - Diagnosedatum aus Condition.onsetDateTime
  src.onset as onset where $this.is(dateTime) -> tgt.diagnosedatum = onset "SetDiagnosedatum";
  // BRUST:HISTPRAEOP - Default (nein)
  src -> tgt.histologischeSicherungPraeop = '0' "SetHistPraeopDefault";
  // BRUST:NEOADJ - Default (nein)
  src -> tgt.neoadjuvanteTherapie = '0' "SetNeoadjDefault";
  // BRUST:TKPRAEOP - Default (unbekannt)
  src -> tgt.tumorkonferenzPraeop = '9' "SetTKPraeopDefault";
}