Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase maximum string length #138

Closed
t4deon opened this issue Nov 29, 2023 · 1 comment · Fixed by #143 or #157
Closed

Increase maximum string length #138

t4deon opened this issue Nov 29, 2023 · 1 comment · Fixed by #143 or #157
Assignees
Labels
bug Something isn't working ready for release Issue is fixed and merged into develop, ready for next release
Milestone

Comments

@t4deon
Copy link

t4deon commented Nov 29, 2023

We use the DSF with great success. However, we run into issues when posting large Binary resources onto the FHIR server.

fhirserver-1  | WARN jetty-server-2986 - DataFormatExceptionHandler.toResponse(40) | Error while parsing resource: Failed to parse JSON encoded FHIR content: String length (20045301) exceeds the maximum length (20000000), returning OperationOutcome with status 403 Forbidden

Is there any way to increase the maximum string length on the server side or any viable workaround that still uses the DSF?

Our particular setup is:

  1. Sender: Post a Bundle with a Task and Binary resource onto the FHIR server. The Binary resource is referenced as a Task input.
  2. Receiver: Download the referenced Binary from the sender's server.

The used Binary has contentType = application/json if that matters.

Thanks.

Used DSF version for all components: 1.3.1

@hhund
Copy link
Member

hhund commented Nov 29, 2023

Hi @t4deon,

the max length parsing error is generated by the HAPI JSON parser and is likely the same issue as described in hapifhir/hapi-fhir#5205. The issue was fixed with HAPI 6.8.2. Due to problems with the validation of Task resources in HAPI versions after 5.1.0, we haven't been able to upgrade, but also haven't tried recently.

Until we upgrade our HAPI dependency, possible workarounds could be:

  • Sending the transaction Bundle as XML Content-Type: application/fhir+xml.
  • Creating the Binary and Task resources independently and Uploading the binary data directly without the JSON or XML Binary resource wrapper using for example Content-Type: application/dicom. See notes on uploading/downloading binary resources directly and the usage of the X-Security-Context header at https://www.hl7.org/fhir/R4/binary.html#rest

We do store the FHIR resources as JSON in our PostgreSQL database. But since the actual content of the binary resource is stored separately in a BYTEA column, I currently don't think that the max length error should reappear between the app and database.

@hhund hhund added the bug Something isn't working label Nov 29, 2023
@hhund hhund added this to the 1.4.0 milestone Nov 29, 2023
@schwzr schwzr linked a pull request Dec 2, 2023 that will close this issue
@hhund hhund linked a pull request Dec 9, 2023 that will close this issue
@hhund hhund added the ready for release Issue is fixed and merged into develop, ready for next release label Dec 9, 2023
@hhund hhund mentioned this issue Dec 18, 2023
@hhund hhund closed this as completed in 694da4e Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for release Issue is fixed and merged into develop, ready for next release
Projects
None yet
3 participants