BinaryRead method
Gets the contents of a FHIR Binary resource.
This method can be used to retrieve a Binary resource either by using the
FHIR JSON mimetype as the value for the Accept header, or as a raw data
stream. If the FHIR Accept type is used this method will return a Binary
resource with the data base64-encoded, regardless of how the resource was
created. The resource data can be retrieved in base64-decoded form if the
Accept type of the request matches the value of the resource's
contentType
field. The definition of the Binary REST API can be found at
https://hl7.org/fhir/binary.html#rest.
Request parameters:
name
- Required. The name of the Binary resource to retrieve.
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/datasets/\[^/\]+/fhirStores/\[^/\]+/fhir/Binary/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a HttpBody.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<HttpBody> BinaryRead(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.fromJson(response_ as core.Map<core.String, core.dynamic>);
}