{
  "resourceType": "StructureDefinition",
  "id": "observation-de-ekg",
  "url": "http://fhir.de/StructureDefinition/observation-de-ekg",
  "version": "1.6.0-ballot",
  "name": "EkgDE",
  "title": "EKG Observation Profil",
  "status": "active",
  "experimental": false,
  "date": "2025-12-23",
  "publisher": "HL7 Deutschland e.V. (Technisches Komitee FHIR)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.de/technische-komitees/fhir/"
        }
      ]
    }
  ],
  "description": "EKG Observation Profil",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "min": 1
      },
      {
        "id": "Observation.category.coding",
        "path": "Observation.category.coding",
        "patternCoding": {
          "code": "procedure",
          "system": "http://terminology.hl7.org/CodeSystem/observation-category"
        }
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.code.coding.system",
        "path": "Observation.code.coding.system",
        "min": 1
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "min": 1
      },
      {
        "id": "Observation.code.coding:loinc",
        "path": "Observation.code.coding",
        "sliceName": "loinc",
        "min": 1,
        "max": "1",
        "patternCoding": {
          "code": "11524-6",
          "system": "http://loinc.org"
        }
      },
      {
        "id": "Observation.code.coding:snomed",
        "path": "Observation.code.coding",
        "sliceName": "snomed",
        "min": 0,
        "max": "*",
        "patternCoding": {
          "code": "106073009",
          "system": "http://snomed.info/sct"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "constraint": [
          {
            "key": "vs-de-1",
            "severity": "error",
            "human": "If Observation.effective[x] has a value then that value shall be precise to the day",
            "expression": "(($this is dateTime) implies ($this as dateTime).toString().length() >= 10) and ($this.start.exists() implies ($this.start as dateTime).toString().length() >= 10) and ($this.end.exists() implies ($this.end as dateTime).toString().length() >= 10)",
            "source": "http://fhir.de/StructureDefinition/observation-de-ekg"
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "max": "0"
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "code"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.component:ekgLeads",
        "path": "Observation.component",
        "sliceName": "ekgLeads",
        "short": "12 Kanal EKG Ableitungen",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.component:ekgLeads.code",
        "path": "Observation.component.code",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.de/ValueSet/EkgAbleitungenVS",
          "description": "Loinc Part Codes identifying the EKG lead"
        }
      },
      {
        "id": "Observation.component:ekgLeads.code.coding",
        "path": "Observation.component.code.coding",
        "min": 1
      },
      {
        "id": "Observation.component:ekgLeads.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "SampledData"
          }
        ]
      },
      {
        "id": "Observation.component:ekgLeads.value[x].data",
        "path": "Observation.component.value[x].data",
        "min": 1
      },
      {
        "id": "Observation.component:deprecatedLeadCodes",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "deprecated"
          }
        ],
        "path": "Observation.component",
        "sliceName": "deprecatedLeadCodes",
        "comment": "Diese deprecated Slice verwendet Loinc Part Codes die nicht für die Nutzung in Instanzdaten vorgesehen sind",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Observation.component:deprecatedLeadCodes.code",
        "path": "Observation.component.code",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.de/ValueSet/EkgLeads",
          "description": "Loinc Part Codes identifying the EKG lead"
        }
      },
      {
        "id": "Observation.component:deprecatedLeadCodes.code.coding",
        "path": "Observation.component.code.coding",
        "min": 1
      },
      {
        "id": "Observation.component:deprecatedLeadCodes.value[x]",
        "path": "Observation.component.value[x]",
        "min": 1,
        "type": [
          {
            "code": "SampledData"
          }
        ]
      },
      {
        "id": "Observation.component:deprecatedLeadCodes.value[x].data",
        "path": "Observation.component.value[x].data",
        "min": 1
      }
    ]
  }
}