Example #1
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - containing actor.</param>
        /// <param name="actorName">Destination Actor Name.</param>
        public DicomStorageCommitClient(BaseActor parentActor, ActorName actorName)
            : base(parentActor, actorName, true)
        {
            _presentationContexts = new PresentationContext[1];

            PresentationContext presentationContext = new PresentationContext("1.2.840.10008.1.20.1", // Abstract Syntax Name
                "1.2.840.10008.1.2"); // Transfer Syntax Name(s)
            _presentationContexts[0] = presentationContext;
        }
Example #2
0
 private void SetActorDefaultConnectionActive(ActorName actorName)
 {
     // check if the actor has already been enabled by default
     if (ActorConnectionCollection.IsEnabled(actorName) == false)
     {
         // enable the connection by default
         ActorConnectionCollection.Add(new ActorConnection(actorName, true));
     }
 }
Example #3
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - containing actor.</param>
        /// <param name="actorName">Destination Actor Name.</param>
        public DicomMppsClient(BaseActor parentActor, ActorName actorName)
            : base(parentActor, actorName, false)
        {
            _presentationContexts = new PresentationContext[1];

            PresentationContext presentationContext = new PresentationContext("1.2.840.10008.3.1.2.3.3", // Abstract Syntax Name
                "1.2.840.10008.1.2"); // Transfer Syntax Name(s)
            _presentationContexts[0] = presentationContext;
        }
Example #4
0
        /// <summary>
        /// Publish the Transaction Available Event.
        /// </summary>
        /// <param name="actorName">Name of Actor from which the Transaction was received.</param>
        /// <param name="transaction">Transaction.</param>
        public void PublishTransactionAvailableEvent(ActorName actorName, ActorsTransaction transaction)
        {
            TransactionAvailableEventArgs transactionAvailableEvent = new TransactionAvailableEventArgs(actorName, transaction);

            if (OnTransactionAvailable != null)
            {
                OnTransactionAvailable(this, transactionAvailableEvent);
            }
        }
Example #5
0
        /// <summary>
        /// Publish the Message Available Event.
        /// </summary>
        /// <param name="localActorName">Local Actor Name.</param>
        /// <param name="remoteActorName">Remote Actor Name.</param>
        /// <param name="message">Message.</param>
        /// <param name="direction">Message direction.></param>
        public void PublishMessageAvailableEvent(ActorName localActorName, ActorName remoteActorName, Message message, MessageDirectionEnum direction)
        {
            BaseMessage baseMessage = new BaseMessage(message, direction);
            MessageAvailableEventArgs messageAvailableEvent = new MessageAvailableEventArgs(localActorName, remoteActorName, baseMessage);

            if (OnMessageAvailable != null)
            {
                OnMessageAvailable(this, messageAvailableEvent);
            }
        }
Example #6
0
        private void DisplayMessageDetails(MessageAvailableEventArgs messageAvailableEvent)
        {
            String    messageType     = String.Empty;
            ActorName localActorName  = messageAvailableEvent.LocalActorName;
            ActorName remoteActorName = messageAvailableEvent.RemoteActorName;

            if (messageAvailableEvent.Message.Message is DicomProtocolMessage)
            {
                DicomProtocolMessage dicomProtocolMessage = (DicomProtocolMessage)messageAvailableEvent.Message.Message;

                if (dicomProtocolMessage is AssociateRq)
                {
                    messageType = "AssociateRq";
                }
                else if (dicomProtocolMessage is AssociateAc)
                {
                    messageType = "AssociateAc";
                }
                else if (dicomProtocolMessage is AssociateRj)
                {
                    messageType = "AssociateRj";
                }
                else if (dicomProtocolMessage is Abort)
                {
                    messageType = "AbortRq";
                }
                else if (dicomProtocolMessage is ReleaseRq)
                {
                    messageType = "ReleaseRq";
                }
                else if (dicomProtocolMessage is ReleaseRp)
                {
                    messageType = "ReleaseRp";
                }
                else if (dicomProtocolMessage is DicomMessage)
                {
                    messageType = "DICOM Message";
                }

                if (messageAvailableEvent.Message.Direction == MessageDirectionEnum.MessageReceived)
                {
                    System.Console.WriteLine("Local: {0} - Received Message: {1} - From Remote: {2}",
                                             localActorName.TypeId,
                                             messageType,
                                             remoteActorName.TypeId);
                }
                else
                {
                    System.Console.WriteLine("Local: {0} - Sending Message: {1} - To Remote: {2} ",
                                             localActorName.TypeId,
                                             messageType,
                                             remoteActorName.TypeId);
                }
            }
        }
