{
  "resourceType": "StructureDefinition",
  "id": "bundle-ca-ps",
  "url": "http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/bundle-ca-ps",
  "name": "BundlePSCA",
  "title": "Bundle (PS-CA)",
  "status": "draft",
  "experimental": false,
  "date": "2022-01-17T09:23:00+00:00",
  "description": "This profile represents the constraints applied to the Bundle resource by the PS-CA project.",
  "copyright": "Copyright © 2021,2022 Canada Health Infoway. All rights reserved. [Terms of Use and License Agreements](https://ic.infoway-inforoute.ca/en/about/tou). [Privacy Policy](https://www.infoway-inforoute.ca/en/legal/privacy-policy).",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle",
        "path": "Bundle",
        "short": "PS-CA Bundle",
        "definition": "PS-CA Bundle. \r\nA container for a collection of resources in the patient summary.",
        "constraint": [
          {
            "key": "bdl-ps-1",
            "severity": "error",
            "human": "A PS document must have no additional Composition (including Composition subclass) resources besides the first",
            "expression": "entry.tail().where(resource is Composition).empty()"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Bundle.identifier",
        "path": "Bundle.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "fixedCode": "document",
        "mustSupport": true
      },
      {
        "id": "Bundle.timestamp",
        "path": "Bundle.timestamp",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.link",
        "path": "Bundle.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "resource"
            }
          ],
          "rules": "open"
        },
        "short": "Entry resource in the patient summary bundle",
        "definition": "An entry resource included in the patient summary bundle resource.",
        "comment": "Must contain at a minimum the PS-CA Composition as the first entry (only a single Composition resource may be included). Additional constraints that determine what is included in the bundle are specified in the PS-CA Composition profile.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry.request",
        "path": "Bundle.entry.request",
        "max": "0"
      },
      {
        "id": "Bundle.entry.response",
        "path": "Bundle.entry.response",
        "max": "0"
      },
      {
        "id": "Bundle.entry:composition",
        "path": "Bundle.entry",
        "sliceName": "composition",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:composition.resource",
        "path": "Bundle.entry.resource",
        "min": 1,
        "type": [
          {
            "code": "Composition",
            "profile": [
              "http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/composition-ca-ps"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}