Connecting a File to a Patient (Enduser)
Most of the time, a file will be associated with a patient. This is done by setting the enduserId field. If you need to match an existing enduser, check out Filtering Results.
Uploading a File
Uploading a file requires 2 steps, with an optional 3rd step
1. Prepare File Upload
Use the Prepare File Upload endpoint and set the set the name, size, and type (mime type) to match the file you’re uploading. Set the enduserId to associate with a specific enduser. Set publicRead to true only if you want the file to be publicly accessible by a single URL (strongly discouraged for any file which may contain PHI or other sensitive information).
This returns the file, which has a unique id that you can use later to generate download links, update the name, and more. It also includes a JSON object called presignedUpload which includes the information you’ll need to upload the file itself
2. Upload via Pre-signed POST
Taking the presignedUpload JSON in the response to Prepare File Upload, POST to the .url value with the following details:
- Use the Content-Type ‘multipart/form-data’ Header
- Take the data in presigned.fields, include in the form body
- Include the file data itself as the last entry in the form body of the request
3. Confirm Upload (required for sync to external systems like Healthie)
Use the Confirm File Upload endpoint after you have successfully uploaded the file in step 2, to track in Tellescope that the file upload was successful. This allows our system to know when files are ready to sync to 3rd-party systems (e.g. Healthie). In the case of Healthie, step 3 will cause the file to automatically sync when file sync is turned on.
Comments
0 comments
Please sign in to leave a comment.