예제 #1
0
파일: DicomScu.cs 프로젝트: top501/DVTK-1
        private void LogTransaction()
        {
            DicomThread dicomThread = (DicomThread)DvtkHighLevelInterface.Common.Threads.Thread.CurrentThread;

            if (dicomThread == null)
            {
                return;
            }

            if (_currentDicomTransaction == null)
            {
                return;
            }

            // save the transaction
            ActorsTransaction actorsTransaction = new ActorsTransaction(_transactionNumber,
                                                                        _dicomClient.ActorName,             // from actor
                                                                        _dicomClient.ParentActor.ActorName, // to actor
                                                                        _currentDicomTransaction,
                                                                        this.Options.ResultsFileNameOnly,
                                                                        this.Options.ResultsFullFileName,
                                                                        (uint)dicomThread.NrOfErrors,
                                                                        (uint)dicomThread.NrOfWarnings);

            // save the transaction in the Actor log
            _dicomClient.ParentActor.ActorsTransactionLog.Add(actorsTransaction);

            // publish the transaction event to any interested parties
            _dicomClient.PublishTransactionAvailableEvent(_dicomClient.ActorName, actorsTransaction);

            // remove any messages from the dicom thread
            dicomThread.ClearMessages();

            _currentDicomTransaction = null;
        }
예제 #2
0
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.PrintComposer:
             // received Print Request with Presentation LUT [RAD-23]
             break;
         default:
             break;
     }
 }
예제 #3
0
        private void LogTransaction()
        {
            DicomThread dicomThread = (DicomThread)DvtkHighLevelInterface.Common.Threads.Thread.CurrentThread;

            if (dicomThread == null)
            {
                return;
            }

            if (_currentDicomTransaction == null)
            {
                return;
            }

            // get the next transaction number - needed to sort the
            // transactions correctly
            int transactionNumber = TransactionNumber.GetNextTransactionNumber();

            // save the transaction
            ActorsTransaction actorsTransaction = new ActorsTransaction(transactionNumber,
                                                                        ActorName,             // from actor
                                                                        ParentActor.ActorName, // to actor
                                                                        _currentDicomTransaction,
                                                                        dicomThread.Options.ResultsFileNameOnly,
                                                                        dicomThread.Options.ResultsFullFileName,
                                                                        (uint)dicomThread.NrOfErrors,
                                                                        (uint)dicomThread.NrOfWarnings);

            // save the transaction in the Actor log
            ParentActor.ActorsTransactionLog.Add(actorsTransaction);

            // publish the transaction event to any interested parties
            PublishTransactionAvailableEvent(ActorName, actorsTransaction);

            // remove any messages from the dicom thread
            dicomThread.ClearMessages();

            _currentDicomTransaction = null;
        }
예제 #4
0
        /// <summary>
        /// Handle the Mesage Received Event for all messages.
        /// </summary>
        /// <param name="dicomProtocolMessage">Received DICOM Protocol Message.</param>
        public virtual void ScpMessageReceivedEventHandler(DicomProtocolMessage dicomProtocolMessage)
        {
            // Inform any interested parties that a message has been received
            PublishMessageAvailableEvent(ParentActor.ActorName, ActorName, dicomProtocolMessage, MessageDirectionEnum.MessageReceived);

            if (dicomProtocolMessage is AssociateRq)
            {
                // on receiving an associate request set up a new transaction store
                _currentDicomTransaction = new DicomTransaction(TransactionNameEnum.RAD_10, TransactionDirectionEnum.TransactionReceived);
            }
            else if (dicomProtocolMessage is Abort)
            {
                // peer has aborted the association
                LogTransaction();
            }
            else if (dicomProtocolMessage is DicomMessage)
            {
                // add the DICOM message to the transaction
                if (_currentDicomTransaction != null)
                {
                    _currentDicomTransaction.DicomMessages.Add((DicomMessage)dicomProtocolMessage);
                }
            }
        }
예제 #5
0
파일: DicomScu.cs 프로젝트: top501/DVTK-1
        /// <summary>
        /// Handle the Mesage Sending Event for all messages.
        /// </summary>
        /// <param name="dicomProtocolMessage">Received DICOM Protocol Message.</param>
        public virtual void ScuSendingMessageEventHandler(DicomProtocolMessage dicomProtocolMessage)
        {
            // Inform any interested parties that a message is being sent
            _dicomClient.PublishMessageAvailableEvent(_dicomClient.ParentActor.ActorName, _dicomClient.ActorName, dicomProtocolMessage, MessageDirectionEnum.MessageSent);

            if (dicomProtocolMessage is AssociateRq)
            {
                // on sending an associate request set up a new transaction store
                _currentDicomTransaction = new DicomTransaction(TransactionNameEnum.RAD_10, TransactionDirectionEnum.TransactionSent);
            }
            else if (dicomProtocolMessage is Abort)
            {
                // this has aborted the association
                LogTransaction();
            }
            else if (dicomProtocolMessage is DicomMessage)
            {
                // add the DICOM message to the transaction
                if (_currentDicomTransaction != null)
                {
                    _currentDicomTransaction.DicomMessages.Add((DicomMessage)dicomProtocolMessage);
                }
            }
        }
