If you haven’t already, check out our high-level summary and best practices for sending a file to an integrated system. The details below get into the specific “how-to” but it’s best to have a general idea before getting started.
With the Data Model API, you can use the Notes or Results data model to send a file to your integrated system. This depends on the context of the file:
- Use the Notes data model if you want to send clinical notes that a provider wrote about a patient or a general file related to the patient (e.g., a consent form signed by the patient or a JPG related to a patient’s chart).What to send with a Notes fileAnother possible alternative
- Use the Results data model if you want to send a file with test results or related to a patient’s labs.
Each data model has their own supported fields and requirements. Below, we only highlight the fields you need to include for sending files.
API reference links
- Encode the file as a base64 encoded string.
- Populate the required document fields to include the encoded file in your request:
- In the Note.ContentType field, enter Base64 Encoded (as one of the supported values from the valueset).
- In the Note.FileContents field, insert the base64 encoded string for the file.
- In the Note.FileName field, enter the name of the file.
- In the Note.DocumentType field, enter the type of document that should be associated with the file (e.g., consent form, treatment plan).
- In the Note.DocumentID field, enter the unique identifier for this document.
- In the Note.Provider.ID field, enter the ID of the provider responsible for the document.
- Populate any of the other fields of the request with relevant data. Learn more about the available fields in the Notes data model.
Example: Notes request
- Encode the file as a base64 encoded string.
- Populate the required document fields to include the encoded file in your request:
- In the Orders[].Results[].Value field, insert the base64 encoded string for the file.
- In the Orders[].Results[].ValueType field, enter Encapsulated Data (as one of the supported values from the valueset).
- In the Orders[].Results[].FileType field, enter a valid file type.
- Populate any of the other fields of the request with relevant data. Learn more about the available fields in the Results data model.
Example: Results request
- Encode the file as a base64 encoded string.
- Populate the required document fields to include the encoded file in your request:
- In the Media.FileType field, enter a valid file type.
- In the Media.FileName field, enter the name of the file.
- In the Media.FileContents field, insert the base64 encoded string for the file.
- In the Media.DocumentType field, enter the type of document that should be associated with the file (e.g., consent form, treatment plan).
- In the Media.DocumentID field, enter the unique identifier for this document.
- In the Media.Provider.ID field, enter the ID of the provider responsible for the document.
- In the Media.Availability field, enter the relevant value from the supported valueset (i.e., Available, Unavailable, Obsolete, Deleted, Cancelled).
- Populate any of the other fields of the request with relevant data. Learn more about the available fields in the Media data model.
Example: Media request
For larger files, you must first upload them to Redox. Then, you can refer to the file in your requests.
- Locate the file you want to upload.
- Send your file to the Redox upload endpoint:You must authenticate the API key as for a typical Data Model API request. Learn how to authenticate and initiate a request.
Example: Upload a file to Redox with the Data Model API
- If the upload is successful, you receive a 201 Created status with the URI reference to your file in the body of the response:
Example: Binary response with the reference URL
- Send the uploaded file via the same process for embedding a file. You only need to include the URI from the previous step instead of the base64 encoded file within the request.
- 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.