--- title: "attachment" description: "Base StructureDefinition for Attachment Type: For referring to data content defined in other formats." --- Base StructureDefinition for Attachment Type: For referring to data content defined in other formats. ## Source | Model | Leg | Role | |---|---|---| | `Attachment` | FHIR | defines this table | | `openEHR-EHR-CLUSTER.media_file.v1` | openEHR | merged in — Media file | > This table is the union of 2 source models. Columns carrying a **From** value came from a model that merged into it, so the same row satisfies both specifications. ## Columns | Column | Type | Null | Description | From | Source | |---|---|---|---|---|---| | `id` | `uuid primary key` | no | Attachment.id | — | — | | `created_at` | `timestamptz` | no | Row creation timestamp. | — | — | | `updated_at` | `timestamptz` | no | Row update timestamp; maintained by the application. | — | — | | `created_by` | `text` | no | Actor who created the row. | — | — | | `updated_by` | `text` | no | Actor who last updated the row. | — | — | | `media_type` | `text` | no | Mime type of the content, with charset etc. | — | `Attachment.contentType` | | `language` | `text` | yes | Human language of the content (BCP-47) | — | `Attachment.language` | | `content` | `bytea` | yes | Data inline, base64ed | — | `Attachment.data` | | `uri` | `text` | yes | Uri where the data can be found | — | `Attachment.url` | | `size` | `integer` | yes | Number of bytes of content (if url provided) | — | `Attachment.size` | | `hash` | `bytea` | yes | Hash of the data (sha-1, base64ed) | — | `Attachment.hash` | | `title` | `text` | yes | Label to display in place of the data | — | `Attachment.title` | | `creation` | `timestamptz` | yes | Date attachment was first created | — | `Attachment.creation` | | `description` | `text` | yes | Description | `openEHR-EHR-CLUSTER.media_file.v1` | `/items[at0005]` | | `comment` | `text` | yes | Comment | `openEHR-EHR-CLUSTER.media_file.v1` | `/items[at0007]` | | `identifier_value`
`identifier_system` | text, text
`text`, `text` | yes | Identifier | `openEHR-EHR-CLUSTER.media_file.v1` | `/items[at0010]` | ## Constraints ```sql check (identifier_system is null or identifier_value is not null) check (num_nonnulls(content, uri) = 1) ``` ## Referenced by 19 tables reference `attachment`, via `digital_representation`. The first 15 alphabetically: - [`advance_care_directive`](/docs/tables/advance_care_directive) via `digital_representation` - [`adverse_reaction_event_reaction_details`](/docs/tables/adverse_reaction_event_reaction_details) via `attachment_id` - [`anatomical_location_multimedia_representation`](/docs/tables/anatomical_location_multimedia_representation) via `attachment_id` - [`anatomical_location_circle_multimedia_representation`](/docs/tables/anatomical_location_circle_multimedia_representation) via `attachment_id` - [`anatomical_location_relative_multimedia_representation`](/docs/tables/anatomical_location_relative_multimedia_representation) via `attachment_id` - [`clinical_evidence_multimedia_representation`](/docs/tables/clinical_evidence_multimedia_representation) via `attachment_id` - [`document_reference_content`](/docs/tables/document_reference_content) via `attachment` - [`ecg_result_multimedia_representation`](/docs/tables/ecg_result_multimedia_representation) via `attachment_id` - [`embryo_assessment_image_representation`](/docs/tables/embryo_assessment_image_representation) via `attachment_id` - [`family_history_multimedia`](/docs/tables/family_history_multimedia) via `attachment_id` - [`imaging_exam_result_report_representation`](/docs/tables/imaging_exam_result_report_representation) via `attachment_id` - [`laboratory_test_result_multimedia_representation`](/docs/tables/laboratory_test_result_multimedia_representation) via `attachment_id` - [`person`](/docs/tables/person) via `photo` - [`procedure_multimedia`](/docs/tables/procedure_multimedia) via `attachment_id` - [`pulse_oximetry_multimedia_image`](/docs/tables/pulse_oximetry_multimedia_image) via `attachment_id`