Пример #1
0
        public void Configure(System.Windows.Forms.IWin32Window Parent, Leadtools.Dicom.AddIn.Common.ServerSettings Settings, string ServerDirectory)
        {
            DatabaseEditorDialog        configurationDialog;
            AdvancedSettings            addInsSettings;
            WorklistAddInsConfiguration worklistSettings;

            AddInsSession.InitializeLicense();
            if (Settings != null)
            {
                PacsProduct.ServiceName = Settings.ServiceName;
            }
            Leadtools.Dicom.DicomEngine.Startup();

            addInsSettings      = AdvancedSettings.Open(ServerDirectory);
            worklistSettings    = GetWorklistAddInsSettings(addInsSettings);
            configurationDialog = new DatabaseEditorDialog();

            configurationDialog.AddInsSettings = worklistSettings;

            Leadtools.Demos.Messager.Caption = Text;

            configurationDialog.ShowDialog();

            addInsSettings.Save();

            Leadtools.Dicom.DicomEngine.Shutdown();
        }
Пример #2
0
        void license_LicenseChanged(object sender, EventArgs e)
        {
            if (!AddInsSession.IsLicenseValid())
            {
                DicomServer server = ServiceLocator.Retrieve <DicomServer>();

                Logger.Global.SystemMessage(LogType.Information, "Worklist license is valid.", server.AETitle);
            }
        }
        public DicomCommandStatusType OnNSet
        (
            DicomClient Client,
            byte presentationID,
            int messageID,
            string affectedClass,
            string instance,
            DicomDataSet Request,
            DicomDataSet Response
        )
        {
            ClientSession          clientSession;
            NSetClientSessionProxy sessionProxy;
            DicomCommand           mppsCommand;

            if (!AddInsSession.IsLicenseValid())
            {
                Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid.  Worklist set cannot be performed", Client.AETitle);
                return(DicomCommandStatusType.ProcessingFailure);
            }

            clientSession = new ClientSession(Client);
            sessionProxy  = new NSetClientSessionProxy(clientSession, presentationID, messageID, affectedClass, instance);

            if (null == DicomCommandFactory.GetInitializationService(typeof(MppsNSetCommand)))
            {
                DicomCommandFactory.RegisterCommandInitializationService(typeof(MppsNSetCommand),
                                                                         new MppsSetCommandInitializationService( ));
            }

            mppsCommand = DicomCommandFactory.GetInstance( ).CreateNSetCommand(sessionProxy, Request);

            _clientSession = clientSession;
            _sessionProxy  = sessionProxy;

            clientSession.NSetResponse += new EventHandler <NSetResponseEventArgs>(clientSession_NSetResponse);

            clientSession.ProcessNSetRequest(presentationID, messageID, affectedClass, instance, mppsCommand).WaitOne( );

            Response = _response;

            return(_status);
        }
Пример #4
0
        public override void Load(string serviceDirectory, string displayName)
        {
            List <string> unlockedSerivces;
            DicomService  service;

            InitializeLicense();
            base.Load(serviceDirectory, displayName);

            unlockedSerivces = new List <string> ( );
            ServiceDirectory = serviceDirectory;
            DisplayName      = displayName;

            RegisterDataAccessAgents(displayName);

            unlockedSerivces.Add(displayName);

            using (ServiceAdministrator serviceAdmin = new ServiceAdministrator(serviceDirectory))
            {
                //Add the key
#if LEADTOOLS_V175_OR_LATER
                serviceAdmin.Initialize(unlockedSerivces);
#else
                serviceAdmin.Unlock(string.Empty, unlockedSerivces);
#endif

                if (serviceAdmin.Services.ContainsKey(displayName))
                {
                    service = serviceAdmin.Services [displayName];

                    ServerAE      = service.Settings.AETitle;
                    ServerAddress = service.Settings.IpAddress;
                    ServerPort    = service.Settings.Port;
                }
            }

            if (!AddInsSession.IsLicenseValid())
            {
                DicomServer server = ServiceLocator.Retrieve <DicomServer>();

                Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid.  Worklist search cannot be performed", server.AETitle);
            }
        }