Example #7
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - containing actor.</param>
        /// <param name="actorName">Destination Actor Name.</param>
        public DicomStorageClient(BaseActor parentActor, ActorName actorName)
            : base(parentActor, actorName, false)
        {
            _presentationContexts = new PresentationContext[1];

            String[] transferSyntaxes = new String[1];
            transferSyntaxes[0] = "1.2.840.10008.1.2"; // Transfer Syntax Name(s)
            PresentationContext presentationContext = new PresentationContext("1.2.840.10008.5.1.4.1.1.7", // Abstract Syntax Name
                transferSyntaxes);
            _presentationContexts[0] = presentationContext;
        }
Example #8
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;
     }
 }
Example #9
0
 /// <summary>
 /// Update the given DicomServer using the Destination Actor Configuration.
 /// </summary>
 /// <param name="serverActorName">DicomServer Actor Name.</param>
 /// <param name="clientActorType">DicomClient Actor Type.</param>
 /// <param name="commonConfig">Common Configuration.</param>
 /// <param name="peerToPeerConfigCollection">Peer to Peer Configuration collection.</param>
 protected void UpdateDicomServer(ActorName serverActorName, ActorTypeEnum clientActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
 {
     foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
     {
         if ((basePeerToPeerConfig is DicomPeerToPeerConfig) &&
             (basePeerToPeerConfig.FromActorName.TypeId == serverActorName.TypeId) &&
             (basePeerToPeerConfig.ToActorName.Type == clientActorType))
         {
             DicomServer dicomServer = GetDicomServer(basePeerToPeerConfig.ToActorName);
             if (dicomServer != null)
             {
                 dicomServer.UpdateConfig(commonConfig, (DicomPeerToPeerConfig)basePeerToPeerConfig);
             }
         }
     }
 }
Example #10
0
 /// <summary>
 /// Handle an HL7 Transation from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="hl7Transaction">HL7 Transaction.</param>
 protected override void HandleTransactionFrom(ActorName actorName, Hl7Transaction hl7Transaction)
 {
     switch (actorName.Type)
     {
         case ActorTypeEnum.AdtPatientRegistration:
             // received Patient Registration [RAD-1] or
             // received Patient Update [RAD-12]
             break;
         case ActorTypeEnum.DssOrderFiller:
             // received Filler Order Management [RAD-3] or
             // received Appointment Notification [RAD-48]
             break;
         default:
             break;
     }
 }
Example #11
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - (containing actor).</param>
        /// <param name="actorName">Destination Actor Name.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">HL7 Configuration.</param>
        public Hl7Client(BaseActor parentActor, ActorName actorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config)
            : base(parentActor, actorName)
        {
            _hl7ThreadForHl7Client = new Hl7ThreadForHl7Client(this);
            DvtkHighLevelInterface.Common.Threads.ThreadManager threadManager = new DvtkHighLevelInterface.Common.Threads.ThreadManager();
            _hl7ThreadForHl7Client.Initialize(threadManager);
            _hl7ThreadForHl7Client.Options.UseResultsFileNameIndex = true;
            _hl7ThreadForHl7Client.Options.SessionId = config.SessionId;
            _hl7ThreadForHl7Client.Options.Identifier = String.Format("From_{0}_To_{1}",
                ParentActor.ActorName.TypeId,
                ActorName.TypeId);

            _triggerQueue = System.Collections.Queue.Synchronized(new System.Collections.Queue());
            _config = config;

            if (commonConfig.ResultsDirectory != System.String.Empty)
            {
                if (commonConfig.ResultsSubdirectory != System.String.Empty)
                {
                    _hl7ThreadForHl7Client.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory + "\\" + commonConfig.ResultsSubdirectory);
                }
                else
                {
                    _hl7ThreadForHl7Client.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory);
                }
            }

            // Set up the HL7 Validation Profile Store
            if ((commonConfig.Hl7ProfileDirectory != System.String.Empty) &&
                (commonConfig.Hl7ProfileStoreName != System.String.Empty))
            {
                _hl7ProfileStore = new Hl7ProfileStore(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ProfileDirectory), commonConfig.Hl7ProfileStoreName);
            }

            // Set up the HL7 Validation Context
            if (commonConfig.Hl7ValidationContextFilename != System.String.Empty)
            {
                _hl7ValidationContext = new Hl7ValidationContext(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ValidationContextFilename));
            }

            // Set up the validation Web Service
            if (commonConfig.NistWebServiceUrl != System.String.Empty)
            {
                _nistWebServiceClient = new NistWebServiceClient(commonConfig.NistWebServiceUrl);
            }
        }
