Working With DICOM Encapsulated Documents

The Encapsulated Document Information Object Definition (IOD) is described in the DICOM specification in part 3, section A.45. The Encapsulated Document IOD can be used to encapsulate either a PDF document (SOP Class 1.2.840.10008.5.1.4.1.1.104.1) (part3 Table A.45.1-1) or a CDA document (SOP Class 1.2.840.10008.5.1.4.1.1.104.2) (part 3 Table A.45.2-1). Both the PDF and CDA versions of this IOD contain the Encapsulated Document information entity (IE), which in turn consists of the Encapsulated Document Module (part 3, Table C.24-2). This table is shown below:

C.24.2 Encapsulated Document Module

Table C.24-2 defines the Encapsulated Document Attributes.

Table C.24-2
Encapsulated Document Module Attributes

Attribute Name Tag Type Attribute Description
Instance Number (0020,0013 1 A number that identifies this SOP Instance. The value shall be unique within a series.
Content Date (0008,0023) 2 The date the document content creation was started.
Content Time (0008,0033) 2 The time the document content creation was started.
Acquisition DateTime (0008,002A) 2 The date and time that the original generation of the data in the document started.
Burned In Annotation (0028,0301) 1 Indicates whether or not the encapsulated document contains sufficient burned in annotation to identify the patient and date the data was acquired.Enumerated Values:

YES
NO

Identification of patient and date as text in an encapsulated document (e.g., in an XML attribute or element) is equivalent to "burned in annotation". A de-identified document may use the value NO.
Source Instance Sequence (0042,0013 1C A sequence that identifies the set of Instances that were used to derive the encapsulated document. One or more Items may be included in this Sequence.Required if derived from one or more DICOM Instances. May be present otherwise.
>Include SOP Instance Reference Macro' Table 10-11
Document Title (0042,0010 2 The title of the document.

Note:  In the case of a PDF encapsulated document, this may be the value of the "Title" entry in the "Document Information Directory" as encoded in the PDF data.
Concept Name Code Sequence (0040,A043 2 A coded representation of the document title. Zero or one item may be present.
>Include Code Sequence Macro Table 8.8-1 Baseline Context Group 7020
Verification Flag (0040,A493 3 Indicates whether the Encapsulated Document is Verified. Enumerated Values:

UNVERIFIED = Not attested by a legally accountable person.

VERIFIED = Attested to (signed) by a Verifying Observer or Legal Authenticator named in the document, who is accountable for its content.
HL7 Instance Identifier (0040,E001) 1C Instance Identifier of the encapsulated HL7 Structured Document, encoded as a UID (OID or UUID), concatenated with a caret ("^") and Extension value (if Extension is present in Instance Identifier).

Required if encapsulated document is a CDA document.
MIME Type of Encapsulated Document (0042,0012) 1 The type of the encapsulated document stream described using the MIME Media Type (see RFC 2046).
List of MIME Types (0042,0014 1C MIME Types of subcomponents of the encapsulated document.

Required if the encapsulated document incorporates subcomponents with MIME types different than the primary MIME Type of the encapsulated document.

Note: An Encapsulated CDA that includes an embedded JPEG image and an embedded PDF would list "image/jpeg\application/pdf".
Encapsulated Document (0042,0011 1 Encapsulated Document stream, containing a document encoded according to the MIME Type.

The DICOMENCAPSULATEDDOCUMENT structure represents the elements in this table, except the sequences (Source Instance Sequence, Concept Name Code Sequence). The DICOMCODESEQUENCEITEM structure represents the elements in the Concept Name Code Sequence.

Both LDicomDS::GetEncapsulatedDocument and LDicomDS::SetEncapsulatedDocument use these structures to access the encapsulated document module elements.

To extract the encapsulated document as a file, and to read the encapsulated document modules elements from an existing DICOM data set, call the LDicomDS::GetEncapsulatedDocument function.

To extract the encapsulated document to a memory buffer, and to read the encapsulated document modules elements from an existing DICOM data set, call the LDicomDS::GetEncapsulatedDocument  function.

To encapsulate an existing PDF or CDA document, and to insert new or modify existing elements and element values that comprise the encapsulated document module, call the LDicomDS::SetEncapsulatedDocument function .

Note that the Encapsulated Document element (0042,0011) contains the byte stream of the actual PDF or CDA document. the LDicomDS::GetEncapsulatedDocument function reads the byte stream of this element automatically, and stores it as a file that you specify.

The LDicomDS::SetEncapsulatedDocument function reads the byte stream of this element automatically, and stores it in a memory buffer that you specify.

Likewise, LDicomDS::SetEncapsulatedDocument function takes a file name as an argument, and automatically stores the contents of this file as a byte stream in the Encapsulated Document element (0042,0011). Alternatively, you can call LDicomDS::GetEncapsulatedDocument to store the contents of a memory buffer as a byte stream in the Encapsulated Document element (0042,0011).

To see how to create an encapsulated document, see the example for LDicomDS::SetEncapsulatedDocument function. To see how to extract the contents of an encapsulated document, see the example for LDicomDS::GetEncapsulatedDocument function.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.