/// <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); }
/// <summary> /// Add a reponse trigger to the Actor. /// </summary> /// <param name="actorType">Destination Actor Type.</param> /// <param name="trigger">Trigger message.</param> public void AddResponseTriggerToActor(ActorTypeEnum actorType, BaseTrigger trigger) { // can only load and actor that is started if (_actorState == ActorStateEnum.ActorStarted) { ActorNameCollection activeDestinationActors = ActorConnectionCollection.IsEnabled(actorType); foreach (ActorName activeActorName in activeDestinationActors) { if (trigger is Hl7Trigger) { Hl7Server hl7Server = GetHl7Server(activeActorName); if ((hl7Server != null) && (hl7Server is Hl7QueryServer)) { Hl7QueryServer hl7QueryServer = (Hl7QueryServer)hl7Server; hl7QueryServer.AddResponseTrigger(activeActorName, trigger); } } } } }