Example #12
0
        /// <summary>
        /// Check if an actor connection is already enabled for the given actor name.
        /// </summary>
        /// <param name="actorName">Actor Name.</param>
        /// <returns>Boolean indicating whether the actor connection is enabled or not.</returns>
        public bool IsEnabled(ActorName actorName)
        {
            bool isEnabled = false;

            // search for connection to destination with the given actor name
            foreach (ActorConnection actorConnection in this)
            {
                if ((actorConnection.ActorName.TypeId == actorName.TypeId) &&
                    (actorConnection.IsActive == true))
                {
                    // the actor connection is enabled
                    isEnabled = true;
                }
            }

            return(isEnabled);
        }
Example #13
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - (containing actor).</param>
        /// <param name="actorName">Destination Actor Name.</param>
        /// <param name="storageCommitmentScu">Boolean indicating if this is a Storage Commitment SCU or not.</param>
        public DicomClient(BaseActor parentActor, ActorName actorName, bool storageCommitmentScu)
            : base(parentActor, actorName)
        {
            if (storageCommitmentScu == true)
            {
                _scu = new DicomStorageCommitmentScu(this);
            }
            else
            {
                _scu = new DicomScu(this);
            }

            // set up the default transfer syntaxes proposed
            _transferSyntaxes = new TransferSyntaxes(HliScp.IMPLICIT_VR_LITTLE_ENDIAN,
                HliScp.EXPLICIT_VR_LITTLE_ENDIAN,
                HliScp.EXPLICIT_VR_BIG_ENDIAN);
        }
Example #14
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="transactionNumber">Transaction Number.</param>
        /// <param name="fromActorName">Name of Actor sending Transaction.</param>
        /// <param name="toActorName">Name of Actor receiving Transaction.</param>
        /// <param name="transaction">Transaction itself.</param>
        /// <param name="resultsFilename">Results filename.</param>
        /// <param name="resultsPathname">Full Results filename - including directory.</param>
        /// <param name="nrErrors">Number of Errors in Transaction.</param>
        /// <param name="nrWarnings">Number of Warnings in Transaction.</param>
        public ActorsTransaction(int transactionNumber,
								ActorName fromActorName, 
								ActorName toActorName, 
								BaseTransaction transaction,
								System.String resultsFilename,
                                System.String resultsPathname,
                                uint nrErrors,
								uint nrWarnings)
        {
            _transactionNumber = transactionNumber;
            _fromActorName = fromActorName;
            _toActorName = toActorName;
            _transaction = transaction;
            _resultsFilename = resultsFilename;
            _resultsPathname = resultsPathname;
            _nrErrors = nrErrors;
            _nrWarnings = nrWarnings;
        }
Example #15
0
        /// <summary>
        /// Disable the connection to a specific actor.
        /// </summary>
        /// <param name="actorType">Destination actor type.</param>
        /// <param name="id">Destination actor id.</param>
        /// <returns>bool - destination disabled true/false. False indicates that the destination actor was not found.</returns>
        public bool Disable(ActorTypeEnum actorType, System.String id)
        {
            bool      disabled  = false;
            ActorName actorName = new ActorName(actorType, id);

            // search for connection to destination with the given actor name
            foreach (ActorConnection actorConnection in this)
            {
                if (actorConnection.ActorName == actorName)
                {
                    // disable this specific actor connection
                    actorConnection.IsActive = false;
                    disabled = true;
                }
            }

            return(disabled);
        }
Example #16
0
 /// <summary>
 /// Determines whether the <see cref="ActorNameCollection"/> contains a specific element.
 /// </summary>
 /// <param name="value">The <see cref="ActorName"/> to locate in the <see cref="ActorNameCollection"/>.</param>
 /// <returns>
 /// <c>true</c> if the <see cref="ActorNameCollection"/> contains the specified value;
 /// otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(ActorName value)
 {
     // If value is not of type Code, this will return false.
     return(List.Contains(value));
 }
Example #17
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="active">Active flag - true/false.</param>
 public ActorConnection(ActorName actorName, bool active)
 {
     _actorName = actorName;
     _active    = active;
 }
Example #18
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name - containing actor.</param>
 /// <param name="actorName">Destination Actor Name.</param>
 public DicomMppsServer(BaseActor parentActor, ActorName actorName)
     : base(parentActor, actorName)
 {
 }
Example #19
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 virtual void HandleTransactionFrom(ActorName actorName, DicomTransaction dicomTransaction)
 {
 }