Пример #5
0
        public DicomCommandStatusType OnFind
        (
            DicomClient Client,
            byte PresentationId,
            int MessageId,
            string AffectedClass,
            DicomCommandPriorityType Priority,
            DicomDataSet Request
        )
        {
            ClientSession           clientSession;
            CFindClientSessionProxy sessionProxy;
            DicomCommand            mwlCommand;

            if (!AddInsSession.IsLicenseValid())
            {
                Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid.  Worklist search cannot be performed", Client.AETitle);
                return(DicomCommandStatusType.ProcessingFailure);
            }

            clientSession = new ClientSession(Client);
            sessionProxy  = new CFindClientSessionProxy(clientSession, PresentationId, MessageId, AffectedClass);

            if (null == DicomCommandFactory.GetInitializationService(typeof(MWLCFindCommand)))
            {
                DicomCommandFactory.RegisterCommandInitializationService(typeof(MWLCFindCommand),
                                                                         new MWLCommandInitializationService( ));
            }

            mwlCommand = DicomCommandFactory.GetInstance( ).CreateCFindCommand(sessionProxy, Request);

            _clientSession = clientSession;
            _sessionProxy  = sessionProxy;

            clientSession.CFindResponse += new EventHandler <Leadtools.Dicom.Scp.CFindResponseEventArgs> (clientSession_CFindResponse);

            clientSession.ProcessCFindRequest(PresentationId, MessageId, AffectedClass, Priority, mwlCommand).WaitOne( );

            return(_status);
        }
Пример #6
0
        public DicomCommandStatusType OnNCreate
        (
            DicomClient Client,
            byte presentationID,
            int messageID,
            string affectedClass,
            string instance,
            DicomDataSet Request,
            DicomDataSet Response
        )
        {
            try
            {
                ClientSession      clientSession;
                MppsNCreateCommand mppsCommand;

                if (!AddInsSession.IsLicenseValid())
                {
                    Logger.Global.SystemMessage(LogType.Information, "Worklist license not valid.  Worklist creation cannot be performed", Client.AETitle);
                    return(DicomCommandStatusType.ProcessingFailure);
                }


                clientSession = new ClientSession(Client);
                _sessionProxy = new NCreateClientSessionProxy(clientSession, presentationID, messageID, affectedClass, instance);

                if (null == DicomCommandFactory.GetInitializationService(typeof(MppsNCreateCommand)))
                {
                    DicomCommandFactory.RegisterCommandInitializationService(typeof(MppsNCreateCommand),
                                                                             new MppsCreateCommandInitializationService( ));
                }

                mppsCommand = DicomCommandFactory.GetInstance( ).CreateTypedCommand <MppsNCreateCommand> (_sessionProxy, Request);

                clientSession.NCreateResponse += new EventHandler <NCreateResponseEventArgs>(clientSession_NCreateResponse);
                mppsCommand.PPSConfiguration.ValidateRelationalAttributesAccordingToIHE = true;

                _response = Response;

                clientSession.ProcessNCreateRequest(presentationID, messageID, affectedClass, instance, mppsCommand).WaitOne( );

                return(_status);
            }
            catch (Exception exception)
            {
                Logger.Global.Log(Client.Server.AETitle,
                                  Client.Server.HostAddress,
                                  Client.Server.Port,
                                  Client.AETitle,
                                  Client.PeerAddress,
                                  Client.PeerPort,
                                  DicomCommandType.NCreate,
                                  DateTime.Now,
                                  LogType.Error,
                                  MessageDirection.Input,
                                  "NCreate Failed: " + exception.Message,
                                  Request,
                                  null);
                throw;
            }
        }