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

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

title: Senologie Mamma-Observations to oBDS Modul_Mamma BackboneElement status: draft

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

// title: Senologie Mamma-Observations to oBDS Modul_Mamma 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/ServiceRequest" alias ServiceRequest 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` because FML
// has no syntax to declare the Logical Model sub-path for BackboneElement
// slices passed from parent groups. The IG Publisher produces SM_TARGET_PATH
// / SM_SOURCE_PATH errors (~22). The element names are correct per the oBDS
// Logical Model.
// ============================================================================
// Gemeinsame Modul-Mamma-Map: Extrahiert mammaspezifische Observations aus
// dem Bundle und mappt auf das oBDS Modul_Mamma BackboneElement.
// Wird von Diagnose, OP und Verlauf importiert.
// MII Onko Mamma-Profile:
// - mii-pr-onko-mamma-rezeptorstatus-estrogen (LOINC 85337-4)
// - mii-pr-onko-mamma-rezeptorstatus-progesteron (LOINC 85339-0)
// - mii-pr-onko-mamma-her2neu-status (LOINC 85319-2)
// - mii-pr-onko-mamma-menopause-status (LOINC 63612-8)
// SNOMED-CT Werte:
// 10828004 = Positive (qualifier value) -> P
// 260385009 = Negative (qualifier value) -> N
// 261665006 = Unknown (qualifier value) -> U
// Menopausenstatus:
// 309606002 = Before menopause (finding) -> 1 (praemenopausal)
// 309607006 = During menopause (finding) -> 2 (perimenopausal, nicht oBDS-konform, gemappt auf U)
// 309608001 = After menopause (finding) -> 3 (postmenopausal)
// ============================================================================
// ============================================================================
// MapModulMamma: Bundle -> oBDS Modul_Mamma
// Extrahiert Hormonrezeptoren, HER2 und Menopausenstatus aus Observations
// ============================================================================
group MapModulMamma(source src : Bundle, target tgt : BackboneElement) {
  // Oestrogenrezeptor (LOINC 85337-4 = Estrogen receptor Ag [Presence])
  src.entry as erEntry where resource.is(Observation) and resource.code.coding.exists(code = '85337-4') then {
    erEntry.resource as erObs then {
      erObs.value as val then {
        val.coding as c where code = '10828004' -> tgt.hormonrezeptorStatusOestrogen = 'P' "SetERPositiv";
        val.coding as c where code = '260385009' -> tgt.hormonrezeptorStatusOestrogen = 'N' "SetERNegativ";
        val.coding as c where code = '261665006' -> tgt.hormonrezeptorStatusOestrogen = 'U' "SetERUnbekannt";
      } "MapERValue";
    } "MapERObs";
  } "EntryER";
  // Progesteronrezeptor (LOINC 85339-0 = Progesterone receptor Ag [Presence])
  src.entry as prEntry where resource.is(Observation) and resource.code.coding.exists(code = '85339-0') then {
    prEntry.resource as prObs then {
      prObs.value as val then {
        val.coding as c where code = '10828004' -> tgt.hormonrezeptorStatusProgesteron = 'P' "SetPRPositiv";
        val.coding as c where code = '260385009' -> tgt.hormonrezeptorStatusProgesteron = 'N' "SetPRNegativ";
        val.coding as c where code = '261665006' -> tgt.hormonrezeptorStatusProgesteron = 'U' "SetPRUnbekannt";
      } "MapPRValue";
    } "MapPRObs";
  } "EntryPR";
  // HER2-Status (LOINC 85319-2 = HER2 [Presence] in Breast cancer specimen)
  src.entry as herEntry where resource.is(Observation) and resource.code.coding.exists(code = '85319-2') then {
    herEntry.resource as herObs then {
      herObs.value as val then {
        val.coding as c where code = '10828004' -> tgt.her2neuStatus = 'P' "SetHER2Positiv";
        val.coding as c where code = '260385009' -> tgt.her2neuStatus = 'N' "SetHER2Negativ";
        val.coding as c where code = '261665006' -> tgt.her2neuStatus = 'U' "SetHER2Unbekannt";
      } "MapHER2Value";
    } "MapHER2Obs";
  } "EntryHER2";
  // Menopausenstatus (LOINC 63612-8 = Menopause status)
  // Nur in Diagnose und Verlauf relevant (nicht OP)
  src.entry as menoEntry where resource.is(Observation) and resource.code.coding.exists(code = '63612-8') then {
    menoEntry.resource as menoObs then {
      menoObs.value as val then {
        // Praemenopausal: SNOMED 309606002 -> oBDS 1
        val.coding as c where code = '309606002' -> tgt.praetherapeutischerMenopausenstatus = '1' "SetMenoPrae";
        // Postmenopausal: SNOMED 309608001 -> oBDS 3
        val.coding as c where code = '309608001' -> tgt.praetherapeutischerMenopausenstatus = '3' "SetMenoPost";
        // Perimenopausal: SNOMED 309607006 -> oBDS U (kein oBDS-Code fuer perimenopausal)
        val.coding as c where code = '309607006' -> tgt.praetherapeutischerMenopausenstatus = 'U' "SetMenoPeri";
        // Unbekannt: SNOMED 261665006 -> oBDS U
        val.coding as c where code = '261665006' -> tgt.praetherapeutischerMenopausenstatus = 'U' "SetMenoUnbekannt";
      } "MapMenoValue";
    } "MapMenoObs";
  } "EntryMenopause";
  // Praeoperative Drahtmarkierung (aus Senologie_OP_Planung ServiceRequest.extension[preOpMarkierung])
  // ValueCodeableConcept mit code M/S/T/N/U oder Freitext; wird nur fuer OP-Meldung verwendet.
  src.entry as srEntry where resource.is(ServiceRequest) then {
    srEntry.resource as sr then {
      sr.extension as ext where url = 'https://www.senologie.org/fhir/StructureDefinition/ex-senologie-pre-op-markierung' then {
        ext.value as val then {
          val.coding as c where code = 'M' -> tgt.praeopDrahtmarkierung = 'M' "SetDrahtMammografie";
          val.coding as c where code = 'S' -> tgt.praeopDrahtmarkierung = 'S' "SetDrahtSonografie";
          val.coding as c where code = 'T' -> tgt.praeopDrahtmarkierung = 'T' "SetDrahtMRT";
          val.coding as c where code = 'N' -> tgt.praeopDrahtmarkierung = 'N' "SetDrahtNein";
        } "MapDrahtValue";
      } "MapDrahtExt";
    } "MapDrahtSR";
  } "EntryDrahtmarkierung";
  // Intraoperative Praeparatkontrolle (QI-3) — aus Specimen im Bundle
  // Specimen.processing.procedure.coding mit oBDS-Kode (M/S/N/U)
  src.entry as specEntry where resource.is(Specimen) then {
    specEntry.resource as spec then {
      spec.processing as proc then {
        proc.procedure as p then {
          p.coding as c where system = 'https://www.senologie.org/fhir/CodeSystem/cs-senologie-obds-intraop-praeparatkontrolle' -> tgt.intraopPraeparatkontrolle = (c.code) "SetIntraopKontrolle";
        } "MapIntraopProc";
      } "MapIntraopProcessing";
    } "MapIntraopSpec";
  } "EntryIntraopKontrolle";
  // Tumorgroesse invasiv (LOINC 33728-7 = Size of tumor in Specimen; component/valueQuantity in mm)
  src.entry as sizeEntry where resource.is(Observation) and resource.code.coding.exists(code = '33728-7') then {
    sizeEntry.resource as sizeObs then {
      sizeObs.value as val then {
        val.value as v -> tgt.tumorgroesseInvasiv = v "SetTumorgroesseInvasiv";
      } "MapSizeInvasiv";
    } "MapSizeObs";
  } "EntryTumorSize";
}