Пример #1
0
        public static PacsRetrieveClient CreatePacsRetrieveClient(Leadtools.Dicom.Scu.DicomScp scp)
        {
            PacsRetrieveClient client;


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

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

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

            SetQueryClientTlsSettings(client);


            client.ValidateForDuplicateImages = !ConfigurationData.ContinueRetrieveOnDuplicateInstance;
            client.StoreRetrievedImages       = ConfigurationData.MoveToWSClient;
            client.MoveLocally       = ConfigurationData.MoveToWSClient;
            client.MoveServerAeTitle = ConfigurationData.WorkstationServiceAE;


            return(client);
        }
Пример #2
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;
            }
        }
Пример #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;
            }
        }