Example #20
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name - (containing actor).</param>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <param name="commonConfig">Common Configuration.</param>
 /// <param name="config">HL7 Configuration.</param>
 public Hl7QueryServer(BaseActor parentActor, ActorName actorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config)
     : base(parentActor, actorName, commonConfig, config)
 {
 }
 /// <summary>
 /// Add a Transfer Syntax Uid that should be supported by the DICOM server handling the connection from the actor name.
 /// </summary>
 /// <param name="fromActorName">Actor Name that makes a connection to this DICOM Server.</param>
 /// <param name="transferSyntaxUid">Transfer Syntax UID - as string.</param>
 /// <remarks>The fromActorName type is always the ImageManager at the moment - no other actors connect to the Acquisition
 /// Modality at the moment. The caller does need to supply fromActorName as the Id component is not known by default.</remarks>
 public void AddTransferSyntaxSupportForDicomServer(ActorName fromActorName, System.String transferSyntaxUid)
 {
     //
     // Get the DICOM server within the acquisition modality that handles the DICOM association from the actor name.
     //
     DicomServer dicomServer = _acquisitionModality.GetDicomServer(fromActorName);
     if (dicomServer != null)
     {
         //
         // Add a transfer syntax that the DICOM Server should support.
         //
         dicomServer.AddTransferSyntax(transferSyntaxUid);
     }
 }
Example #22
0
        /// <summary>
        /// Create a Hl7 Server of the given type.
        /// </summary>
        /// <param name="hl7ServerType">Hl7 Server Type - enum.</param>
        /// <param name="toActor">To Actor instance.</param>
        /// <param name="fromActorName">From Actor Name.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">HL7 Configuration.</param>
        /// <returns>Hl7 Server.</returns>
        public static Hl7Server CreateHl7Server(Hl7ServerTypeEnum hl7ServerType, BaseActor toActor, ActorName fromActorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config)
        {
            Hl7Server hl7Server = null;

            switch (hl7ServerType)
            {
            case Hl7ServerTypeEnum.Hl7QueryServer:
                hl7Server = new Hl7QueryServer(toActor, fromActorName, commonConfig, config);
                break;

            case Hl7ServerTypeEnum.Hl7Server:
                hl7Server = new Hl7Server(toActor, fromActorName, commonConfig, config);
                break;

            case Hl7ServerTypeEnum.Unknown:
            default:
                break;
            }

            return(hl7Server);
        }
Example #23
0
        /// <summary>
        /// Create a Dicom Client of the given type.
        /// </summary>
        /// <param name="dicomClientType">Dicom Client Type - enum.</param>
        /// <param name="fromActor">From Actor instance.</param>
        /// <param name="toActorName">To Actor Name.</param>
        /// <returns>Dicom Client.</returns>
        public static DicomClient CreateDicomClient(DicomClientTypeEnum dicomClientType, BaseActor fromActor, ActorName toActorName)
        {
            DicomClient dicomClient = null;

            switch (dicomClientType)
            {
            case DicomClientTypeEnum.DicomMppsClient:
                dicomClient = new DicomMppsClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.DicomPrintClient:
                dicomClient = new DicomPrintClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.DicomQueryRetrieveClient:
                dicomClient = new DicomQueryRetrieveClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.DicomStorageCommitClient:
                dicomClient = new DicomStorageCommitClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.DicomStorageClient:
                dicomClient = new DicomStorageClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.DicomWorklistClient:
                dicomClient = new DicomWorklistClient(fromActor, toActorName);
                break;

            case DicomClientTypeEnum.Unknown:
            default:
                break;
            }

            return(dicomClient);
        }
Example #24
0
        /// <summary>
        /// Create a Dicom Server of the given type.
        /// </summary>
        /// <param name="dicomServerType">Dicom Server Type - enum.</param>
        /// <param name="toActor">To Actor instance.</param>
        /// <param name="fromActorName">From Actor Name.</param>
        /// <returns>Dicom Server.</returns>
        public static DicomServer CreateDicomServer(DicomServerTypeEnum dicomServerType, BaseActor toActor, ActorName fromActorName)
        {
            DicomServer dicomServer = null;

            switch (dicomServerType)
            {
            case DicomServerTypeEnum.DicomMppsServer:
                dicomServer = new DicomMppsServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.DicomPrintServer:
                dicomServer = new DicomPrintServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.DicomQueryRetrieveServer:
                dicomServer = new DicomQueryRetrieveServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.DicomStorageCommitServer:
                dicomServer = new DicomStorageCommitServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.DicomStorageServer:
                dicomServer = new DicomStorageServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.DicomWorklistServer:
                dicomServer = new DicomWorklistServer(toActor, fromActorName);
                break;

            case DicomServerTypeEnum.Unknown:
            default:
                break;
            }

            return(dicomServer);
        }
