Sending a file

Last updated: Jan 19, 2024

Some data just isn’t complete without a file or two for context. With Redox, you can send files to a connection’s EHR system or any other type of integrated system.

Types of files

You can send any valid file type via API to an integrated system. Typically, you may send a file to save it to a patient’s record. For security reasons, we recommend not sending executable or archived files since they may contain exploitable vectors that could corrupt the integrated system. Before delivering the request, we use content-inspecting firewalls, which may reject suspicious payloads.

Data models and resources to use

Using the Redox FHIR® API, you can use the DocumentReference resource to send a generic file. If you're sending a results or vitals document, you can send it as a FHIR® Attachment in the DiagnosticReport or Observation resources.

Using the Redox Data Model API, you can use the Media, Notes, or Results requests to send a file.

Methods for sending a file

There are two methods for sending a file through any of the requests above: (a) embedding a file directly in the request, or (b) uploading and referencing a file in the request. The method for sending depends on the expected file size:

  • Files up to 10 MB can be embedded directly into a request. As a best practice, though, we recommend not embedding files over 200 KB.
  • (Recommended) Files up to 30 MB can be uploaded, then referenced in a request.

Uploading and referencing a file

For optimal performance, we recommend uploading a file via an HTTP request to Redox, then referring to the file in a request to your connection’s EHR system. We encode the file for you as a base64 encoded string before sending it to the intended recipient. Go with this option if you plan to send files regularly, especially large files.

To use this method, you must upload a file from a staging or production environment. You can check that a file successfully uploaded in the related log in the Logs tab of the Redox dashboard.

Embedding a file

If you plan to only send a small file occasionally, you can embed the file directly into the request instead. For optimal performance, we recommend embedding only small files, maybe up to 200 KB in size, even though the technical limit is 10 MB. Just know that if you choose this method, you must encode the file as a base64 encoded string yourself before sending the request.

How to…

Check out our how-tos for embedding or uploading files: