Esempio n. 1
0
        public static bool SendMessageQueueImplementation(DicomDataSet ds, string command, string sopInstanceUid, string path)
        {
            if (ds != null)
            {
                if (ds.IsHangingProtocolDataSet())
                {
                    // Filter out the hanging protocol datasets because there is no cache for these
                    return(true);
                }
            }

            bool messageQueueSuccess = true;

            {
                try
                {
                    int width  = 0;
                    int height = 0;

                    if (ds != null)
                    {
                        width  = ds.GetValue <int>(DicomTag.Columns, 0);
                        height = ds.GetValue <int>(DicomTag.Rows, 0);
                        if (string.IsNullOrEmpty(sopInstanceUid))
                        {
                            sopInstanceUid = ds.GetValue <string>(DicomTag.SOPInstanceUID, string.Empty);
                        }
                    }

                    MessagingQueue.Send("storageserver", "19", command, new MessagingDicomFile()
                    {
                        FileName = path, Width = width, Height = height, SopInstanceUID = sopInstanceUid
                    });
                }
                catch (Exception ex)
                {
                    Logger.Global.Log(string.Empty,
                                      string.Empty,
                                      0,
                                      string.Empty,
                                      string.Empty,
                                      0,
                                      DicomCommandType.Undefined,
                                      DateTime.Now,
                                      LogType.Warning,
                                      MessageDirection.None,
                                      "Message Queue Error': " + ex.Message, null, null);
                    messageQueueSuccess = false;
                }
            }
            return(messageQueueSuccess);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates the necessary table entries (MyPatient, MyStudy, MySeries, MyInstance) for a Leadtools.Dicom.DicomDataSet
        /// </summary>
        /// <param name="ds">The Leadtools.Dicom.DicomDataSet that is being stored.</param>
        /// <param name="referencedFileName">Full path to the DICOM file</param>
        /// <param name="retrieveAe">AE Title of the client doing the retrieval</param>
        /// <param name="images">Not used</param>
        /// <param name="updateExistentPatient">If true, overwrite an existing patient data.</param>
        /// <param name="updateExistentStudy">If true, overwrite any existing study data.</param>
        /// <param name="updateExistentSeries">If true, overwrite any existing series data.</param>
        /// <param name="updateExistentInstances">If true, overwrite an existing instance data.</param>
        /// <remarks>
        /// Table rows are overwritten based on the parameters:
        /// <list>
        /// <item>updateExistentPatient</item>
        /// <item>updateExistentStudy</item>
        /// <item>updateExistentSeries</item>
        /// <item>updateExistentInstances</item>
        /// </list>
        /// </remarks>
        public override void StoreDicom(DicomDataSet ds,
                                        string referencedFileName,
                                        string retrieveAe,
                                        ReferencedImages[] images,
                                        bool updateExistentPatient,
                                        bool updateExistentStudy,
                                        bool updateExistentSeries,
                                        bool updateExistentInstances
                                        )
        {
            if (ds.IsHangingProtocolDataSet())
            {
                return;
            }

            DataSet dataSetTemp = GetUpdateDataSet(ds,
                                                   updateExistentPatient,
                                                   updateExistentStudy,
                                                   updateExistentSeries,
                                                   updateExistentInstances);

            MyDataSet instanceDataSet = new MyDataSet();

            instanceDataSet.Merge(dataSetTemp);

            MyDicomDataSetConvertor converter = new MyDicomDataSetConvertor();

            converter.FillADONetDataSet(instanceDataSet,
                                        ds,
                                        referencedFileName,
                                        retrieveAe,
                                        updateExistentPatient,
                                        updateExistentStudy,
                                        updateExistentSeries,
                                        updateExistentInstances);


            UpdateCompositeInstance(instanceDataSet);
        }