View raw Markdown
type: datatypedatatype: Attachment

Attachment

Overview

See also Examples, Detailed Descriptions, Mappings, Profiles and Extensions

This type is for containing or referencing attachments - additional data content defined in other formats. The most common use of this type is to include images or reports in some report format such as PDF. However, it can be used for any data that has a MIME type.

[%dt Attachment 1%]

The actual content of an Attachment can be conveyed directly using the data element or a URL reference can be provided. If both are provided, the reference SHALL point to the same content as found in the data. The reference can never be reused to point to some different data (i.e., the reference is version specific). The URL reference SHALL point to a location that resolves to actual data; some URIs such as cid: meet this requirement. If the URL is a relative reference, it is interpreted in the same way as a resource reference.

The contentType element SHALL always be populated when an Attachment contains data, and MAY be populated when there is a url. It can include charset information and other mime type extensions as appropriate. If there is no character set in the contentType then the correct course of action is undefined, though some media types may define a default character set and/or the correct character set may be able to be determined by inspection of the content.

The hash is included so that applications can verify that the content returned by the URL has not changed. The hash and size relate to the data before it is represented in base64 form. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see Provenance.signature for mechanism to protect a resource with a digital signature.

Attachment data are not constrained, and therefore can be of any content type and encoding. Therefore extra care needs to be taken to validate the content against malicious or malformed content. For more details see Security of Narrative.

In many cases where Attachment is used, the cardinality is >1. A valid use of repeats is to convey the same content in different mime types and languages. Guidance on the meaning of repeating elements SHALL be provided in the definition of the repeating resource element or extension that references this type. The language element describes the language of the attachment using the codes defined in BCP 47.

Constraints

[%dt.constraints Attachment%]

If neither data nor a URL is provided, the value should be understood as an assertion that no content for the specified mimeType and/or language is available for the combination of language and contentType.

The context of use may frequently make rules about the kind of attachment (and therefore, the kind of mime types) that can be used.

[%tx Attachment%]

Attachment is used in the following places: [%dtusage Attachment%]

Elements

Bindings

Summary Elements

Examples

Requirements

Comments

Mappings