Example #25
0
        /// <summary>
        /// Create an Hl7 Client of the given type.
        /// </summary>
        /// <param name="hl7ClientType">Hl7 Client Type - enum.</param>
        /// <param name="fromActor">From Actor instance.</param>
        /// <param name="toActorName">To Actor Name.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">HL7 Configuration.</param>
        /// <returns>Hl7 Client.</returns>
        public static Hl7Client CreateHl7Client(Hl7ClientTypeEnum hl7ClientType, BaseActor fromActor, ActorName toActorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config)
        {
            Hl7Client hl7Client = null;

            switch (hl7ClientType)
            {
            case Hl7ClientTypeEnum.Hl7Client:
                hl7Client = new Hl7Client(fromActor, toActorName, commonConfig, config);
                break;

            case Hl7ClientTypeEnum.Unknown:
            default:
                break;
            }

            return(hl7Client);
        }
Example #26
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="aeTitle">Actor AE Title.</param>
 /// <param name="ipAddress">Ip Address.</param>
 public ToActorNode(ActorName actorName, System.String aeTitle, System.String ipAddress) : base(actorName, aeTitle)
 {
     _ipAddress = ipAddress;
 }
Example #27
0
 /// <summary>
 /// Get the DicomClient that corresponds with the Destination Actor Name.
 /// </summary>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <returns>DicomClient.</returns>
 public DicomClient GetDicomClient(ActorName actorName)
 {
     return((DicomClient)_dicomClients[actorName.TypeId]);
 }
Example #28
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="iheFramework">Ihe Framework container.</param>
 public BaseActor(ActorName actorName, Dvtk.IheActors.IheFramework.IheFramework iheFramework)
 {
     _actorName    = actorName;
     _iheFramework = iheFramework;
     InitActor();
 }
Example #29
0
 /// <summary>
 /// Searches for the specified <see cref="ActorName"/> and
 /// returns the zero-based index of the first occurrence within the entire <see cref="ActorNameCollection"/>.
 /// </summary>
 /// <param name="value">The <see cref="ActorName"/> to locate in the <see cref="ActorNameCollection"/>.</param>
 /// <returns>
 /// The zero-based index of the first occurrence of value within the entire <see cref="ActorNameCollection"/>,
 /// if found; otherwise, -1.
 /// </returns>
 public int IndexOf(ActorName value)
 {
     return(List.IndexOf(value));
 }
Example #30
0
 /// <summary>
 /// Get the DicomServer that corresponds with the Destination Actor Name.
 /// </summary>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <returns>DicomServer.</returns>
 public DicomServer GetDicomServer(ActorName actorName)
 {
     return((DicomServer)_dicomServers[actorName.TypeId]);
 }
Example #31
0
 /// <summary>
 /// Removes the first occurrence of a specific <see cref="ActorName"/> from the <see cref="ActorNameCollection"/>.
 /// </summary>
 /// <param name="value">The <see cref="ActorName"/> to remove from the <see cref="ActorNameCollection"/>.</param>
 public void Remove(ActorName value)
 {
     List.Remove(value);
 }
Example #32
0
 /// <summary>
 /// Get the HL7Client that corresponds with the Destination Actor Name.
 /// </summary>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <returns>Hl7Vlient.</returns>
 public Hl7Client GetHl7Client(ActorName actorName)
 {
     return((Hl7Client)_hl7Clients[actorName.TypeId]);
 }
Example #33
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="actorName">Event source Actor Name.</param>
 /// <param name="transaction">Transaction.</param>
 public TransactionAvailableEventArgs(ActorName actorName, ActorsTransaction transaction)
 {
     _actorName   = actorName;
     _transaction = transaction;
 }
Example #34
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 public ActorNode()
 {
     _actorName = null;
     _aeTitle   = System.String.Empty;
 }
 /// <summary>
 /// Clear the Transfer Syntaxes supported by the DICOM server handling the connection from the actor name.
 /// </summary>
 /// <param name="fromActorName">Actor Name that makes a connection to this DICOM Server.</param>
 /// <remarks>The fromActorName type is always the ImageManager at the moment - no other actors connect to the Acquisition
 /// Modality at the moment. The caller does need to supply fromActorName as the Id component is not known by default.
 /// 
 /// The caller is responsible for setting at least one new Transfer Syntax UID via the AddTransferSyntaxSupportForDicomServer()
 /// method after making this method call.</remarks>
 public void ClearTransferSyntaxSupportForDicomServer(ActorName fromActorName)
 {
     //
     // Get the DICOM server within the acquisition modality that handles the DICOM association from the actor name.
     //
     DicomServer dicomServer = _acquisitionModality.GetDicomServer(fromActorName);
     if (dicomServer != null)
     {
         //
         // Clear the transfer syntax support for the DICOM Server.
         //
         dicomServer.ClearTransferSyntaxes();
     }
 }
