LEADTOOLS Medical (Leadtools.Dicom assembly)
LEAD Technologies, Inc

SetEncapsulatedDocument(DicomElement,Boolean,String,DicomEncapsulatedDocument,DicomCodeSequenceItem) Method

Example 







A DicomElement in the data set.
true to insert the encapsulated document as a child of element., false to insert the encapsulated document on the same level as element.
The name of the file that will be encapsulated.
The encapsulated document module attributes
The concept name code sequence attributes
Inserts an encapsulated document and corresponding DICOM elements into a DICOM data set in a disk file. .NET support WinRT support Silverlight support
Syntax
'Declaration
 
Public Overloads Sub SetEncapsulatedDocument( _
   ByVal element As DicomElement, _
   ByVal child As Boolean, _
   ByVal fileDocument As String, _
   ByVal encapsulatedDocument As DicomEncapsulatedDocument, _
   ByVal conceptNameCodeSequence As DicomCodeSequenceItem _
) 
'Usage
 
Dim instance As DicomDataSet
Dim element As DicomElement
Dim child As Boolean
Dim fileDocument As String
Dim encapsulatedDocument As DicomEncapsulatedDocument
Dim conceptNameCodeSequence As DicomCodeSequenceItem
 
instance.SetEncapsulatedDocument(element, child, fileDocument, encapsulatedDocument, conceptNameCodeSequence)
ObjectiveC Syntax
 function Leadtools.Dicom.DicomDataSet.SetEncapsulatedDocument(DicomElement,Boolean,String,DicomEncapsulatedDocument,DicomCodeSequenceItem)( 
   element ,
   child ,
   fileDocument ,
   encapsulatedDocument ,
   conceptNameCodeSequence 
)

Parameters

element
A DicomElement in the data set.
child
true to insert the encapsulated document as a child of element., false to insert the encapsulated document on the same level as element.
fileDocument
The name of the file that will be encapsulated.
encapsulatedDocument
The encapsulated document module attributes
conceptNameCodeSequence
The concept name code sequence attributes
Remarks

This feature is available in version 16 or higher.

The members of the DicomEncapsulatedDocument class and the DicomCodeSequenceItem class together represent the set of attributes contained in the "Encapsulated Document Module Attributes”. The Encapsulated Information Object Definition (IOD) describes one of the following file types that has been encapsulated within a DICOM information object:

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

The encapsulatedDocument class corresponds to the Encapsulated Document Module Attributes described in part 3 of the DICOM specification. To set the Concept Name Code Sequence element (0040,A043) pass a conceptNameCodeSequence object.

fileDocument is a file location of the document that will be encapsulated. This should be either a PDF or a CDA document, and the member of the DicomEncapsulatedDocument class should be set accordingly.

