Esempio n. 1
0
        public static RetrieveClient CreateRetrieveClient(DicomClientMode clientMode)
        {
            try
            {
                switch (clientMode)
                {
                case DicomClientMode.LocalDb:
                {
                    return(CreateLocalRetrieveClient( ));
                }


                case DicomClientMode.Pacs:
                {
                    Leadtools.Dicom.Scu.DicomScp scp;


                    if (ConfigurationData.ActivePacs == null)
                    {
                        throw new InvalidOperationException("No active PACS Server defined");
                    }

                    scp = new Leadtools.Dicom.Scu.DicomScp( );

                    scp.AETitle     = ConfigurationData.ActivePacs.AETitle;
                    scp.PeerAddress = Utils.ResolveIPAddress(ConfigurationData.ActivePacs.Address);
                    scp.Port        = ConfigurationData.ActivePacs.Port;
                    scp.Timeout     = ConfigurationData.ActivePacs.Timeout;


                    return(CreatePacsRetrieveClient(scp));
                }

                case DicomClientMode.DicomDir:
                {
                    DicomDirRetrieveClient client;


                    client = new DicomDirRetrieveClient(ConfigurationData.WorkstationClient.ToAeInfo( ),
                                                        ConfigurationData.CurrentDicomDir);

                    return(client);
                }

                default:
                {
                    throw new NotImplementedException("Dicom Client not implemented.");
                }
                }
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false, exception.Message);

                throw;
            }
        }
        private void LoadSeriesInViewer
        (
            string patientID,
            string studyInstanceUID,
            string seriesInstanceUID,
            DicomClientMode clientMode
        )
        {
            if (null == __WorkstationViewer)
            {
                return;
            }

            MedicalViewerLoader loader;


            loader = new MedicalViewerLoader(DicomClientFactory.CreateRetrieveClient(clientMode));

            InitMedicalViewerLoader(loader);

            if (__WorkstationViewer.InvokeRequired)
            {
                __WorkstationViewer.Invoke(new MethodInvoker(delegate
                {
                    __WorkstationViewer.LoadSeries(patientID,
                                                   studyInstanceUID,
                                                   seriesInstanceUID,
                                                   loader);
                }));
            }
            else
            {
                __WorkstationViewer.LoadSeries(patientID,
                                               studyInstanceUID,
                                               seriesInstanceUID,
                                               loader);
            }
        }
Esempio n. 3
0
        public static QueryClient CreateQueryClient(DicomClientMode clientMode)
        {
            try
            {
                switch (clientMode)
                {
                case DicomClientMode.LocalDb:
                {
                    QueryClient             client;
                    IStorageDataAccessAgent dataAccess;


                    if (!ConfigurationData.SupportLocalQueriesStore)
                    {
                        throw new InvalidOperationException("Feature is not supported.");
                    }

                    dataAccess = DataAccessServices.GetDataAccessService <IStorageDataAccessAgent> ( );

                    if (null == dataAccess)
                    {
                        throw new InvalidOperationException("Storage Service is not registered.");
                    }

                    client = new DbQueryClient(ConfigurationData.WorkstationClient.ToAeInfo( ), dataAccess);

                    client.EnableLog   = ConfigurationData.Debugging.GenerateLogFile;
                    client.LogFileName = ConfigurationData.Debugging.LogFileName;

                    return(client);
                }


                case DicomClientMode.Pacs:
                {
                    QueryClient client;
                    Leadtools.Dicom.Scu.DicomScp scp;


                    if (!ConfigurationData.SupportDicomCommunication)
                    {
                        throw new InvalidOperationException("Feature is not supported.");
                    }

                    scp = new Leadtools.Dicom.Scu.DicomScp( );

                    scp.AETitle     = ConfigurationData.ActivePacs.AETitle;
                    scp.PeerAddress = Utils.ResolveIPAddress(ConfigurationData.ActivePacs.Address);
                    scp.Port        = ConfigurationData.ActivePacs.Port;
                    scp.Timeout     = ConfigurationData.ActivePacs.Timeout;

                    client = new PacsQueryClient(ConfigurationData.WorkstationClient.ToAeInfo( ),
                                                 scp);

                    client.EnableLog   = ConfigurationData.Debugging.GenerateLogFile;
                    client.LogFileName = ConfigurationData.Debugging.LogFileName;

                    return(client);
                }

                case DicomClientMode.DicomDir:
                {
                    DicomDirQueryClient client = new DicomDirQueryClient(ConfigurationData.CurrentDicomDir);

                    return(client);
                }

                default:
                {
                    throw new NotImplementedException("Dicom Client not implemented.");
                }
                }
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false, exception.Message);

                throw;
            }
        }