LDicomDS::SetEncapsulatedDocument

#include "ltdic.h"

L_UINT16 LDicomDS::SetEncapsulatedDocument(pElement, bChild, pszFileDocument, pEncapsulatedDocument,pConceptNameCodeSequence)

pDICOMELEMENT pElement;

/* pointer to a structure */

L_BOOL bChild;

/* flag that indicates where to insert the encapsulated document elements */

L_TCHAR * pszFileDocument;

/* file name of encapsulated document */

pDICOMENCAPSULATEDDOCUMENT pEncapsulatedDocument;

/* pointer to a structure*/

pDICOMCODESEQUENCEITEM pConceptNameCodeSequence;

/* pointer to a structure */

Inserts an encapsulated document and corresponding DICOM elements into a DICOM data set.  This feature is available in version 16 or higher.

Parameter

Description

pElement

Pointer to a DICOMELEMENT structure that contains an item in the Data Set. The inserted item will be inserted as a neighbor to this item, or as a child, depending on the value of bChild.

bChild

Flag that indicates where to insert the item. Possible values are:

 

Value

Meaning

 

TRUE

The new item will be inserted as the last child of pElement.

 

FALSE

The new item will be inserted as the last sibling of pElement.

pszFileDocument

Character string that contains the name of the file that will be encapsulated. This should either be a PDF or a CDA file.

pEncapsulatedDocument

Pointer to a DICOMENCAPSULATEDDOCUMENT structure, which is filled with the encapsulated document module attributes. This member must NOT be NULL.

pConceptNameCodeSequence

Pointer to a DICOMCODESEQUENCEITEM structure, which is filled with the Concept Name Code Sequence attributes. This member can be NULL.

Returns

0

DICOM_SUCCESS

> 0

An error occurred. Refer to Return Codes.

Comments

The members of the DICOMENCAPSULATEDDOCUMENT structure and the DICOMCODESEQUENCEITEM structure together represent the set of attributes contained in the "Encapsulated Document Module Attributes". The Encapsulated Information Object Definition (IOD) describes either a

that has been encapsulated within a DICOM information object.

For more information, refer to Part 3 of the DICOM standard.

The DICOMENCAPSULATEDDOCUMENT structure corresponds to the Encapsulated Document Module Attributes described in part 3 of the DICOM specification. To include the Concept Name Code Sequence element (0040,A043) pass a pointer to a pConceptNameCodeSequence item.

The pszFileDocument argument points to a file that contains the document that you want to encapsulate. This should be either a PDF or a CDA document, and the uType member of the DICOMENCAPSULATEDDOCUMENT structure should be set accordingly.

Before calling this function:

  1. Initialize pEncapsulatedDocument ->uStructSize to be sizeof(DICOMENCAPSULATEDDOCUMENT) and initialize the structure members. Any of the members of the structure that are pointers can be NULL. NULL members will be ignored and the corresponding elements will not be inserted into the DICOM data set

  2. If pConceptNameCodeSequence is not NULL, initialize pConceptNameCodeSequence ->uStructSize to be sizeof(DICOMCODESEQUENCEITEM) and initialize all structure members. Any of the members of the structure that are pointers can be NULL. NULL members will be ignored and the corresponding elements will not be inserted into the DICOM data set

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64

See Also

Functions:

LDicomDS::GetEncapsulatedDocument, Class Members

Topics:

Working with DICOM Encapsulated Documents

 

Data Sets: Setting Data Element Values

 

How to Disable the Automatic Loading of the default DICOM IOD Table

Example

This example adds an encapsulated document, along with several encapsulated document tags to an existing DICOM data set.

L_INT LDicomDS_SetEncapsulatedDocument(pDICOMELEMENT pElement, L_BOOL bChild, LDicomDS &ds, L_TCHAR *pszFileDocumentIn)
{
   DICOMENCAPSULATEDDOCUMENT EncapsulatedDocument = {0};
   EncapsulatedDocument.uStructSize = sizeof(DICOMENCAPSULATEDDOCUMENT);
   EncapsulatedDocument.uType = ENCAPSULATED_DOCUMENT_PDF;
   EncapsulatedDocument.nInstanceNumber = 123;
   VALUEDATE contentDate = {2008, 12, 31};
   EncapsulatedDocument.pContentDate = &contentDate;
   VALUETIME contentTime = {12, 30, 00, 1};
   EncapsulatedDocument.pContentTime = &contentTime;
   VALUEDATETIME acquisitionDateTime = {2008, 12, 31, 12, 30, 00, 01, -3};
   EncapsulatedDocument.pAcquisitionDateTime = &acquisitionDateTime;
   EncapsulatedDocument.pszBurnedInAnnotation               = L"YES";
   EncapsulatedDocument.pszDocumentTitle                    = pszFileDocumentIn;
   EncapsulatedDocument.pszVerificationFlag                 = L"UNVERIFIED";
   EncapsulatedDocument.pszHL7InstanceIdentifier            = NULL;
   // The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
   // It is filled in when calling 'SetEncapsulatedDocument'
   EncapsulatedDocument.pszMIMETypeOfEncapsulatedDocument   = L"***** This is ignored when calling SetEncapsulatedDocument *****";
   EncapsulatedDocument.pszListOfMIMETypes                  = L"image/jpeg\0application/pdf";
   EncapsulatedDocument.nListOfMIMETypesCount               = 2;
   DICOMCODESEQUENCEITEM ConceptNameCodeSequence = {0};
   ConceptNameCodeSequence.uStructSize                      = sizeof(DICOMCODESEQUENCEITEM);
   ConceptNameCodeSequence.pszCodingSchemeDesignator        = L"LN";
   ConceptNameCodeSequence.pszCodeValue                     = L"12345";
   ConceptNameCodeSequence.pszCodeMeaning                   = L"Sample Code Meaning";
   L_UINT16 uRet = ds.SetEncapsulatedDocument(pElement, bChild, pszFileDocumentIn, &EncapsulatedDocument, &ConceptNameCodeSequence);
   return uRet;
}