示例#1
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);
        }
示例#2
0
        /// <summary>
        /// Add an HL7Server for the given Destination Actor Name and Configuration.
        /// </summary>
        /// <param name="hl7ServerType">Hl7 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 AddHl7Server(Hl7ServerTypeEnum hl7ServerType, ActorTypeEnum fromActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
        {
            foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
            {
                if ((basePeerToPeerConfig is Hl7PeerToPeerConfig) &&
                    (basePeerToPeerConfig.ToActorName.TypeId == _actorName.TypeId) &&
                    (basePeerToPeerConfig.FromActorName.Type == fromActorType))
                {
                    Hl7Server hl7Server = ClientServerFactory.CreateHl7Server(hl7ServerType, this, basePeerToPeerConfig.FromActorName, commonConfig, (Hl7PeerToPeerConfig)basePeerToPeerConfig);
                    if (hl7Server != null)
                    {
                        SubscribeEvent(hl7Server);
                        _hl7Servers.Add(hl7Server.ActorName.TypeId, hl7Server);

                        // Initialize the connection with the from actor as being active.
                        // - this can always be overruled by the application later.
                        SetActorDefaultConnectionActive(basePeerToPeerConfig.FromActorName);
                    }
                }
            }
        }
示例#3
0
文件: BaseActor.cs 项目: ewcasas/DVTK
        /// <summary>
        /// Add an HL7Server for the given Destination Actor Name and Configuration.
        /// </summary>
        /// <param name="hl7ServerType">Hl7 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 AddHl7Server(Hl7ServerTypeEnum hl7ServerType, ActorTypeEnum fromActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
        {
            foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
            {
                if ((basePeerToPeerConfig is Hl7PeerToPeerConfig) &&
                    (basePeerToPeerConfig.ToActorName.TypeId == _actorName.TypeId) &&
                    (basePeerToPeerConfig.FromActorName.Type == fromActorType))
                {
                    Hl7Server hl7Server = ClientServerFactory.CreateHl7Server(hl7ServerType, this, basePeerToPeerConfig.FromActorName, commonConfig, (Hl7PeerToPeerConfig)basePeerToPeerConfig);
                    if (hl7Server != null)
                    {
                        SubscribeEvent(hl7Server);
                        _hl7Servers.Add(hl7Server.ActorName.TypeId, hl7Server);

                        // Initialize the connection with the from actor as being active.
                        // - this can always be overruled by the application later.
                        SetActorDefaultConnectionActive(basePeerToPeerConfig.FromActorName);
                    }
                }
            }
        }
示例#4
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;
		}