Example #36
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="aeTitle">Actor AE Title.</param>
 public ActorNode(ActorName actorName, System.String aeTitle)
 {
     _actorName = actorName;
     _aeTitle   = aeTitle;
 }
Example #37
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;
            }
        }
Example #38
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name - containing actor.</param>
 /// <param name="actorName">Destination Actor Name.</param>
 public DicomStorageServer(BaseActor parentActor, ActorName actorName)
     : base(parentActor, actorName)
 {
 }
Example #39
0
 /// <summary>
 /// Get the HL7Server that corresponds with the Destination Actor Name.
 /// </summary>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <returns>Hl7Server.</returns>
 public Hl7Server GetHl7Server(ActorName actorName)
 {
     return((Hl7Server)_hl7Servers[actorName.TypeId]);
 }
Example #40
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name - containing actor.</param>
 /// <param name="actorName">Destination Actor Name.</param>
 public DicomWorklistServer(BaseActor parentActor, ActorName actorName)
     : base(parentActor, actorName)
 {
 }
Example #41
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="aeTitle">Actor AE Title.</param>
 /// <param name="ipAddress">Ip Address.</param>
 public ToActorNode(ActorName actorName, System.String aeTitle, System.String ipAddress)
     : base(actorName, aeTitle)
 {
     _ipAddress = ipAddress;
 }
 /// <summary>
 /// Set the Associate Reject Parameters for the given DICOM Server within the Acquisition Modality.
 /// </summary>
 /// <param name="fromActorName">Actor Name that makes a connection to this DICOM Server.</param>
 /// <param name="result">Reject Result.</param>
 /// <param name="source">Reject Source.</param>
 /// <param name="reason">Reject Reason.</param>
 /// <remarks>The fromActorName type is always the ImageManager at the moment - no other actors connect to the Acquisition
 /// Modality at the moment. The caller does need to supply fromActorName as the Id component is not known by default.</remarks>
 public void SetAssociationRejectParametersForDicomServer(ActorName fromActorName, byte result, byte source, byte reason)
 {
     //
     // Get the DICOM server within the acquisition modality that handles the DICOM association from the actor name.
     //
     DicomServer dicomServer = _acquisitionModality.GetDicomServer(fromActorName);
     if (dicomServer != null)
     {
         //
         // Set the reject parameters
         //
         dicomServer.SetRejectParameters(result, source, reason);
     }
 }
Example #43
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="actorType">Actor Type.</param>
 /// <param name="id">Actor Id.</param>
 /// <param name="active">Active flag - true/false.</param>
 public ActorConnection(ActorTypeEnum actorType, System.String id, bool active)
 {
     _actorName = new ActorName(actorType, id);
     _active    = active;
 }
Example #44
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name (containing Actor).</param>
 /// <param name="actorName">Destination Actor Name.</param>
 public BaseClient(BaseActor parentActor, ActorName actorName)
 {
     _parentActor = parentActor;
     _actorName   = actorName;
 }
Example #45
0
 /// <summary>
 /// Adds an object to the end of the <see cref="ActorNameCollection"/>.
 /// </summary>
 /// <param name="value">The <see cref="ActorName"/> to be added to the end of the <see cref="ActorNameCollection"/>.</param>
 /// <returns>The <see cref="ActorNameCollection"/> index at which the value has been added.</returns>
 public int Add(ActorName value)
 {
     return(List.Add(value));
 }
Example #46
0
        /// <summary>
        /// Get the name of the indexed file in the DICOM Storage Directory
        /// fromActorName. The filename can then be used to further access
        /// the file.
        /// </summary>
        /// <param name="fromActorName">From actor name.</param>
        /// <param name="index">Zero based index from directory System.IO.FileInfo[].</param>
        /// <returns>Full filename for indexed DICOM file.</returns>
        public String GetDicomStoreDataFilename(ActorName fromActorName, int index)
        {
            String dicomStoreDataFilename = String.Empty;

            try
            {
                String storeDataDirectory = GetDicomStoreDataDirectory(fromActorName);
                DirectoryInfo directoryInfo = new DirectoryInfo(storeDataDirectory);
                if (directoryInfo != null)
                {
                    // get the indexed filename
                    FileInfo[] fileInfo = directoryInfo.GetFiles();
                    dicomStoreDataFilename = fileInfo[index].FullName;
                }
            }
            catch (System.Exception)
            {
            }

            return dicomStoreDataFilename;
        }
