FHIR Attachment Data Type (R5)
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 R5.
- FHIR Attachment Data Type (R5) — 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 | integer64 | 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 |
| Attachment.height | positiveInt | 0..1 | Height of the image in pixels (photo/video) |
| Attachment.width | positiveInt | 0..1 | Width of the image in pixels (photo/video) |
| Attachment.frames | positiveInt | 0..1 | Number of frames if > 1 (photo) |
| Attachment.duration | decimal | 0..1 | Length in seconds (audio / video) |
| Attachment.pages | positiveInt | 0..1 | Number of printed pages |
Example JSON (R5)
{
"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.