{
  "resourceType": "StructureDefinition",
  "id": "AggregationTestProfile",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Foundation.Other"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "not-classified"
    }
  ],
  "url": "http://gefyra.de/fhir/gematik-test/StructureDefinition/AggregationTestProfile",
  "version": "0.1.0",
  "name": "AggregationTestProfile",
  "status": "active",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "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"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle",
        "path": "Bundle",
        "constraint": [
          {
            "key": "Alex",
            "severity": "warning",
            "human": "Alex sagt: Das Bundle ist unvollständig",
            "expression": "Bundle.entry.descendants().reference.distinct().all($this in %context.entry.fullUrl.select($this.toString().substring('http://example.org/fhir/'.length())))",
            "source": "http://gefyra.de/fhir/gematik-test/StructureDefinition/AggregationTestProfile"
          },
          {
            "key": "Simone",
            "severity": "warning",
            "human": "Simone sagt: Das Bundle ist unvollständig",
            "expression": "Bundle.entry.resource.descendants().reference.where($this.startsWith('#').not()).all((%resource.entry.fullUrl.join('|') + '|').contains($this + '|'))",
            "source": "http://gefyra.de/fhir/gematik-test/StructureDefinition/AggregationTestProfile"
          }
        ]
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "patternCode": "collection"
      }
    ]
  }
}