API Reference

Overview

A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.

There are situations where it is useful or required to handle pure binary content using the same framework as other resources. Typically, this is when the binary content is referred to from other FHIR Resources. For instance, DocumentReference A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.

The Binary resource does not convey context of the file. If the context (information such as author, procedure, technique, etc.) should be conveyed, Media or DocumentReference resources are appropriate. The Binary resource may be used to convey actual binary file content conveyed by those resources.

Security Considerations:

Binary resources are not constrained to any list of safe content types (content types without active elements such as scripting or executable code), and therefore can be of any content type and encoding. Therefore, extra care needs to be taken to validate the content of the Binary resource against malicious or malformed content. For more details see Security of Narrative, since the security issues are similar.

Binary By Id

Get Binary by ID.

METHOD GET

[base url]/Binary/[id]

or

[base url]/Binary?_id=[id]

PARAMS
[base url] - FHIR base url
[id] - Id for Binary resource

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Go to Authentication and Authorization for further details.

HeaderTypeRequired/OptionalValue
Authorizationstringrequired'Bearer'

RESPONSES

CodeDescriptionComment
200OKThe request was processed successfully
400Bad requestInvalid request parameters or FHIR operation outcome resource returned
401UnauthorizedThis code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404no Route matched with those valuesThe request was able to communicate with a given server, but the server could not find what was requested
500Internal Server ErrorThe server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Binary/a12b7cf5-1237-a31b-a31c-b1a3ba1fa0b2' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'