API - Get Binary


This API retrieves a Binary resource.

Scope


This transaction involves the requestor sending a GET request to the FHIR service to retrieve the Binary resource based on the id and format (i.e mime) type.

Upon successful retrieval, the FHIR Service returns an HTTP response code (i.e 2xx) and a Binary resource.

For unsuccessful retrieval, the FHIR Service returns an HTTP response code (i.e 4xx or 5xx) and an OperationOutcome resource.

Interaction Diagram


get-binary

Specification


The Get Binary FHIR specification is based on the HL7 FHIR R5 RESTful read API. (Ref: https://www.hl7.org/fhir/http.html)

Invocations

GET [baseURL]/Binary/{id}?_format={mimeType}

The Get Binary List Request will retrieve a Binary resource from AWS S3 containing data encoded in base64. The get interaction is performed by an HTTP GET command as shown.

Example

Type Value
Method GET
Headers Content-Type: application/fhir+json
URL [base]/Binary/12345678?_format=application/jpeg

Message Response

Depending on the HTTP Status Code, the following resources will be sent back to the requestor.

HTTP Status Code Example
201 Created
{
    "resourceType": "Binary",
    "id": "example",
    "meta": {
        "lastUpdated": "2024-08-06T18:02:08.865+08:00"
    },
    "contentType": "application/jpeg",
    "url": "/Binary/eimr-ttsh-U2FsdGVkX18KFMPcFnDTG2XO1pP0KO9GEZwFJlnU6bc=:d428e7db-2964-44be-855b-00c7475da6cb"
}
4xx, 5xx
{
    "resourceType": "OperationOutcome",
    "id": "notfound",
    "issue":  [
        {
            "severity": "error",
            "code": "not-found",
            "details": {
                "coding":  [
                    {
                        "system": "http://fhir.synapxe.sg/api-operation-outcome",
                        "code": "E-10000"
                    }
                ],
                "text": "No matching resource found based on id"
            }
        }
    ]
}

Business Level Errors


This section details the business level errors exposed by OperationOutcome resource for this operation. Refer to API Error Handling for framework level errors.

For illustration only

http status code code details.coding.code details.text
404 not-found E-10000 No matching resource found based on id