Beispiel #1
0
        public DicomCommandStatusType OnFind
        (
            DicomClient client,
            byte presentationId,
            int messageId,
            string affectedClass,
            DicomCommandPriorityType priority,
            DicomDataSet request
        )
        {
            try
            {
                CFindClientSessionProxy sessionProxy;
                DicomCommand            command;


                _messageId      = messageId;
                _presentationId = presentationId;
                _clientSession  = new ClientSession(client);

                if (null == DicomCommandFactory.GetInitializationService(typeof(QueryCFindCommand)))
                {
                    DicomCommandFactory.RegisterCommandInitializationService(typeof(QueryCFindCommand),
                                                                             new FindCommandInitializationService( ));
                }

                sessionProxy = new CFindClientSessionProxy(_clientSession, presentationId, messageId, affectedClass);
                command      = DicomCommandFactory.GetInstance( ).CreateCFindCommand(sessionProxy, request);

                _clientSession.CFindResponse += new EventHandler <CFindResponseEventArgs> (clientSession_CFindResponse);

                _clientSession.ProcessCFindRequest(presentationId, messageId, affectedClass, priority, command).WaitOne( );;

                return(_status);
            }
            finally
            {
                if (null != request)
                {
                    request.Dispose( );
                }
            }
        }
Beispiel #2
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);
        }