Example #47
0
 /// <summary>
 /// Inserts an <see cref="ActorName"/> element into the <see cref="ActorNameCollection"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The <see cref="ActorName"/> to insert.</param>
 public void Insert(int index, ActorName value)
 {
     List.Insert(index, value);
 }
Example #48
0
        /// <summary>
        /// Get the number of files currently stored in the DICOM
        /// Storage Directory fromActorName.
        /// </summary>
        /// <param name="fromActorName">From actor name.</param>
        /// <returns>Number of files in directory.</returns>
        public int GetNoDicomStoreDataFiles(ActorName fromActorName)
        {
            int noDicomStoreDataFiles = 0;

            try
            {
                String storeDataDirectory = GetDicomStoreDataDirectory(fromActorName);
                DirectoryInfo directoryInfo = new DirectoryInfo(storeDataDirectory);
                if (directoryInfo != null)
                {
                    // get the number of files stored in the directory
                    FileInfo [] fileInfo = directoryInfo.GetFiles();
                    noDicomStoreDataFiles = fileInfo.Length;
                }
            }
            catch (System.Exception)
            {
            }

            return noDicomStoreDataFiles;
        }
Example #49
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="parentActor">Parent Actor Name - containing actor.</param>
 /// <param name="actorName">Destination Actor Name.</param>
 public DicomStorageCommitServer(BaseActor parentActor, ActorName actorName)
     : base(parentActor, actorName)
 {
     // set up the Query/Retrieve information models
     _informationModels = new QueryRetrieveInformationModels();
 }
Example #50
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;
     }
 }
Example #51
0
 /// <summary>
 /// Add response trigger to server.
 /// </summary>
 /// <param name="actorName">Destination Actor Name.</param>
 /// <param name="trigger">Trigger message.</param>
 public void AddResponseTrigger(ActorName actorName, BaseTrigger trigger)
 {
     Hl7Trigger hl7Trigger = (Hl7Trigger) trigger;
     _responseList.Add(hl7Trigger);
 }
Example #52
0
        /// <summary>
        /// Delete all the files in the DICOM Store Data Directory used by
        /// the Dicom Server for objects received fromActorName.
        /// </summary>
        /// <param name="fromActorName">From actor name.</param>
        /// <returns>Boolean indicating success or failure.</returns>
        public bool ClearDicomStoreDataDirectory(ActorName fromActorName)
        {
            bool cleared = false;

            try
            {
                String storeDataDirectory = GetDicomStoreDataDirectory(fromActorName);
                DirectoryInfo directoryInfo = new DirectoryInfo(storeDataDirectory);
                if (directoryInfo != null)
                {
                    // delete the directory and all its contents
                    directoryInfo.Delete(true);

                    // re-create the directory
                    directoryInfo.Create();
                    cleared = true;
                }
            }
            catch (System.Exception)
            {
            }

            return cleared;
        }
 /// <summary>
 /// Add a Transfer Syntax Uid that should be proposed by the local DICOM client handling the connection to the actor name.
 /// </summary>
 /// <param name="toActorName">Actor Name that receives a connection from this DICOM Client.</param>
 /// <param name="transferSyntaxUid">Transfer Syntax UID - as string.</param>
 public void AddTransferSyntaxProposalForDicomClient(ActorName toActorName, System.String transferSyntaxUid)
 {
     //
     // Get the DICOM client within the acquisition modality that handles the DICOM association to the actor name.
     //
     DicomClient dicomClient = _acquisitionModality.GetDicomClient(toActorName);
     if (dicomClient != null)
     {
         //
         // Add a transfer syntax that the DICOM Client should propose.
         //
         dicomClient.AddTransferSyntax(transferSyntaxUid);
     }
 }