예제 #6
0
        /// <summary>
        /// Handle a Dicom Transaction from the given Actor Name.
        /// </summary>
        /// <param name="actorName">Source Actor Name.</param>
        /// <param name="dicomTransaction">Dicom Transaction.</param>
        protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
        {
            switch (actorName.Type)
            {
                case ActorTypeEnum.AcquisitionModality:
                    // received Modality Procedure Step In Progress [RAD-6] or
                    // received Modality Procedur Step Completed [RAD-7]
                case ActorTypeEnum.EvidenceCreator:
                {

                    // received Creator Procedure Step In Progress [RAD-20] or
                    // received Creator Procedure Step Completed [RAD-21]
                    TransactionNameEnum transactionName = dicomTransaction.TransactionName;
                    DicomMessage dicomMessage = (DicomMessage)dicomTransaction.DicomMessages[0];

                    // ignore the C-ECHO-RQ used in the Verification SOP Class
                    // - no need to forward this
                    if (dicomMessage.CommandSet.DimseCommand != DvtkData.Dimse.DimseCommand.CECHORQ)
                    {
                        // make a trigger from the transaction message
                        DicomTrigger dicomTrigger = new DicomTrigger(transactionName);
                        dicomTrigger.AddItem(dicomMessage,
                            "1.2.840.10008.3.1.2.3.3",
                            "1.2.840.10008.1.2");

                        // trigger the following actors
                        bool triggerResult = TriggerActorInstances(ActorTypeEnum.DssOrderFiller, dicomTrigger, false);
                        if (triggerResult == true)
                        {
                            triggerResult = TriggerActorInstances(ActorTypeEnum.ImageManager, dicomTrigger, false);
                        }
                    }
                    break;
                }
                default:
                    break;
            }
        }
예제 #7
0
파일: DicomScu.cs 프로젝트: ewcasas/DVTK
        private void LogTransaction()
        {
            DicomThread dicomThread = (DicomThread)DvtkHighLevelInterface.Common.Threads.Thread.CurrentThread;
            if (dicomThread == null) return;

            if (_currentDicomTransaction == null) return;

            // save the transaction
            ActorsTransaction actorsTransaction = new ActorsTransaction(_transactionNumber,
                _dicomClient.ActorName, // from actor
                _dicomClient.ParentActor.ActorName,  // to actor
                _currentDicomTransaction,
                this.Options.ResultsFileNameOnly,
                this.Options.ResultsFullFileName,
                (uint)dicomThread.NrOfErrors,
                (uint)dicomThread.NrOfWarnings);

            // save the transaction in the Actor log
            _dicomClient.ParentActor.ActorsTransactionLog.Add(actorsTransaction);

            // publish the transaction event to any interested parties
            _dicomClient.PublishTransactionAvailableEvent(_dicomClient.ActorName, actorsTransaction);

            // remove any messages from the dicom thread
            dicomThread.ClearMessages();

            _currentDicomTransaction = null;
        }
예제 #8
0
파일: DicomScu.cs 프로젝트: ewcasas/DVTK
        /// <summary>
        /// Handle the Mesage Sending Event for all messages.
        /// </summary>
        /// <param name="dicomProtocolMessage">Received DICOM Protocol Message.</param>
        public virtual void ScuSendingMessageEventHandler(DicomProtocolMessage dicomProtocolMessage)
        {
            // Inform any interested parties that a message is being sent
            _dicomClient.PublishMessageAvailableEvent(_dicomClient.ParentActor.ActorName, _dicomClient.ActorName, dicomProtocolMessage, MessageDirectionEnum.MessageSent);

            if (dicomProtocolMessage is AssociateRq)
            {
                // on sending an associate request set up a new transaction store
                _currentDicomTransaction = new DicomTransaction(TransactionNameEnum.RAD_10, TransactionDirectionEnum.TransactionSent);

            }
            else if (dicomProtocolMessage is Abort)
            {
                // this has aborted the association
                LogTransaction();
            }
            else if (dicomProtocolMessage is DicomMessage)
            {
                // add the DICOM message to the transaction
                if (_currentDicomTransaction != null)
                {
                    _currentDicomTransaction.DicomMessages.Add((DicomMessage)dicomProtocolMessage);
                }
            }
        }
예제 #9
0
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.ImageArchive:
             // received Retrieve Images [RAD-16]
             break;
         default:
             break;
     }
 }
예제 #10
0
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.AcquisitionModality:
             // received Modality Images Stored [RAD-8]
             break;
         case ActorTypeEnum.EvidenceCreator:
             // received Creator Images Stored [RAD-18]
             break;
         case ActorTypeEnum.ImageDisplay:
             // received Query Images [RAD-14] or
             // received Retrieve Images [RAD-16]
             break;
         default:
             break;
     }
 }
