Healthcare Financial Services IG Edition 1
0.3.0 - ci-build Saudi Arabia flag

Healthcare Financial Services IG Edition 1 - Local Development build (v0.3.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Data Type Profile: DP_Attachment

Official URL: http://nphies.sa/fhir/ksa/nphies-fs/StructureDefinition/DP-Attachment Version: 0.3.0
Draft as of 2025-06-23 Computable Name: DP_Attachment

Attachment datatype, requires either .data or .url, .size and .hash supplied plus other required elements.

The Attachment datatype is used to convey a reference to or the actual contents of some type of file-based information such as a pdf document, jpeg image, etc. The key elements of the Attachment datatype are:

Attachment (format and size) is given below:

  • contentType (code) (required): the ‘mime type’ of the file content, common values for show below:
ExtensionKind of DocumentMIME Type
.pdfAdobe Portable Document Format (PDF)application/pdf
.jpeg, .jpgJPEG imagesimage/jpeg
  • language (code) (Optional): en: English, ar: Arabic
  • data (base64Binary) (is required if no url is provided): the attachment to be Base64 encoded and placed in this element.
  • url (url)( is required if no data is provided)This is the location of the attachment content
  • size (unsignedInt) (required if an url is provided): Number of bytes of content (if url provided)
  • hash (base64Binary) (required if an url is provided) : Hash of the data (sha-1, base64ed)
  • title (string) (required): Label to display in place of the data, or the name of the file
  • creation (dateTime) (required): Date attachment content was first created

Usage:

Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

This structure is derived from Attachment

NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
ksa-att-1: Must provide a valid attachment suite of elements
... contentType 1..1 DP_code Mime type of the content, with charset etc.
... language S 0..1 code Human language of the content (BCP-47)
... data SC 0..1 DP_base64Binary Data inline, base64ed
ksa-mlen-10MB: Maximum element length is 10MB.
... size S 0..1 DP_unsignedInt Number of bytes of content (if url provided)
... hash SC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ksa-mlen-255: Maximum element length is 255.
... title 1..1 string Label to display in place of the data
Max Length:250
... creation 1..1 DP_dateTime Date attachment was first created

doco Documentation for this format

Constraints

IdGradePath(s)DetailsRequirements
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255
NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
att-1: If the Attachment has data, it SHALL have a contentType
ele-1: All FHIR elements must have a @value or children
ksa-att-1: Must provide a valid attachment suite of elements
... contentType Σ 1..1 DP_code Mime type of the content, with charset etc.
Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed.


ele-1: All FHIR elements must have a @value or children
Example General: text/plain; charset=UTF-8, image/png
... language SΣ 0..1 code Human language of the content (BCP-47)
Binding: CommonLanguages (preferred): A human language.

Additional BindingsPurpose
AllLanguages Max Binding

ele-1: All FHIR elements must have a @value or children
Example General: en-AU
... data SC 0..1 DP_base64Binary Data inline, base64ed
ele-1: All FHIR elements must have a @value or children
ksa-mlen-10MB: Maximum element length is 10MB.
... size SΣ 0..1 DP_unsignedInt Number of bytes of content (if url provided)
ele-1: All FHIR elements must have a @value or children
... hash SΣC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ele-1: All FHIR elements must have a @value or children
ksa-mlen-255: Maximum element length is 255.
... title Σ 1..1 string Label to display in place of the data
ele-1: All FHIR elements must have a @value or children
Example General: Official Corporate Logo
Max Length:250
... creation Σ 1..1 DP_dateTime Date attachment was first created
ele-1: All FHIR elements must have a @value or children

doco Documentation for this format

Terminology Bindings

PathConformanceValueSetURI
Attachment.contentTyperequiredMime Types (a valid code from urn:ietf:bcp:13)
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
from the FHIR Standard
Attachment.languagepreferredCommonLanguages
http://hl7.org/fhir/ValueSet/languages
from the FHIR Standard
Additional Bindings Purpose
AllLanguages Max Binding

Constraints

IdGradePath(s)DetailsRequirements
att-1errorAttachmentIf the Attachment has data, it SHALL have a contentType
: data.empty() or contentType.exists()
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255
NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
att-1: If the Attachment has data, it SHALL have a contentType
ksa-att-1: Must provide a valid attachment suite of elements
... id 0..1 string Unique id for inter-element referencing
... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
... contentType Σ 1..1 DP_code Mime type of the content, with charset etc.
Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed.


Example General: text/plain; charset=UTF-8, image/png
... data SC 0..1 DP_base64Binary Data inline, base64ed
ksa-mlen-10MB: Maximum element length is 10MB.
... url SΣ 0..1 DP_url Uri where the data can be found
Example General: http://www.acme.com/logo-small.png
... size SΣ 0..1 DP_unsignedInt Number of bytes of content (if url provided)
... hash SΣC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ksa-mlen-255: Maximum element length is 255.
... title Σ 1..1 string Label to display in place of the data
Example General: Official Corporate Logo
Max Length:250
... creation Σ 1..1 DP_dateTime Date attachment was first created

doco Documentation for this format

Terminology Bindings

PathConformanceValueSetURI
Attachment.contentTyperequiredMime Types (a valid code from urn:ietf:bcp:13)
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
from the FHIR Standard
Attachment.languagepreferredCommonLanguages
http://hl7.org/fhir/ValueSet/languages
from the FHIR Standard
Additional Bindings Purpose
AllLanguages Max Binding

Constraints

IdGradePath(s)DetailsRequirements
att-1errorAttachmentIf the Attachment has data, it SHALL have a contentType
: data.empty() or contentType.exists()
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255

Differential View

This structure is derived from Attachment

NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
ksa-att-1: Must provide a valid attachment suite of elements
... contentType 1..1 DP_code Mime type of the content, with charset etc.
... language S 0..1 code Human language of the content (BCP-47)
... data SC 0..1 DP_base64Binary Data inline, base64ed
ksa-mlen-10MB: Maximum element length is 10MB.
... size S 0..1 DP_unsignedInt Number of bytes of content (if url provided)
... hash SC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ksa-mlen-255: Maximum element length is 255.
... title 1..1 string Label to display in place of the data
Max Length:250
... creation 1..1 DP_dateTime Date attachment was first created

doco Documentation for this format

Constraints

IdGradePath(s)DetailsRequirements
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255

Key Elements View

NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
att-1: If the Attachment has data, it SHALL have a contentType
ele-1: All FHIR elements must have a @value or children
ksa-att-1: Must provide a valid attachment suite of elements
... contentType Σ 1..1 DP_code Mime type of the content, with charset etc.
Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed.


ele-1: All FHIR elements must have a @value or children
Example General: text/plain; charset=UTF-8, image/png
... language SΣ 0..1 code Human language of the content (BCP-47)
Binding: CommonLanguages (preferred): A human language.

Additional BindingsPurpose
AllLanguages Max Binding

ele-1: All FHIR elements must have a @value or children
Example General: en-AU
... data SC 0..1 DP_base64Binary Data inline, base64ed
ele-1: All FHIR elements must have a @value or children
ksa-mlen-10MB: Maximum element length is 10MB.
... size SΣ 0..1 DP_unsignedInt Number of bytes of content (if url provided)
ele-1: All FHIR elements must have a @value or children
... hash SΣC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ele-1: All FHIR elements must have a @value or children
ksa-mlen-255: Maximum element length is 255.
... title Σ 1..1 string Label to display in place of the data
ele-1: All FHIR elements must have a @value or children
Example General: Official Corporate Logo
Max Length:250
... creation Σ 1..1 DP_dateTime Date attachment was first created
ele-1: All FHIR elements must have a @value or children

doco Documentation for this format

Terminology Bindings

PathConformanceValueSetURI
Attachment.contentTyperequiredMime Types (a valid code from urn:ietf:bcp:13)
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
from the FHIR Standard
Attachment.languagepreferredCommonLanguages
http://hl7.org/fhir/ValueSet/languages
from the FHIR Standard
Additional Bindings Purpose
AllLanguages Max Binding

Constraints

IdGradePath(s)DetailsRequirements
att-1errorAttachmentIf the Attachment has data, it SHALL have a contentType
: data.empty() or contentType.exists()
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255

Snapshot View

NameFlagsCard.TypeDescription & Constraintsdoco
.. Attachment C 0..* Attachment Content in a format defined elsewhere
att-1: If the Attachment has data, it SHALL have a contentType
ksa-att-1: Must provide a valid attachment suite of elements
... id 0..1 string Unique id for inter-element referencing
... extension 0..* Extension Additional content defined by implementations
Slice: Unordered, Open by value:url
... contentType Σ 1..1 DP_code Mime type of the content, with charset etc.
Binding: Mime Types (required): The mime type of an attachment. Any valid mime type is allowed.


Example General: text/plain; charset=UTF-8, image/png
... data SC 0..1 DP_base64Binary Data inline, base64ed
ksa-mlen-10MB: Maximum element length is 10MB.
... url SΣ 0..1 DP_url Uri where the data can be found
Example General: http://www.acme.com/logo-small.png
... size SΣ 0..1 DP_unsignedInt Number of bytes of content (if url provided)
... hash SΣC 0..1 DP_base64Binary Hash of the data (sha-1, base64ed)
ksa-mlen-255: Maximum element length is 255.
... title Σ 1..1 string Label to display in place of the data
Example General: Official Corporate Logo
Max Length:250
... creation Σ 1..1 DP_dateTime Date attachment was first created

doco Documentation for this format

Terminology Bindings

PathConformanceValueSetURI
Attachment.contentTyperequiredMime Types (a valid code from urn:ietf:bcp:13)
http://hl7.org/fhir/ValueSet/mimetypes|4.0.1
from the FHIR Standard
Attachment.languagepreferredCommonLanguages
http://hl7.org/fhir/ValueSet/languages
from the FHIR Standard
Additional Bindings Purpose
AllLanguages Max Binding

Constraints

IdGradePath(s)DetailsRequirements
att-1errorAttachmentIf the Attachment has data, it SHALL have a contentType
: data.empty() or contentType.exists()
ele-1error**ALL** elementsAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1error**ALL** extensionsMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ksa-att-1errorAttachmentMust provide a valid attachment suite of elements
: data.exists() xor (url.exists() and size.exists() and hash.exists())
ksa-mlen-10MBerrorAttachment.dataMaximum element length is 10MB.
: toString().length() <= 10285760
ksa-mlen-255errorAttachment.hashMaximum element length is 255.
: toString().length() <= 255

 

Other representations of profile: CSV, Excel, Schematron