Ejemplo n.º 1
0
        /// <summary>
        /// Add an HL7Client for the given Destination Actor Name and Configuration.
        /// </summary>
        /// <param name="hl7ClientType">Hl7 Client Type.</param>
        /// <param name="toActorType">To Actor Type.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="peerToPeerConfigCollection">Peer to Peer Configuration collection.</param>
        protected void AddHl7Client(Hl7ClientTypeEnum hl7ClientType, ActorTypeEnum toActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
        {
            foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
            {
                if ((basePeerToPeerConfig is Hl7PeerToPeerConfig) &&
                    (basePeerToPeerConfig.FromActorName.TypeId == _actorName.TypeId) &&
                    (basePeerToPeerConfig.ToActorName.Type == toActorType))
                {
                    Hl7Client hl7Client = ClientServerFactory.CreateHl7Client(hl7ClientType, this, basePeerToPeerConfig.ToActorName, commonConfig, (Hl7PeerToPeerConfig)basePeerToPeerConfig);
                    if (hl7Client != null)
                    {
                        SubscribeEvent(hl7Client);
                        _hl7Clients.Add(hl7Client.ActorName.TypeId, hl7Client);

                        // Initialize the connection with the to actor as being active.
                        // - this can always be overruled by the application later.
                        SetActorDefaultConnectionActive(basePeerToPeerConfig.ToActorName);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add the given DicomServer using the Destination Actor Configuration.
        /// </summary>
        /// <param name="dicomServerType">Dicom Server Type.</param>
        /// <param name="fromActorType">From Actor Type.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="peerToPeerConfigCollection">Peer to Peer Configuration collection.</param>
        protected void AddDicomServer(DicomServerTypeEnum dicomServerType, ActorTypeEnum fromActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
        {
            foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
            {
                if ((basePeerToPeerConfig is DicomPeerToPeerConfig) &&
                    (basePeerToPeerConfig.ToActorName.TypeId == _actorName.TypeId) &&
                    (basePeerToPeerConfig.FromActorName.Type == fromActorType))
                {
                    DicomServer dicomServer = ClientServerFactory.CreateDicomServer(dicomServerType, this, basePeerToPeerConfig.FromActorName);
                    if (dicomServer != null)
                    {
                        dicomServer.ApplyConfig(commonConfig, (DicomPeerToPeerConfig)basePeerToPeerConfig);
                        SubscribeEvent(dicomServer);
                        _dicomServers.Add(dicomServer.ActorName.TypeId, dicomServer);

                        // Initialize the connection with the from actor as being active.
                        // - this can always be overruled by the application later.
                        SetActorDefaultConnectionActive(basePeerToPeerConfig.FromActorName);
                    }
                }
            }
        }