{
  "resourceType": "StructureDefinition",
  "id": "profile-Bundle-history",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Bundle-history",
  "name": "BundleQuery",
  "title": "Bundle Query",
  "status": "active",
  "experimental": false,
  "description": "Bundle used for history responses",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": true,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle.id",
        "path": "Bundle.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "patternCode": "history",
        "mustSupport": true
      },
      {
        "id": "Bundle.timestamp",
        "path": "Bundle.timestamp",
        "mustSupport": true
      },
      {
        "id": "Bundle.total",
        "path": "Bundle.total",
        "mustSupport": true
      },
      {
        "id": "Bundle.link",
        "path": "Bundle.link",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "relation"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.link:self",
        "path": "Bundle.link",
        "sliceName": "self",
        "comment": "Echoes the submitted rquest, including only those parameters which were processed by the server.  This allows for the possibility that the server might not support all of the parameters submitted by the client.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Bundle.link:self.relation",
        "path": "Bundle.link.relation",
        "patternCode": "self",
        "mustSupport": true
      },
      {
        "id": "Bundle.link:self.url",
        "path": "Bundle.link.url",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.resource",
        "path": "Bundle.entry.resource",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry.request",
        "path": "Bundle.entry.request",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.request.method",
        "path": "Bundle.entry.request.method",
        "comment": "This will be 'CREATE' for the first entry and 'UPDATE' for subsequent entries",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.request.url",
        "path": "Bundle.entry.request.url",
        "comment": "This will be [base]/Patient for create and [base]/Patient/[odbNum]/$updateRecipient or [base]/Patient/[odbNum]/$inactivateRecipient for others (based on whether the inactivateUserId is present).",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response",
        "path": "Bundle.entry.response",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response.status",
        "path": "Bundle.entry.response.status",
        "comment": "This will be 201 for the create and 200 for others",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response.etag",
        "path": "Bundle.entry.response.etag",
        "comment": "This will be the same as the Patient.meta.version",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response.lastModified",
        "path": "Bundle.entry.response.lastModified",
        "comment": "This will be the same as the Patient.meta.lastUpdated",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}