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

Binary resources should be encoded if necessary #232

Closed
AnalogJ opened this issue Aug 16, 2023 · 0 comments · Fixed by #235
Closed

Binary resources should be encoded if necessary #232

AnalogJ opened this issue Aug 16, 2023 · 0 comments · Fixed by #235

Comments

@AnalogJ
Copy link
Member

AnalogJ commented Aug 16, 2023

Certain providers will return RAW PDF's and other binary data formats, rather than encoding them as json.

When the response content-type is non-json, or application/fhir+json or application/json+fhir, we should correctly base64 encode the data, and store it in the DB.

eg.

https://fhir.nextgen.com/nge/prod/fhir-api-r4/fhir/R4/document/pdf-8f586c49-958c-439f-aa85-4a19017d1e64

http://localhost:9090/api/unsafe/testuser1/fef3ebbe-0710-4650-8b05-d6106e012d18/document/pdf-8f586c49-958c-439f-aa85-4a19017d1e64

Request: GET /nge/prod/fhir-api-r4/fhir/r4/document/pdf-8f586c49-958c-439f-aa85-4a19017d1e64 HTTP/1.1
Host: fhir.nextgen.com
Accept: application/json+fhir
  type=web

Response: HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=86400
Api-Version: 5.0.1.121
Cache-Control: no-store
Content-Disposition: attachment; filename=8f586c49-958c-439f-aa85-4a19017d1e64.pdf; filename*=UTF-8''8f586c49-958c-439f-aa85-4a19017d1e64.pdf
Content-Type: application/pdf
Date: Wed, 16 Aug 2023 22:27:54 GMT
Server: CloudFront

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant