Send results or vitals to your connection(s) to provide clinical context for patients you share. This article describes how to save vitals or diagnostic results with the Redox FHIR® API. If you want to send generic files, learn how to send a file instead.
If you haven’t already, check out these high-level best practices:
With Redox, you can send files to your connection(s) with either of these two methods:
- Upload a file to a Redox blob endpoint, then include the URL reference (recommended).
- Embed a file directly in the selected data model.
| Upload and reference file | Embed file | |
|---|---|---|
| Best for | Regularly sending large files.This is our recommended method since it improves our ability to process the request without errors. | Occasionally sending small files. |
| File size limit | Up to 30 MB. The file limit is separate from the overall request limit. For example, if the request limit is 10 MB, the uploaded file doesn’t need to fit within that threshold. | Must fit within the request’s size limit. Check limits by traffic type. Best practice: We recommend not embedding files over 200 KB. |
| Encoding | base64. Redox handles encoding the file. | base64. You must encode the file yourself. |
| Environment type | For paid accounts, available in any environment. For free accounts, only available in staging or production. If you try to upload files in a development environment with a free account, we return a 403 Forbidden error. | Available in any environment. |
| Available file download in the Redox dashboard | Yes. | No. |
If you haven’t already, review general file sending info.
You can use either supported method for sending results and vitals information with these operations:
- DiagnosticReport$diagnosticreport-create: Use for diagnostic tests (e.g., lab tests, pathology, imaging).
- Observation$observation-create: Use for individual results, findings, or measurements (e.g., vitals, imaging results, lab results, device measurements).
- Decide which sending method to use (i.e., upload or embed a file).
- Decide which FHIR® operation to use ($diagnosticreport-create, $observation-create).
- For free accounts choosing to upload and reference a file, log in to either a staging or production environment. Uploading isn’t available in free development environments. Talk to your Technical Account Manager about upgrading if you want to upload files in development.
Our recommended method is to upload a file to the Redox endpoint using the FHIR® Binary resource. Then, refer to the file in either the DiagnosticReport or Observation resource.
- Locate the file you want to upload.
- Upload your file to the Redox upload endpoint using the FHIR® Binary resource.Support for the FHIR Binary resource
- Replace {{ENVIRONMENT-FLAG}} with Development, Staging, or Production.
- Replace $API_TOKEN with your access token.API token
- Add the Redox-source-Id header if you have more than one source in your environment. Learn about managing source details.
- Keep redox in the slug. That portion routes the request to the appropriate Redox upload endpoint.Example: Upload a file to Redox with the Binary resourcebash
- If the upload is successful, you receive a 201 Created status. The reference URL is in the location header of the Binary response.Example: Binary response with the reference URLjson
- Use the FHIR® operation you want for sending results or vitals ($diagnosticreport-create, $observation-create).
- Include the required Attachment fields with the URL reference to the file you already uploaded:
- In the url field, enter the URL reference from the Binary response.
- In the contentType field, enter a valid MIME type. Learn more about MIME types for files.
- (Optional) In the title field, enter the name of the file.Example: Reference an uploaded file in DiagnosticReport$diagnosticreport-createbashExample: Upload a referenced file in Observation$observation-createbash
- Populate the rest of the message as needed, then send to your connection’s EHR system.
- To check if the file uploaded successfully, log in to the Redox dashboard and check the log for the request. The uploaded file displays under the Process tab of the log.
You can embed a file in any FHIR® resource containing a FHIR® Attachment datatype. Learn more about FHIR® Attachment.
You can embed a PDF with results and vitals directly in the DiagnosticReport or Observation resources, so long as the file fits within the size limit for the type of traffic. Check limits by traffic type.
- Encode the file as a base64 encoded string.
- Authenticate an OAuth API key like you would for any FHIR® API request. Learn how to authenticate and initiate a request.
- Use the FHIR® operation you want for sending results or vitals ($diagnosticreport-create, $observation-create).
- Populate the required document fields to include the encoded file in your request:
- Replace {{ENVIRONMENT-FLAG}} with Development, Staging, or Production.
- Replace $API_TOKEN with your access token.
- Replace {{DESTINATION-SLUG}} with the human-readable safe name for the intended destination.
- Populate the entry.resource.presentedForm fields to include the encoded file:
- In the contentType field, enter a valid MIME type. Learn more about MIME types for files.
- In the data field, insert the base64 encoded string for the file.Example: Embed a file in DiagnosticReport$diagnosticreport-createbashExample: Embed a file in Observation$observation-createbash
- Populate the rest of the message as needed, then send to your connection’s EHR system.
- To check if the embedded file sent successfully, log in to the Redox dashboard and check the log for the request. The embedded file displays in the log payload.