Stream: implementers
Topic: Max bundle size?
Dave Hill (Sep 18 2020 at 10:47):
Is there a maximum number of entries in a bundle? I don't see a limit in the Bundle resource specification, but I get this message from a Vonk server:
Response Body: {
"resourceType": "OperationOutcome",
"id": "4837048c-7915-4d68-a4dc-db6dd4c3ab3e",
"meta": {
"versionId": "c7a228fb-1b41-4610-86fd-472c807baaf3",
"lastUpdated": "2020-09-18T10:15:43.351+00:00"
},
"issue": [
{
"severity": "error",
"code": "exception",
"details": {
"coding": [
{
"system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
"code": "5006"
}
],
"text": "Too many entries in bundle. Max supported number of entries is 500"
}
}
]
}
The HAPI server I'm testing with doesn't complain about this.
Anyone else run into this?
Thanks!
Grahame Grieve (Sep 18 2020 at 11:06):
there's no theortical limit to the size of a bundle, but servers are allowed - and pretty much have to - put some limit on to protect themselve s
Dave Hill (Sep 18 2020 at 16:19):
Thanks @Grahame Grieve ,
In post-acute care, some of the assessments are quite large, which results in a lengthy SDCQuestionnaireResponse. When I convert that SDCQuestionnaireResponse into Observations for querying and storage, it results in over 500 observations. There is another Observation-based resource that references these individual observations, so I am writing the whole thing as a transaction so that referential integrity is preserved in the destination system.
If there is a better approach, that would be great. I agree that servers may have to have a limit - is 500 a suitable limit?
Thanks!
Alexander Kiel (Sep 18 2020 at 16:33):
@Dave Hill Have you checked whether you can configure that limit?
Dave Hill (Sep 18 2020 at 16:37):
@Alexander Kiel Thanks, I will check with the owner of the server. I don't have direct access to that aspect of the server. Anyone know if the Vonk server has that option?
Dave Hill (Sep 18 2020 at 16:44):
Looks like there is a setting in Vonk to do set the maximum size of an incoming bundle - http://docs.simplifier.net/vonk/configuration/appsettings.html#protect-against-large-input
Alexander Kiel (Sep 18 2020 at 16:52):
@Dave Hill Looks good.
Paul Church (Sep 18 2020 at 17:01):
Might be a useful value to put in the capability statement? There are different dimensions along which the limits can be set, similar to the Vonk config. The Google server is configured with a 50MiB bundle limit, 4500 entries in a transaction, no limit in a batch (whatever you can fit into 50MiB and doesn't take so long that it hits the API timeout).
Yunwei Wang (Sep 19 2020 at 16:56):
I am more interested in where the codesystem "http://hl7.org/fhir/dotnet-api-operation-outcome" is defined. @Ward Weistra
Ward Weistra (Sep 19 2020 at 17:21):
Great question @Yunwei Wang, no hits: http://registry.fhir.org/results?query=%22http%3A%2F%2Fhl7.org%2Ffhir%2Fdotnet-api-operation-outcome%22&latestFilter=true :smile:
Btw, I suspect it's a performance based choice to not allow bundles to get too large.
@Christiaan Knaap @Mirjam Baltus Is this max bundle size configurable? And should http://hl7.org/fhir/dotnet-api-operation-outcome have a definition somewhere?
Alexander Zautke (Sep 21 2020 at 19:27):
@Ward Weistra Correct, it's just a protection for the server. It's configurable by setting the SizeLimit option MaxBatchEntries. See http://docs.simplifier.net/vonk/configuration/appsettings.html#protect-against-large-input
I agree that it's a bit too low by default, especially if you are dealing with Observation resources as described.
Additionally, the is a limit for the max. size (in MB).
Alexander Zautke (Sep 21 2020 at 19:31):
Most of the codes from http://hl7.org/fhir/dotnet-api-operation-outcome can be found here https://github.com/FirelyTeam/fhir-net-api/blob/add8073b8d096f66cde13f54c940048ba4363e0a/src/Hl7.Fhir.Specification/Support/Issue.cs
Ward Weistra (Sep 21 2020 at 20:32):
A bit more human readable documentation for those codes is here: https://simplifier.net/docs/fhir-net-api/home
Ward Weistra (Sep 21 2020 at 20:33):
@Dave Hill :wait_one_second:️
Last updated: Apr 12 2022 at 19:14 UTC