Example
Copy CodeCopy Code  
''' 
Private Sub DicomDataSet_SetEncapsulatedDocumentExample(ByVal element As DicomElement, ByVal child As Boolean, ByVal ds As DicomDataSet, _
                                                        ByVal sFileDocumentIn As String)
   Dim encapsulatedDocument As DicomEncapsulatedDocument = New DicomEncapsulatedDocument()
   encapsulatedDocument.Type = DicomEncapsulatedDocumentType.Pdf
   encapsulatedDocument.InstanceNumber = 123
   encapsulatedDocument.ContentDate = New DicomDateValue(2008, 12, 31)

   encapsulatedDocument.ContentTime = New DicomTimeValue(12, 30, 0, 1)

   encapsulatedDocument.AcquisitionDateTime = New DicomDateTimeValue(2008, 12, 31, 12, 30, 0, 1, -3)

   encapsulatedDocument.BurnedInAnnotation = "YES"
   encapsulatedDocument.DocumentTitle = sFileDocumentIn
   encapsulatedDocument.VerificationFlag = "UNVERIFIED"
   encapsulatedDocument.HL7InstanceIdentifier = String.Empty

   ' The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
   ' It is filled in when calling 'SetEncapsulatedDocument'
   encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****"

   Dim sListOfMimeTypes As String() = New String() {"image/jpeg", "application/pdf"}
   encapsulatedDocument.SetListOfMimeTypes(sListOfMimeTypes)
   'encapsulatedDocument.nListOfMIMETypesCount               = 2;

   Dim conceptNameCodeSequence As DicomCodeSequenceItem = New DicomCodeSequenceItem()
   conceptNameCodeSequence.CodingSchemeDesignator = "LN"
   conceptNameCodeSequence.CodeValue = "12345"
   conceptNameCodeSequence.CodeMeaning = "Sample Code Meaning"

   ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence)

   ' You can also use the overload that takes a stream
   Using stream As New FileStream(sFileDocumentIn, FileMode.Open)
      ds.SetEncapsulatedDocument(element, child, stream, encapsulatedDocument, conceptNameCodeSequence)
   End Using
End Sub
/// 
void DicomDataSet_SetEncapsulatedDocumentExample(DicomElement element, bool child, DicomDataSet ds, string sFileDocumentIn)
{
   DicomEncapsulatedDocument encapsulatedDocument = new DicomEncapsulatedDocument();
   encapsulatedDocument.Type = DicomEncapsulatedDocumentType.Pdf;
   encapsulatedDocument.InstanceNumber = 123;
   encapsulatedDocument.ContentDate = new DicomDateValue(2008, 12, 31);

   encapsulatedDocument.ContentTime = new DicomTimeValue(12, 30, 00, 1);

   encapsulatedDocument.AcquisitionDateTime = new DicomDateTimeValue(2008, 12, 31, 12, 30, 00, 01, -3);

   encapsulatedDocument.BurnedInAnnotation = "YES";
   encapsulatedDocument.DocumentTitle = sFileDocumentIn;
   encapsulatedDocument.VerificationFlag = "UNVERIFIED";
   encapsulatedDocument.HL7InstanceIdentifier = string.Empty;

   // The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
   // It is filled in when calling 'SetEncapsulatedDocument'
   encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****";

   string[] sListOfMimeTypes = new string[] { "image/jpeg", "application/pdf" };
   encapsulatedDocument.SetListOfMimeTypes(sListOfMimeTypes);
   //encapsulatedDocument.nListOfMIMETypesCount               = 2;

   DicomCodeSequenceItem conceptNameCodeSequence = new DicomCodeSequenceItem();
   conceptNameCodeSequence.CodingSchemeDesignator = "LN";
   conceptNameCodeSequence.CodeValue = "12345";
   conceptNameCodeSequence.CodeMeaning = "Sample Code Meaning";

   ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence);

   // You can also use the overload that takes a stream
   using (FileStream stream = new FileStream(sFileDocumentIn, FileMode.Open))
   {
      ds.SetEncapsulatedDocument(element, child, stream, encapsulatedDocument, conceptNameCodeSequence);
   }
}
/// 
async Task DicomDataSet_SetEncapsulatedDocumentExample(DicomElement element, bool child, DicomDataSet ds, string sFileDocumentIn)
{
   DicomEncapsulatedDocument encapsulatedDocument = new DicomEncapsulatedDocument();
   encapsulatedDocument.Type = DicomEncapsulatedDocumentType.Pdf;
   encapsulatedDocument.InstanceNumber = 123;
   encapsulatedDocument.ContentDate = DicomDateValueHelper.Create(2008, 12, 31);

   encapsulatedDocument.ContentTime = DicomTimeValueHelper.Create(12, 30, 00, 1);

   encapsulatedDocument.AcquisitionDateTime = DicomDateTimeValueHelper.Create(2008, 12, 31, 12, 30, 00, 01, -3);

   encapsulatedDocument.BurnedInAnnotation = "YES";
   encapsulatedDocument.DocumentTitle = sFileDocumentIn;
   encapsulatedDocument.VerificationFlag = "UNVERIFIED";
   encapsulatedDocument.HL7InstanceIdentifier = string.Empty;

   // The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
   // It is filled in when calling 'SetEncapsulatedDocument'
   encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****";

   string[] sListOfMimeTypes = new string[] { "image/jpeg", "application/pdf" };
   encapsulatedDocument.SetListOfMimeTypes(sListOfMimeTypes);
   //encapsulatedDocument.nListOfMIMETypesCount               = 2;

   DicomCodeSequenceItem conceptNameCodeSequence = new DicomCodeSequenceItem();
   conceptNameCodeSequence.CodingSchemeDesignator = "LN";
   conceptNameCodeSequence.CodeValue = "12345";
   conceptNameCodeSequence.CodeMeaning = "Sample Code Meaning";

   ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence);



   // You can also use the overload that takes a stream
   string fileName = Path.GetFileName(sFileDocumentIn);
   StorageFile file = await Tools.AppInstallFolder.GetFileAsync(@"Assets\"+fileName);
   ILeadStream stream = LeadStreamFactory.Create(file);
   using (IDisposable disposable = stream as IDisposable)
   {
      ds.SetEncapsulatedDocument(element, child, stream, encapsulatedDocument, conceptNameCodeSequence);
   }
}
void DicomDataSet_SetEncapsulatedDocumentExample(DicomElement element, bool child, DicomDataSet ds, Stream sFileDocumentIn)
{
   DicomEncapsulatedDocument encapsulatedDocument = new DicomEncapsulatedDocument();
   encapsulatedDocument.Type = DicomEncapsulatedDocumentType.Pdf;
   encapsulatedDocument.InstanceNumber = 123;
   encapsulatedDocument.ContentDate = new DicomDateValue(2008, 12, 31);

   encapsulatedDocument.ContentTime = new DicomTimeValue(12, 30, 00, 1);

   encapsulatedDocument.AcquisitionDateTime = new DicomDateTimeValue(2008, 12, 31, 12, 30, 00, 01, -3);

   encapsulatedDocument.BurnedInAnnotation = "YES";
   encapsulatedDocument.DocumentTitle = "MyTest.pdf";
   encapsulatedDocument.VerificationFlag = "UNVERIFIED";
   encapsulatedDocument.HL7InstanceIdentifier = string.Empty;

   // The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
   // It is filled in when calling 'SetEncapsulatedDocument'
   encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****";

   string[] sListOfMimeTypes = new string[] { "image/jpeg", "application/pdf" };
   encapsulatedDocument.SetListOfMimeTypes(sListOfMimeTypes);

   DicomCodeSequenceItem conceptNameCodeSequence = new DicomCodeSequenceItem();
   conceptNameCodeSequence.CodingSchemeDesignator = "LN";
   conceptNameCodeSequence.CodeValue = "12345";
   conceptNameCodeSequence.CodeMeaning = "Sample Code Meaning";

   ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence);
}
Private Sub DicomDataSet_SetEncapsulatedDocumentExample(ByVal element As DicomElement, _
                                                        ByVal child As Boolean, _
                                                        ByVal ds As DicomDataSet, _
                                                        ByVal sFileDocumentIn As Stream)
    Dim encapsulatedDocument As DicomEncapsulatedDocument = New DicomEncapsulatedDocument()
    encapsulatedDocument.Type = DicomEncapsulatedDocumentType.Pdf
    encapsulatedDocument.InstanceNumber = 123
    encapsulatedDocument.ContentDate = New DicomDateValue(2008, 12, 31)

    encapsulatedDocument.ContentTime = New DicomTimeValue(12, 30, 0, 1)

    encapsulatedDocument.AcquisitionDateTime = New DicomDateTimeValue(2008, 12, 31, 12, 30, 0, 1, -3)

    encapsulatedDocument.BurnedInAnnotation = "YES"
    encapsulatedDocument.DocumentTitle = "MyTest.pdf"
    encapsulatedDocument.VerificationFlag = "UNVERIFIED"
    encapsulatedDocument.HL7InstanceIdentifier = String.Empty

    ' The 'pszMIMETypeOfEncapsulatedDocument' field is ignored when calling SetEncapsulatedDocument
    ' It is filled in when calling 'SetEncapsulatedDocument'
    encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****"

    Dim sListOfMimeTypes As String() = New String() {"image/jpeg", "application/pdf"}
    encapsulatedDocument.SetListOfMimeTypes(sListOfMimeTypes)

    Dim conceptNameCodeSequence As DicomCodeSequenceItem = New DicomCodeSequenceItem()
    conceptNameCodeSequence.CodingSchemeDesignator = "LN"
    conceptNameCodeSequence.CodeValue = "12345"
    conceptNameCodeSequence.CodeMeaning = "Sample Code Meaning"

    ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence)
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DicomDataSet Class
DicomDataSet Members
Overload List
GetEncapsulatedDocument(DicomElement,Boolean,String,DicomEncapsulatedDocument,DicomCodeSequenceItem) Method
SetEncapsulatedDocument(DicomElement,Boolean,String,DicomEncapsulatedDocument,DicomCodeSequenceItem) Method
DicomEncapsulatedDocument Class

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features