If you haven’t already, check out these high-level best practices for:
- saving vitals; or
If you'd like to send a generic file to your connection instead, learn how to send a file. Otherwise, you can send results and vitals information with these operations:
This article contains instructions for how to save vitals or diagnostic results with either of these FHIR® operations.
Hypothetically, you may embed a file in any FHIR® resource that contains a FHIR® Attachment datatype. Learn more about FHIR® Attachment.
For results and vitals, you can embed a PDF directly in the DiagnosticReport or Observation resources.
To embed a file, you may send a file less than 10 MB in one writeback message.
- Encode the file as a base64 encoded string.
- Use DiagnosticReport$diagnosticreport-create for a collection of results or observations. Or use Observation$observation-create for individual vitals or results.
- In the headers:
- Replace {environmentFlag} with Development, Staging, or Production.
- Replace {API_TOKEN} with your access token.API token
- Replace {destinationSlug} 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.
- 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.
For larger files, you must first upload them to Redox using the FHIR® Binary resource. Then, you can refer to the file in either the DiagnosticReport or Observation resources.
- 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 {environmentFlag} with Development, Staging, or Production.Development not available for free accounts
- Replace {API_TOKEN} with your access token.API token
- 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 resourcebashCanada URL
- 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 correct FHIR® operation for either DiagnosticReport or Observation.
- 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.Canada URL
- 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.