Пример #1
0
        void DicomDataSet_SetEncapsulatedDocumentExample(DicomElement element, bool child, DicomDataSet ds, string sFileDocumentIn)
        {
            try
            {
                //Create a new DICOM Encapsulated Document
                DicomEncapsulatedDocument encapsulatedDocument = new DicomEncapsulatedDocument();

                //Set the attributes of the encapsulated document
                encapsulatedDocument.Type           = DicomEncapsulatedDocumentType.Pdf; //Type == Pdf
                encapsulatedDocument.InstanceNumber = 123;
                encapsulatedDocument.ContentDate    = new DicomDateValue(2015, 1, 1);

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

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

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

                //Mime type of the document (ignored)
                encapsulatedDocument.MimeTypeOfEncapsulatedDocument = "***** This is ignored when calling SetEncapsulatedDocument *****";

                //Mime types of the document
                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";

                //Set the document into the data set
                ds.SetEncapsulatedDocument(element, child, sFileDocumentIn, encapsulatedDocument, conceptNameCodeSequence);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }