Binary Access Operations

In many cases, resources such as DocumentReference are used to store large files such as scanned PDFs and images. These resources use the Attachment datatype, which ultimately stores a content type and a base 64 encoded representation of the binary content.

To deal with these binary content, HDR FHIR provides two custom FHIR operations that can be used to interact directly with binary content contained within resources such as DocumentReference. These operations can be used both to write and read back binary content.

These operations can be enabled/disabled using the binary_storage_enabled property. If this property is enable, the plain Binary Access Provider class can be registered with the server to provide the $binary-access-read and $binary-access-write operations that can be used to access attachment data as a raw binary.