FHIR Attachment Data Type (R4)
Attachment carries content such as a PDF report or an image, either inline as base64 (data) or by url. Element table, example JSON and FHIRPath for FHIR R4.
- FHIR Attachment Data Type (R4) — part of the free FHIR Toolbox library.
- Runs entirely in your browser: your FHIR data is never uploaded to a server.
Overview
Attachment carries content such as a PDF report or an image, either inline as base64 (data) or by url. contentType is a MIME type.
Elements
| Element | Type | Cardinality | Description |
|---|---|---|---|
| Attachment.contentType | code | 0..1 | Mime type of the content, with charset etc. |
| Attachment.data | base64Binary | 0..1 | Data inline, base64ed |
| Attachment.url | url | 0..1 | Uri where the data can be found |
| Attachment.size | unsignedInt | 0..1 | Number of bytes of content (if url provided) |
| Attachment.hash | base64Binary | 0..1 | Hash of the data (sha-1, base64ed) |
| Attachment.title | string | 0..1 | Label to display in place of the data |
| Attachment.creation | dateTime | 0..1 | Date attachment was first created |
Example JSON (R4)
{
"contentType": "application/pdf",
"url": "https://example.org/reports/123.pdf",
"title": "Discharge summary",
"creation": "2024-05-01"
}
FHIRPath
DiagnosticReport.presentedForm.contentType— MIME types of attached reports
FHIR Toolbox is a free, privacy-first collection of HL7 FHIR utilities by Omindra Labs. Every tool performs zero-server processing — your health data never leaves your device.