{
  "resourceType": "StructureDefinition",
  "id": "ISiKDokumentenMetadaten",
  "url": "https://gematik.de/fhir/isik/v3/Dokumentenaustausch/StructureDefinition/ISiKDokumentenMetadaten",
  "version": "3.0.0",
  "name": "ISiKDokumentenMetadaten",
  "title": "Erforderliche Metadaten für Dokumentenaustausch in ISiK",
  "status": "active",
  "publisher": "gematik GmbH",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "fhircomposition",
      "uri": "http://hl7.org/fhir/composition",
      "name": "FHIR Composition"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "xds",
      "uri": "http://ihe.net/xds",
      "name": "XDS metadata equivalent"
    },
    {
      "identity": "CompositionDocumentReferenceMapping",
      "uri": "http://hl7.org/fhir/StructureDefinition/Composition",
      "name": "Metadaten eines strukturieren Dokumentes (Document-Bundle)"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference.masterIdentifier",
        "path": "DocumentReference.masterIdentifier",
        "short": "Versionsspezifische OID des Dokumentes",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Bundle.identifier"
          }
        ]
      },
      {
        "id": "DocumentReference.masterIdentifier.system",
        "path": "DocumentReference.masterIdentifier.system",
        "short": "Namensraum des Identifiers",
        "comment": "Fix: `urn:ietf:rfc:3986`",
        "min": 1,
        "patternUri": "urn:ietf:rfc:3986",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.masterIdentifier.value",
        "path": "DocumentReference.masterIdentifier.value",
        "short": "Wert des Identifiers",
        "comment": "OID mit URI-Präfix &quot;urn:oid:&quot;",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "comment": "Abweichend zu MHD V4.0.1 ist die Angabe eines Identifiers in ISiK nicht erforderlich.\nEin solcher kann bei Bedarf (z.B. zur Weitergabe des Dokumentes per XDS) erzeugt werden.\n&#13;[Konsens der Arbeitsgruppe vom 12.11.2021]\n\nUpdate für Stufe 3:\nIn MHD 4.2.0 wurde die Verpflichtung zur Angabe eines Identifiers gelockert, das ISiK-Profil ist damit in diesem Punkt wieder kompatibel zu IHE MHD.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.identifier"
          }
        ]
      },
      {
        "id": "DocumentReference.status",
        "path": "DocumentReference.status",
        "short": "Status des Dokumentenmetadatensatzes",
        "comment": "Der Status des Dokumentes wird in DocumentReference.docStatus gesetzt!",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "=current"
          }
        ]
      },
      {
        "id": "DocumentReference.docStatus",
        "path": "DocumentReference.docStatus",
        "short": "Bearbeitungsstatus des Dokumentes",
        "comment": "Abweichend zu MHD V4.0.1 ist die Verwendung von docStatus im ISiK-Kontext erlaubt. Doe Verwendung von docStatus bleibt jedoch optional,\n  da nicht alle Dokumentenerzeugende Systeme einen expliziten Freigabe-Workflow haben. Dokumentenserver müssen jedoch in der Lage sein, den Dokumentenstatus\n (sofern vorhanden) zu persistieren, anzuzeigen und zu reproduzieren.\n  &#13;[Konsens der Arbeitsgruppe vom 10.12.2021]",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.status"
          }
        ]
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "short": "Dokumententyp",
        "comment": "Im ISiK-Kontext ist die Typisierung eines Dokumentes mit Hilfe eines KDL-Codes *und* des IHE-XDS-Type-Codes erforderlich und ein Server MUSS beide Kodierungen bereitstellen - trotz der Kardinalität DocumentReference.type.coding:XDS 0..1 -, jedoch ist der IHE-XDS-Type-Code bei Übermittlung für Clients nicht verpflichtend (s.u. zu XDS).\n  Während KDL-Codes eine feingranulare Dokumentenklassifikation für die gezielte Suche nach medizinischen und Administrativen Dokumenten ermöglichen,\n  sind IHE-XDS-Type-Codes für den einrichtungsübergreifenden Dokumentenaustausch maßgeblich.\n  Der XDS-Type-Code kann mit Hilfe der bereitgestellten [ConceptMaps](https://simplifier.net/kdl/~resources?category=ConceptMap)\n  aus dem KDL-Code ermittelt werden. Weitere Typisierungen (z.B. nach SNOMED oder LOINC) sind uneingeschränkt erlaubt.\n\n  [Konsens der Arbeitgruppe vom 18.02.2022]",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type.coding",
        "path": "DocumentReference.type.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "DocumentReference.type.coding:KDL",
        "path": "DocumentReference.type.coding",
        "sliceName": "KDL",
        "short": "Dokumenttyp gem. KDL-Terminologie",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://dvmd.de/fhir/ValueSet/kdl"
        },
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.type.coding[KDL]"
          }
        ]
      },
      {
        "id": "DocumentReference.type.coding:KDL.system",
        "path": "DocumentReference.type.coding.system",
        "short": "Kodiersystem",
        "comment": "Fix: &quot;http://dvmd.de/fhir/CodeSystem/kdl&quot;",
        "min": 1,
        "patternUri": "http://dvmd.de/fhir/CodeSystem/kdl",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type.coding:KDL.code",
        "path": "DocumentReference.type.coding.code",
        "short": "Code",
        "comment": "Der KDL-Code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type.coding:KDL.display",
        "path": "DocumentReference.type.coding.display",
        "short": "Anzeigetext",
        "comment": "Der Anzeigetext zum KDL-Code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type.coding:XDS",
        "path": "DocumentReference.type.coding",
        "sliceName": "XDS",
        "short": "Dokumenttyp gem. IHE-De-Terminologie",
        "comment": "Die Übermittlung des XDS-Type-Codes ist im Rahmen der Dokumentenbereitstellung für Clients nicht verpflichtend,\n  MUSS jedoch vom Server bei der Entgegennahme ggf. ergänzt und bei der Dokumentenabfrage zurückgegeben werden. Der XDS-Type-Code kann über die im Rahmen der [KDL-Spezifikation](https://simplifier.net/kdl) publizierten\n  [ConceptMaps](https://simplifier.net/kdl/~resources?category=ConceptMap) aus dem KDL-Code ermittelt werden",
        "min": 0,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDStypeCode"
        },
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.type.coding[XDS]",
            "comment": "Kann mittels Lookup in den KDL->XDS ConceptMaps anhand des KDL-Type-Codes ermittelt werden"
          }
        ]
      },
      {
        "id": "DocumentReference.category",
        "path": "DocumentReference.category",
        "short": "Dokumentklasse/-Kategorie",
        "comment": "Die Kategorisierung von Dokumenten erfolgt mittels der von IHE Deutschland publizierten XDS-Class-Codes.\n  Die übermittlung des XDS-Class-Codes ist im Rahmen der Dokumentenbereitstellung für Clients nicht verpflichtend,\n  muss jedoch vom Server bei der Entgegennahme ggf. ergänzt und bei der Dokumentenabfrage zurückgegeben werden.\n  Der XDS-Class-Code kann mit Hilfe der bereitgestellten [ConceptMap](https://simplifier.net/kdl/~resources?category=ConceptMap)\n  aus dem KDL-Code ermittelt werden.",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.category.coding",
        "path": "DocumentReference.category.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "DocumentReference.category.coding:XDS",
        "path": "DocumentReference.category.coding",
        "sliceName": "XDS",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDSclassCode"
        },
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.category.coding[XDS]",
            "comment": "Kann mittels Lookup in den KDL->XDS ConceptMaps anhand des KDL-Type-Codes ermittelt werden"
          }
        ]
      },
      {
        "id": "DocumentReference.category.coding:XDS.system",
        "path": "DocumentReference.category.coding.system",
        "short": "Kodiersystem",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.category.coding:XDS.code",
        "path": "DocumentReference.category.coding.code",
        "short": "Code",
        "comment": "Der XDS-Class-Code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.category.coding:XDS.display",
        "path": "DocumentReference.category.coding.display",
        "short": "Anzeigetext",
        "comment": "Der Anzeigetext zum XDS-Class-Code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "short": "Patientenbezug des Dokumentes",
        "comment": "Siehe Beschreibung in der [FHIR Kernspezifikation](http://hl7.org/fhir/documentreference-definitions.html#DocumentReference.subject)",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Lookup Composition.subject.resolve().identifier[PID]",
            "comment": "Ermittlung des korrekten Patienten auf dem Server anhand des Identifiers (PID) und/oder weiterer Kriterien erforderlich"
          }
        ]
      },
      {
        "id": "DocumentReference.subject.reference",
        "path": "DocumentReference.subject.reference",
        "short": "Absolute oder relative URL des Patienten auf dem Server",
        "comment": "Absolute oder relative URL des Patienten auf dem Server",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.date",
        "path": "DocumentReference.date",
        "comment": "Abweichend zu MHD V4.0.1 ist die Verwendung von date im ISiK-Kontext nicht verpflichtend.\nDie Motivation für die verbindliche Verwendung von `date` seitens IHE ist nicht nachvollziehbar.\nEin entsprechender Change Request zur Harmonisierung wurde eingereicht. Das Dokumentendatum wird in attachment.creation gesetzt.\n\nUpdate für Stufe 3:\nIn MHD 4.2.0 wurde die Verpflichtung zur Angabe von date gelockert, das ISiK-Profil ist damit in diesem Punkt wieder kompatibel zu IHE MHD."
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "short": "Autor des Dokumentes",
        "comment": "In dieser Ausbaustufe ist die Nennung des Namens oder Kürzels des Autors ausreichend.\n  Eine darüber hinaus gehende Verlinkung auf einen Pracitioner (auflösbar auf dem Server) ist möglich aber nicht erforderlich.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.author"
          }
        ]
      },
      {
        "id": "DocumentReference.author.display",
        "path": "DocumentReference.author.display",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.custodian",
        "path": "DocumentReference.custodian",
        "comment": "Einschränkung der Kardinalität analog MHD V4.0.1",
        "max": "0"
      },
      {
        "id": "DocumentReference.relatesTo",
        "path": "DocumentReference.relatesTo",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.relatesTo.code",
        "path": "DocumentReference.relatesTo.code",
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.relatesTo.code"
          }
        ]
      },
      {
        "id": "DocumentReference.relatesTo.target",
        "path": "DocumentReference.relatesTo.target",
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Lookup Composition.relatesTo.targetReference.resolve().identifier",
            "comment": "Ermittlung der zu ersetzenden DocumentReference anhand des identifiers der referenzierten Composition erforderlich"
          }
        ]
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "comment": "Genaue menschenlesbare Beschreibung des Dokumentes, z.B. &quot;Lungenfunktionstest vom 18.02.2022&quot;",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.title"
          }
        ]
      },
      {
        "id": "DocumentReference.securityLabel",
        "path": "DocumentReference.securityLabel",
        "short": "Vertraulichkeit",
        "comment": "Die Bereitstellung des Vertraulichkeitsinformation durch den Ersteller des Dokumentes ist verpflichtend.\nEbenso sind Dokumentenserver verpflichtet, diese Information zu persistieren und bei der Dokumentenabfrage zu reproduzieren.\nDie ISiK-Spezifikation trifft jedoch keine Annahmen darüber, wie sich einzelne Vertraulichkeitsstufen auf die Zugriffsberechtigungen\nverschiedener benutzer auf ein Dokument auswirken. Im ISiK-Kontext ist die Angabe einer der drei Vertraulichkeitsstufen\nN | R | V verpflichtend, jedoch ohne Einschränkung der Verwendung zusätzlicher Vertraulichkeits-Flags.\n&#13;\n\n[Konsens der Arbeitsgruppe vom 12.11.2021]",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://gematik.de/fhir/isik/v3/Dokumentenaustausch/ValueSet/ISiKConfidentialityCodes"
        }
      },
      {
        "id": "DocumentReference.content",
        "path": "DocumentReference.content",
        "short": "Beschreibung des Dokumenteninhaltes",
        "comment": "Die Kardinalität wurde angepasst, um den Vorgaben von IHE MHD zu ensprechen [Änderung im Zuge der Kommentierung Stufe 3].",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment",
        "path": "DocumentReference.content.attachment",
        "short": "Anhang",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment.contentType",
        "path": "DocumentReference.content.attachment.contentType",
        "short": "Mimetype des Dokumentes",
        "comment": "Mimetype (Dateityp) des Dokumentes (z.B. &quot;application/pdf&quot;)",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "`application/html` für den extrahierten Narrative, `application/fhir+xml` oder `application/fhir+json` für das Bundle"
          }
        ]
      },
      {
        "id": "DocumentReference.content.attachment.language",
        "path": "DocumentReference.content.attachment.language",
        "short": "Sprache, in der das Dokument verfasst wurde.",
        "comment": "Kann bei Systemen, die keine Mehrsprachigkeit unterstützen,\n      fest auf &quot;de&quot; oder &quot;de-DE&quot; gesetzt werden.",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "=de sofern keine abweichende Angabe in Composition.language"
          }
        ]
      },
      {
        "id": "DocumentReference.content.attachment.data",
        "path": "DocumentReference.content.attachment.data",
        "short": "Base64-codierte Binärdaten",
        "comment": "Um die Suche nach Dokumenten effizient zu gestalten, dürfen die Dokumente selbst nicht in die DocumentReference eingebettet werden, \n      sondern müssen als separates Datenobjekt referenziert werden. \n      \nUpdate für Stufe 3:\nDie Ausnahme bildet die Interaktion &quot;Dokumentenbereitstellung&quot;, \nbei der die Binärdaten des Dokumentes eingebettet in die DocumentReference an den Server übermittelt und dort dann in eine separate \nRessource ausgelagert und über Attachment.url referenziert werden.",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment.url",
        "path": "DocumentReference.content.attachment.url",
        "short": "Referenz auf Dokument",
        "comment": "Um die Suche nach Dokumenten effizient zu gestalten, dürfen die Dokumente selbst nicht in die DocumentReference eingebettet werden, \n      sondern müssen als separates Datenobjekt referenziert werden. \n      \nUpdate für Stufe 3:\nDie Ausnahme bildet die Interaktion &quot;Dokumentenbereitstellung&quot;, \nbei der die Binärdaten des Dokumentes eingebettet in die DocumentReference an den Server übermittelt und dort dann in eine separate \nRessource ausgelagert und über Attachment.url referenziert werden.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "vom Server festgelegter Speicherort des Bundles/Narratives"
          }
        ]
      },
      {
        "id": "DocumentReference.content.attachment.creation",
        "path": "DocumentReference.content.attachment.creation",
        "short": "Dokumentendatum",
        "comment": "Es obliegt dem erzeugenden System, zu entscheiden,\n      welches Datum als Dokumentendatum geeignet ist, z.B. Datum der Erstellung oder Datum der letzten Änderung",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Composition.date"
          }
        ]
      },
      {
        "id": "DocumentReference.content.format",
        "path": "DocumentReference.content.format",
        "short": "Format des Dokumentes",
        "comment": "Sofern das Dokument nicht auf einem standardisierten,\n    strukturierten Austauschformat (z.B. CDA) basiert, für dessen Interpretation ein konkretes Schema herangezogen werden muss,\n    genügt die Angabe des Codes\n    &quot;urn:ihe:iti:xds:2017:mimeTypeSufficient&quot;",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDSformatCodeDE"
        },
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "=urn:ihe:iti:xds:2017:mimeTypeSufficient"
          }
        ]
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.encounter",
        "path": "DocumentReference.context.encounter",
        "comment": "Abweichend zu MHD V4.0.1 ist die Verwendung der Encounter-Referenz im ISiK-Kontext erlaubt.\nUpdate für Stufe 3: \nIn MHD 4.2.0 wurde das Verbot der Angabe einer Encounter-Referenz gelockert, das ISiK-Profil ist damit in diesem Punkt wieder kompatibel zu IHE MHD.",
        "max": "1",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "Lookup Composition.encounter.resolve().identifier",
            "comment": "Ermittlung des korrekten Encounters auf dem Server anhand des Identifiers(Fallnummer) und/oder weiterer Kriterien erforderlich"
          }
        ]
      },
      {
        "id": "DocumentReference.context.event",
        "path": "DocumentReference.context.event",
        "comment": "Binding auf IHE-DE Terminologie hinzugefügt",
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDSeventCodeList"
        }
      },
      {
        "id": "DocumentReference.context.event.coding",
        "path": "DocumentReference.context.event.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "DocumentReference.context.event.coding.system",
        "path": "DocumentReference.context.event.coding.system",
        "min": 1
      },
      {
        "id": "DocumentReference.context.event.coding.code",
        "path": "DocumentReference.context.event.coding.code",
        "min": 1
      },
      {
        "id": "DocumentReference.context.facilityType",
        "path": "DocumentReference.context.facilityType",
        "short": "Art der Einrichtung, aus der das Dokument stammt",
        "comment": "Kann, sofern keine abweichende Information bekannt ist auf &quot;KHS&quot; gesetzt werden.",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDShealthcareFacilityTypeCode"
        },
        "mapping": [
          {
            "identity": "CompositionDocumentReferenceMapping",
            "map": "=KHS, sofern nichts anderes bekannt"
          }
        ]
      },
      {
        "id": "DocumentReference.context.practiceSetting",
        "path": "DocumentReference.context.practiceSetting",
        "comment": "Binding auf IHE-DE Terminologie hinzugefügt",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ihe-d.de/ValueSets/IHEXDSpracticeSettingCode"
        }
      }
    ]
  }
}