/// <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); }
/// <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); } } } }
/// <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; }