R4 Ballot #1 (Mixed Normative/Trial use)

This page is part of the FHIR Specification (v3.3.0: R4 Ballot 2). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

Attachment.profile.json

Modeling and Methodology Work GroupMaturity Level: N/ABallot Status: Informative

Raw JSON (canonical form)

StructureDefinition for Attachment

{
  "resourceType": "StructureDefinition",
  "id": "Attachment",
  "meta": {
    "lastUpdated": "2018-04-03T12:05:46.262+10:00"
  },
  "text": {
    "status": "generated",
    "div": "<div>!-- Snipped for Brevity --></div>"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status",
      "valueString": "Normative"
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/Attachment",
  "name": "Attachment",
  "status": "draft",
  "date": "2018-04-03T12:05:46+10:00",
  "publisher": "HL7 FHIR Standard",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        }
      ]
    }
  ],
  "description": "Base StructureDefinition for Attachment Type: For referring to data content defined in other formats.",
  "purpose": "Many models need to include data defined in other specifications that is complex and opaque to the healthcare model. This includes documents, media recordings, structured data, etc.",
  "fhirVersion": "3.3.0",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "type": "Attachment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Element",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "Attachment",
        "path": "Attachment",
        "short": "Content in a format defined elsewhere",
        "definition": "For referring to data content defined in other formats.",
        "comment": "When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as \"Attachment\".",
        "min": 0,
        "max": "*",
        "base": {
          "path": "Attachment",
          "min": 0,
          "max": "*"
        },
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() | (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "Element"
          },
          {
            "key": "att-1",
            "severity": "error",
            "human": "If the Attachment has data, it SHALL have a contentType",
            "expression": "data.empty() or contentType.exists()",
            "xpath": "not(exists(f:data)) or exists(f:contentType)"
          }
        ],
        "isModifier": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "ED/RP"
          },
          {
            "identity": "rim",
            "map": "ED"
          }
        ]
      },
      {
        "id": "Attachment.id",
        "path": "Attachment.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "xml:id (or equivalent in JSON)",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Attachment.extension",
        "path": "Attachment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "open"
        },
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Attachment.contentType",
        "path": "Attachment.contentType",
        "short": "Mime type of the content, with charset etc.",
        "definition": "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.",
        "requirements": "Processors of the data need to be able to know how to interpret the data.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.contentType",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueCode": "text/plain; charset=UTF-8, image/png"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "MimeType"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "required",
          "description": "The mime type of an attachment. Any valid mime type is allowed.",
          "valueSetUri": "http://www.rfc-editor.org/bcp/bcp13.txt"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used"
          },
          {
            "identity": "rim",
            "map": "./mediaType, ./charset"
          }
        ]
      },
      {
        "id": "Attachment.language",
        "path": "Attachment.language",
        "short": "Human language of the content (BCP-47)",
        "definition": "The human language of the content. The value can be any valid value according to BCP 47.",
        "requirements": "Users need to be able to choose between the languages in a set of attachments.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.language",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueCode": "en-AU"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueReference": {
                "reference": "http://hl7.org/fhir/ValueSet/all-languages"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Language"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "extensible",
          "description": "A human language.",
          "valueSetCanonical": "http://hl7.org/fhir/ValueSet/languages"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "./language"
          }
        ]
      },
      {
        "id": "Attachment.data",
        "path": "Attachment.data",
        "short": "Data inline, base64ed",
        "definition": "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.",
        "comment": "The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON.",
        "requirements": "The data needs to able to be transmitted inline.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.data",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "v2",
            "map": "ED.5"
          },
          {
            "identity": "rim",
            "map": "./data"
          }
        ]
      },
      {
        "id": "Attachment.url",
        "path": "Attachment.url",
        "short": "Uri where the data can be found",
        "definition": "An alternative location where the data can be accessed.",
        "comment": "If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data.",
        "requirements": "The data needs to be transmitted by reference.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.url",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "url"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueUrl": "http://www.acme.com/logo-small.png"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "v2",
            "map": "RP.1+RP.2 - if they refer to a URL (see v2.6)"
          },
          {
            "identity": "rim",
            "map": "./reference/literal"
          }
        ]
      },
      {
        "id": "Attachment.size",
        "path": "Attachment.size",
        "short": "Number of bytes of content (if url provided)",
        "definition": "The number of bytes of data that make up this attachment (before base64 encoding, if that is done).",
        "comment": "The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference.",
        "requirements": "Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.size",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "unsignedInt"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A (needs data type R3 proposal)"
          }
        ]
      },
      {
        "id": "Attachment.hash",
        "path": "Attachment.hash",
        "short": "Hash of the data (sha-1, base64ed)",
        "definition": "The calculated hash of the data using SHA-1. Represented using base64.",
        "comment": "The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see [Provenance.signature](provenance-definitions.html#Provenance.signature) for mechanism to protect a resource with a digital signature.",
        "requirements": "Included so that applications can verify that the contents of a location have not changed duse to technical failures (e.g., storage rot, transport glitch, incorrect version).",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.hash",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": ".integrityCheck[parent::ED/integrityCheckAlgorithm=\"SHA-1\"]"
          }
        ]
      },
      {
        "id": "Attachment.title",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Attachment.title",
        "short": "Label to display in place of the data",
        "definition": "A label or set of text to display in place of the data.",
        "requirements": "Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.title",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueString": "Official Corporate Logo"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "./title/data"
          }
        ]
      },
      {
        "id": "Attachment.creation",
        "path": "Attachment.creation",
        "short": "Date attachment was first created",
        "definition": "The date that the attachment was first created.",
        "requirements": "This is often tracked as an integrity issue for use of the attachment.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Attachment.creation",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A (needs data type R3 proposal)"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Attachment",
        "path": "Attachment",
        "short": "Content in a format defined elsewhere",
        "definition": "For referring to data content defined in other formats.",
        "comment": "When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as \"Attachment\".",
        "min": 0,
        "max": "*",
        "constraint": [
          {
            "key": "att-1",
            "severity": "error",
            "human": "If the Attachment has data, it SHALL have a contentType",
            "expression": "data.empty() or contentType.exists()",
            "xpath": "not(exists(f:data)) or exists(f:contentType)"
          }
        ],
        "mapping": [
          {
            "identity": "v2",
            "map": "ED/RP"
          },
          {
            "identity": "rim",
            "map": "ED"
          }
        ]
      },
      {
        "id": "Attachment.contentType",
        "path": "Attachment.contentType",
        "short": "Mime type of the content, with charset etc.",
        "definition": "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.",
        "requirements": "Processors of the data need to be able to know how to interpret the data.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueCode": "text/plain; charset=UTF-8, image/png"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "MimeType"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "required",
          "description": "The mime type of an attachment. Any valid mime type is allowed.",
          "valueSetUri": "http://www.rfc-editor.org/bcp/bcp13.txt"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used"
          },
          {
            "identity": "rim",
            "map": "./mediaType, ./charset"
          }
        ]
      },
      {
        "id": "Attachment.language",
        "path": "Attachment.language",
        "short": "Human language of the content (BCP-47)",
        "definition": "The human language of the content. The value can be any valid value according to BCP 47.",
        "requirements": "Users need to be able to choose between the languages in a set of attachments.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueCode": "en-AU"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueReference": {
                "reference": "http://hl7.org/fhir/ValueSet/all-languages"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Language"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "extensible",
          "description": "A human language.",
          "valueSetCanonical": "http://hl7.org/fhir/ValueSet/languages"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "./language"
          }
        ]
      },
      {
        "id": "Attachment.data",
        "path": "Attachment.data",
        "short": "Data inline, base64ed",
        "definition": "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.",
        "comment": "The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON.",
        "requirements": "The data needs to able to be transmitted inline.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "mapping": [
          {
            "identity": "v2",
            "map": "ED.5"
          },
          {
            "identity": "rim",
            "map": "./data"
          }
        ]
      },
      {
        "id": "Attachment.url",
        "path": "Attachment.url",
        "short": "Uri where the data can be found",
        "definition": "An alternative location where the data can be accessed.",
        "comment": "If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data.",
        "requirements": "The data needs to be transmitted by reference.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "url"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueUrl": "http://www.acme.com/logo-small.png"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "v2",
            "map": "RP.1+RP.2 - if they refer to a URL (see v2.6)"
          },
          {
            "identity": "rim",
            "map": "./reference/literal"
          }
        ]
      },
      {
        "id": "Attachment.size",
        "path": "Attachment.size",
        "short": "Number of bytes of content (if url provided)",
        "definition": "The number of bytes of data that make up this attachment (before base64 encoding, if that is done).",
        "comment": "The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference.",
        "requirements": "Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "unsignedInt"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A (needs data type R3 proposal)"
          }
        ]
      },
      {
        "id": "Attachment.hash",
        "path": "Attachment.hash",
        "short": "Hash of the data (sha-1, base64ed)",
        "definition": "The calculated hash of the data using SHA-1. Represented using base64.",
        "comment": "The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see [Provenance.signature](provenance-definitions.html#Provenance.signature) for mechanism to protect a resource with a digital signature.",
        "requirements": "Included so that applications can verify that the contents of a location have not changed duse to technical failures (e.g., storage rot, transport glitch, incorrect version).",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": ".integrityCheck[parent::ED/integrityCheckAlgorithm=\"SHA-1\"]"
          }
        ]
      },
      {
        "id": "Attachment.title",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Attachment.title",
        "short": "Label to display in place of the data",
        "definition": "A label or set of text to display in place of the data.",
        "requirements": "Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "example": [
          {
            "label": "General",
            "valueString": "Official Corporate Logo"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "./title/data"
          }
        ]
      },
      {
        "id": "Attachment.creation",
        "path": "Attachment.creation",
        "short": "Date attachment was first created",
        "definition": "The date that the attachment was first created.",
        "requirements": "This is often tracked as an integrity issue for use of the attachment.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A (needs data type R3 proposal)"
          }
        ]
      }
    ]
  }
}

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.