Example #54
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="actorName">Actor Name.</param>
 /// <param name="active">Active flag - true/false.</param>
 public ActorConnection(ActorName actorName, bool active)
 {
     _actorName = actorName;
     _active = active;
 }
 /// <summary>
 /// Clear the Transfer Syntaxes proposed by the DICOM client making the connection to the actor name.
 /// </summary>
 /// <param name="toActorName">Actor Name that receives a connection to from DICOM Client.</param>
 /// <remarks>The caller is responsible for setting at least one new Transfer Syntax UID via the AddTransferSyntaxProposalForDicomClient()
 /// method after making this method call.</remarks>
 public void ClearTransferSyntaxProposalForDicomClient(ActorName toActorName)
 {
     //
     // Get the DICOM client within the acquisition modality that handles the DICOM association to the actor name.
     //
     DicomClient dicomClient = _acquisitionModality.GetDicomClient(toActorName);
     if (dicomClient != null)
     {
         //
         // Clear the transfer syntax proposed by the DICOM Client.
         //
         dicomClient.ClearTransferSyntaxes();
     }
 }
Example #56
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="actorType">Actor Type.</param>
 /// <param name="id">Actor Id.</param>
 /// <param name="active">Active flag - true/false.</param>
 public ActorConnection(ActorTypeEnum actorType, System.String id, bool active)
 {
     _actorName = new ActorName(actorType, id);
     _active =  active;
 }
        /// <summary>
        /// Initialize the acquisition modality actor
        /// </summary>
        public void Initialize()
        {
            //
            // Apply the Configuration to actors
            //
            iheFrameworkInstance.ApplyConfig();

            //
            // Get the Acquisition Modality actor
            ActorName actor = new ActorName(ActorTypeEnum.AcquisitionModality, "Modality");
            _acquisitionModality = (AcquisitionModalityActor) iheFrameworkInstance.GetActor(actor);
            if (_acquisitionModality == null)
            {
                throw new System.SystemException("Acquisition Modality not configured");
            }

            //Clear previous mappings
            _acquisitionModality.MapWorklistItemToStorageDirectory.ClearMappings();

            // Set up worklist item - storage directory mapping
            _acquisitionModality.MapWorklistItemToStorageDirectory.MapTag = Tag.SCHEDULED_PROCEDURE_STEP_DESCRIPTION;
            _acquisitionModality.MapWorklistItemToStorageDirectory.AddMapping("Default",
                iheFrameworkInstance.Config.CommonConfig.RootedBaseDirectory + @"\data\acquisitionModality\default");

            // Subscribe events
            SubscribeMessageEvent();
            SubscribeTransactionEvent();

            //
            // Open the results after loading the configuration so that the results directory is defined
            //
            iheFrameworkInstance.OpenResults();

            //
            // Start the integration profile test
            //
            iheFrameworkInstance.StartTest();
        }
Example #58
0
 /// <summary>
 /// Handle an HL7 Transation from the given Actor Name.
 /// </summary>
 /// <param name="actorName">Source Actor Name.</param>
 /// <param name="hl7Transaction">HL7 Transaction.</param>
 protected virtual void HandleTransactionFrom(ActorName actorName, Hl7Transaction hl7Transaction)
 {
 }
 /// <summary>
 /// Set the way in which the Acquisition Modality should respond to an Associate Request from the actor name.
 /// </summary>
 /// <param name="fromActorName">Actor Name that makes a connection to this DICOM Server.</param>
 /// <param name="respondEnum">Enum defining how to respond.</param>
 /// <remarks>The fromActorName type is always the ImageManager at the moment - no other actors connect to the Acquisition
 /// Modality at the moment. The caller does need to supply fromActorName as the Id component is not known by default.</remarks>
 public void SetRespondToAssociateRequestForDicomServer(ActorName fromActorName, HliScp.ScpRespondToAssociateRequestEnum respondEnum)
 {
     //
     // Get the DICOM server within the acquisition modality that handles the DICOM association from the actor name.
     //
     DicomServer dicomServer = _acquisitionModality.GetDicomServer(fromActorName);
     if (dicomServer != null)
     {
         //
         // Set how the DICOM Server should respond to the Associate Request from the actor name.
         //
         dicomServer.SetRespondToAssociateRequest(respondEnum);
     }
 }
Example #60
0
        /// <summary>
        /// Get the DICOM Store Data Directory for the given fromActorName.
        /// </summary>
        /// <param name="fromActorName">From Actor Name.</param>
        /// <returns>Full directory name for DICOM Store Data.</returns>
        public String GetDicomStoreDataDirectory(ActorName fromActorName)
        {
            String dicomStoreDataDirectory = String.Empty;

            // get the DICOM storage data directory for the given from actor name.
            DicomServer dicomServer = GetDicomServer(fromActorName);
            if (dicomServer != null)
            {
                dicomStoreDataDirectory = dicomServer.StoreDataDirectory;
            }

            return dicomStoreDataDirectory;
        }