예제 #11
0
파일: DicomServer.cs 프로젝트: ewcasas/DVTK
        private void LogTransaction()
        {
            DicomThread dicomThread = (DicomThread)DvtkHighLevelInterface.Common.Threads.Thread.CurrentThread;
            if (dicomThread == null) return;

            if (_currentDicomTransaction == null) return;

            // get the next transaction number - needed to sort the
            // transactions correctly
            int transactionNumber = TransactionNumber.GetNextTransactionNumber();

            // save the transaction
            ActorsTransaction actorsTransaction = new ActorsTransaction(transactionNumber,
                ActorName,  // from actor
                ParentActor.ActorName,  // to actor
                _currentDicomTransaction,
                dicomThread.Options.ResultsFileNameOnly,
                dicomThread.Options.ResultsFullFileName,
                (uint)dicomThread.NrOfErrors,
                (uint)dicomThread.NrOfWarnings);

            // save the transaction in the Actor log
            ParentActor.ActorsTransactionLog.Add(actorsTransaction);

            // publish the transaction event to any interested parties
            PublishTransactionAvailableEvent(ActorName, actorsTransaction);

            // remove any messages from the dicom thread
            dicomThread.ClearMessages();

            _currentDicomTransaction = null;
        }
예제 #12
0
파일: DicomServer.cs 프로젝트: ewcasas/DVTK
        /// <summary>
        /// Handle the Mesage Received Event for all messages.
        /// </summary>
        /// <param name="dicomProtocolMessage">Received DICOM Protocol Message.</param>
        public virtual void ScpMessageReceivedEventHandler(DicomProtocolMessage dicomProtocolMessage)
        {
            // Inform any interested parties that a message has been received
            PublishMessageAvailableEvent(ParentActor.ActorName, ActorName, dicomProtocolMessage, MessageDirectionEnum.MessageReceived);

            if (dicomProtocolMessage is AssociateRq)
            {
                // on receiving an associate request set up a new transaction store
                _currentDicomTransaction = new DicomTransaction(TransactionNameEnum.RAD_10, TransactionDirectionEnum.TransactionReceived);
            }
            else if (dicomProtocolMessage is Abort)
            {
                // peer has aborted the association
                LogTransaction();
            }
            else if (dicomProtocolMessage is DicomMessage)
            {
                // add the DICOM message to the transaction
                if (_currentDicomTransaction != null)
                {
                    _currentDicomTransaction.DicomMessages.Add((DicomMessage)dicomProtocolMessage);
                }
            }
        }
예제 #13
0
파일: BaseActor.cs 프로젝트: ewcasas/DVTK
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected virtual void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
 }
예제 #14
0
        /// <summary>
        /// Handle a Dicom Transaction from the given Actor Name.
        /// </summary>
        /// <param name="actorName">Source Actor Name.</param>
        /// <param name="dicomTransaction">Dicom Transaction.</param>
        protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
        {
            switch (actorName.Type)
            {
                case ActorTypeEnum.ImageManager:
                    // received Storage Commitment [RAD-10]
                    DicomMessageCollection nEventReportRequests = dicomTransaction.DicomMessages.NEventReportRequests;

                    foreach(DvtkHighLevelInterface.Dicom.Messages.DicomMessage dicomMessage in nEventReportRequests)
                    {
                        // Update the storage commit items with the appropriate status - as received in the
                        // event report request
                        GenerateTriggers.HandleNEventReportStorageCommitment(_storageCommitItems, dicomMessage);
                    }
                    break;
                default:
                    break;
            }
        }
예제 #15
0
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.AcquisitionModality:
             // received Query Modality Worklist [RAD-5]
             break;
         case ActorTypeEnum.PerformedProcedureStepManager:
             // received Modality Procedure Step In Progress [RAD-6] or
             // received Modality Procedure Step Completed [RAD-7] or
             // received Creator Procedure Step In Progress [RAD-20] or
             // received Creator Procedure Step Completed [RAD-21]
             break;
         case ActorTypeEnum.ImageManager:
             // received Instance Availability Notification [RAD-49]
             break;
         default:
             break;
     }
 }
예제 #16
0
 /// <summary>
 /// Handle a Dicom Transaction from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="dicomTransaction">Dicom Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.DssOrderFiller:
             // received Image Availability Query [RAD-11] or
             // received Performed Work Status Update [RAD-42]
             break;
         case ActorTypeEnum.PerformedProcedureStepManager:
             // received Modality Procedure Step In Progress [RAD-6] or
             // received Modality Procedure Step Completed [RAD-7] or
             // received Creator Procedure Step In Progress [RAD-20] or
             // received Creator Procedure Step Completed [RAD-21]
             break;
         case ActorTypeEnum.AcquisitionModality:
             // received Storage Commitment [RAD-10]
             break;
         case ActorTypeEnum.EvidenceCreator:
             // received Storage Commitment [RAD-10]
             break;
         case ActorTypeEnum.ReportManager:
             // received Image Availability Query [RAD-11]
             break;
         default:
             break;
     }
 }