Ontario Health
Ontario Clinical Report Exchange Implementation Guide v1.0.0 - Trial Use
fhir-logo
  • Index
  • Home
    • Home
    • Introduction
    • Relationship to Other Specifications
    • Scope
    • Glossary
  • Business Context
    • Business Context
    • Business Model
    • Business Data
    • Use Cases
    • Business Rules
  • Technical Context
    • Technical Context
    • Implementer Responsibility
    • Conformance Rules
    • Connectivity Summary
  • FHIR Artifacts
    • FHIR Artifacts
    • Interactions
    • Profiles
    • Extensions
    • Terminology
    • System URIs
    • Examples
    • Capability Statement
    • Response Handling
    • Downloads
  • Change Log
    • Change Log
    • Known Issues & Future Developments
    • Revision History
    1. Index
    2. FHIR Artifacts
    3. Interactions
    4. Download Attachment

For a full list of available versions, see the Directory of published versions

4.1.4. Download Attachment

4.1.4.1. Scope

When point of service system identifies that Binary.data (for clinical reports) or DiagnosticReport.presentedForm.data (for MI reports) received from OH Pub/Sub Services contantains an AttachmentMetadata extension, point of service system uses the downloadURL element from this extension to download a file from the OCRE File Repository. If this download request returns an HTTP response code 400 or 404 (as described below), point of service system requests a new downloadURL using the fileId and jwtToken elements from the extension and then uses this new downloadURL to download a file from the OCRE File Repository.

For users receiving reports, there will be no change in their workflow (e.g. no extra clicks for the user to download reports). All the interactions to enable download functionality will be done by their respective systems and APIs.

4.1.4.2. Data Flow

4.1.4.3. Downloading Files

Point of service system system will download a file using the downloadURL provided in the AttachmentMetadata extension. If the original downloadURL has expired before download, a new downloadURL may be generated by using the GET DOWNLOAD URL operation.

4.1.4.4. DOWNLOAD FILE

Using the downloadURL from AttachmentMetadata extension on Binary.data (for clinical reports) or DiagnosticReport.presentedForm.data (for MI reports)

Request:

GET <DownloadFileURL>

Response: The file will start streaming

Potential Error Codes returned from this request:

Description Code HTTP Code
Practice doesn't have proper permission to invoke this API R_PRACTICE_ID_INSUFFICIENT_PERMISSION 403 for future use only
User doesn't have proper permission to invoke this API R_USER_INSUFFICIENT_PERMISSIONS 403
The URL is invalid R_INVALID_URL 400
File Not Found R_FILE_NOT_FOUND 404
DownloadFileURL expired R_EXPIRED_FILE_URL 400
Internal error R_INTERNAL_ERROR 500

4.1.4.4.1. GET DOWNLOAD URL

This interaction supports the request to retrieve a new downloadURL for the attachment. If downloadURL in the AttachmentMetadata extension has expired or is invalid, the system can request a new downloadURL using FileId and DownloadToken mapped to values of fileId and jwtToken from the AttachmentMetadata extension. The URL response from the OCRE will provide a new direct URL to download the file from the Repository if the DownloadToken is included in the call. The system will then request the file download using the URL (GET FILE). NOTE: Download token is optional in the call. If the Token is not provided in the call, the returned URL will NOT include the token, and the token will need to be added to the GET FILE call by the system.

Request

GET {serverurl}/<FileId>[?hubtoken=<DownloadToken> ]
Authorization: Bearer <OAGToken>

Response:

{     
  "url": <DownloadFileURL>,
  "expiresInSec": 300000
}

Potential Error Codes returned from this request:

Description Code HTTP Code
File ID or Service Request ID missing R_MANDATORY_FIELD_MISSING 400
Token Has expired or is not valid 401
User doesn't have proper permission to invoke this API R_USER_INSUFFICIENT_PERMISSIONS 403
File Not Found R_FILE_NOT_FOUND 404
Internal error R_INTERNAL_ERROR 500
Version: 1.0.0 FHIR Version: R4.0.1

Powered by SIMPLIFIER.NET

HL7® and FHIR® are the registered trademarks of Health Level Seven International