{
  "resourceType": "StructureDefinition",
  "url": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Bundle-ForSearchResponse",
  "name": "Bundle-ForSearchResponse",
  "status": "draft",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "fixedCode": "searchset",
        "mustSupport": true
      },
      {
        "id": "Bundle.total",
        "path": "Bundle.total",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "search.mode"
            }
          ],
          "rules": "closed"
        }
      },
      {
        "id": "Bundle.entry.resource",
        "path": "Bundle.entry.resource",
        "min": 1
      },
      {
        "id": "Bundle.entry.search",
        "path": "Bundle.entry.search",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.search.mode",
        "path": "Bundle.entry.search.mode",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response.etag",
        "path": "Bundle.entry.response.etag",
        "requirements": "Accroding to FHIR documentation, bundle.entry.response.meta.versionId shall be used for bundles containing resource instances, isntead of etag."
      },
      {
        "id": "Bundle.entry:resourceMatchingSearchCriteria",
        "path": "Bundle.entry",
        "sliceName": "resourceMatchingSearchCriteria"
      },
      {
        "id": "Bundle.entry:resourceMatchingSearchCriteria.resource",
        "path": "Bundle.entry.resource",
        "min": 1
      },
      {
        "id": "Bundle.entry:resourceMatchingSearchCriteria.search",
        "path": "Bundle.entry.search",
        "min": 1
      },
      {
        "id": "Bundle.entry:resourceMatchingSearchCriteria.search.mode",
        "path": "Bundle.entry.search.mode",
        "min": 1,
        "fixedCode": "match"
      },
      {
        "id": "Bundle.entry:resourceIncludedByElements",
        "path": "Bundle.entry",
        "sliceName": "resourceIncludedByElements"
      },
      {
        "id": "Bundle.entry:resourceIncludedByElements.resource",
        "path": "Bundle.entry.resource",
        "min": 1
      },
      {
        "id": "Bundle.entry:resourceIncludedByElements.search",
        "path": "Bundle.entry.search",
        "min": 1
      },
      {
        "id": "Bundle.entry:resourceIncludedByElements.search.mode",
        "path": "Bundle.entry.search.mode",
        "min": 1,
        "fixedCode": "include"
      }
    ]
  }
}