Skip to main content

Binary

Overview​

The Binary resource represents raw digital content in its native format, including documents, images, PDFs, and other file types. This resource enables storage and retrieval of unstructured data within the FHIR ecosystem.

Important: Always validate Binary resource support and available operations by retrieving the current CapabilityStatement from /metadata before implementing integrations.

Resource Schema​

The Binary resource follows the HL7 FHIR R4 Binary specification.

Key elements include:

  • contentType - MIME type of the binary content
  • securityContext - Access control context
  • data - Base64 encoded binary data

Example Binary Resource​

{
"resourceType": "Binary",
"id": "12345",
"contentType": "application/pdf",
"securityContext": {
"reference": "Patient/12345"
},
"data": "JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL1BhZ2VzCi9LaWRzIFszIDAgUl0KL0NvdW50IDEKPD4KZW5kb2JqCjMgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCAyIDAgUgovTWVkaWFCb3ggWzAgMCA2MTIgNzkyXQovUmVzb3VyY2VzIDw8Ci9Gb250IDw8Ci9GMSA0IDAgUgo+Pgo+PgovQ29udGVudHMgNSAwIFIKPj4KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvSGVsdmV0aWNhCj4+CmVuZG9iago1IDAgb2JqCjw8Ci9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCi9GMSA4IFRmCjEwIDcwIFRkCihIZWxsbyBXb3JsZCkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagp4cmVmCjAgNgowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCjAwMDAwMDAyNDUgMDAwMDAgbiAKMDAwMDAwMDMxNCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDYKL1Jvb3QgMSAwIFIKPj4Kc3RhcnR4cmVmCjQwNwolJUVPRgo="
}

Supported Profiles​

This API supports the following FHIR profiles:

Operations​

The General Purpose FHIR R4 Binary resource supports the following standard operations. However, support varies by the targeted CareRecord or solution.

CareRecord / SolutionCreateReadUpdateSearch
GEHRIMED-Yes--
myAvatar-Yes--
myEvolv-Yes--
myUnity-Yes--
Referral Manager----

Read​

This operation retrieves a resource by its id specified in the path.

Read Examples​

curl -X GET https://fhir.netsmartcloud.com/v4/Binary/12345 \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"

Error Handling​

For information about error responses when working with Binary resources, see Common Errors.

Common Binary-related errors include:

  • Invalid binary ID in read requests
  • Unsupported content types
  • Missing security context
  • File size limitations exceeded

Integration Patterns​

Document Retrieval​

Binary resources are typically referenced by DocumentReference resources:

# Get document metadata first
curl -X GET "https://fhir.netsmartcloud.com/v4/DocumentReference/12345" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"

# Then retrieve the binary content
curl -X GET "https://fhir.netsmartcloud.com/v4/Binary/67890" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/pdf"

Content Type Handling​

Always specify appropriate Accept headers for binary content:

# For PDF documents
curl -X GET "https://fhir.netsmartcloud.com/v4/Binary/12345" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/pdf"

# For images
curl -X GET "https://fhir.netsmartcloud.com/v4/Binary/12345" \
-H "Authorization: Bearer {token}" \
-H "Accept: image/jpeg"

Relationships to Other Resources​

The Binary resource is typically referenced by other resources:

  • DocumentReference - References Binary resources for document content
  • Patient - Security context for patient-related documents
  • Practitioner - Security context for provider-related documents
  • Organization - Security context for organizational documents

Support​

For questions about Binary resource implementation or document handling, contact Netsmart support through your designated support channels.