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

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

title: Senologie Organization to OncoBox Brust Zentrum status: draft

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

// title: Senologie Organization to OncoBox Brust Zentrum
// status: draft

uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source
uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as source

// Import-only map: no target `uses` declaration — the calling map
// (SenologieToOncoBoxBrust) provides the correct BackboneElement context
// (zentrum). Omitting the root-level target type avoids SM_TARGET_PATH false
// positives where the validator would resolve property names against
// oncobox-brust-meldung root.
// ============================================================================
// Zentrum / Meldungs-Metadaten: Organization + Bundle.timestamp -> Zentrum
// Die Zentrums-ID (OnkoZert-Kennung) ist zentrumsspezifisch und wird als
// Konfigurationswert oder ueber Organization.identifier gepflegt. Der
// Berichtszeitraum (01.07.Vorjahr - 30.06.aktuellesJahr) ist meldungs-
// spezifisch und wird hier aus Bundle.timestamp abgeleitet; in der Praxis
// typischerweise ueber Parameter gesetzt.
// ============================================================================
group MapZentrum(source src : Bundle, target tgt : BackboneElement) {
  // OncoBox-Spezifikationsversion (fest)
  src -> tgt.oncoBoxVersion = 'N1.1.1' "SetOncoBoxVersion";
  // Meldungsdatum (fest auf Bundle-Timestamp)
  src.timestamp as ts -> tgt.meldungsdatum = ts "SetMeldungsdatum";
  // --- Zentrum aus Organization ---
  src.entry as entry where resource.is(Organization) then {
    entry.resource as org then {
      // Zentrum_Name aus Organization.name
      org.name as name -> tgt.zentrumName = name "SetZentrumName";
      // IKNR - Institutionskennzeichen
      org.identifier as id where system = 'https://fhir.de/sid/arge-ik/iknr' then {
        id.value as v -> tgt.iknr = v "SetIKNR";
      } "FilterIKNR";
      // Standort-ID
      org.identifier as id where system = 'http://fhir.de/sid/standortnummer' then {
        id.value as v -> tgt.standortId = v "SetStandortId";
      } "FilterStandort";
      // Zentrum_ID aus OnkoZert-Kennung (Organization.identifier)
      // Falls keine spezifische OnkoZert-Kennung, IKNR als Fallback
      org.identifier as id where system = 'https://www.onkozert.de/sid/zentrum-id' then {
        id.value as v -> tgt.zentrumId = v "SetZentrumId";
      } "FilterZentrumIdOZ";
      // Fallback: IKNR als Zentrum-ID
      org.identifier as id where system = 'https://fhir.de/sid/arge-ik/iknr' then {
        id.value as v -> tgt.zentrumId = v "SetZentrumIdIKNRFallback";
      } "FilterZentrumIdIKNR";
    } "OrgContext";
  } "EntryOrganization";
}