/// <summary> /// Trigger the DICOM Client Verification (E-ECHO-RQ). /// </summary> /// <param name="actorType">Destination Actor Type.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerActorDicomClientVerificationInstances(ActorTypeEnum actorType) { bool triggerResult = false; // can only trigger an actor that is started if (_actorState == ActorStateEnum.ActorStarted) { triggerResult = true; ActorNameCollection activeDestinationActors = ActorConnectionCollection.IsEnabled(actorType); foreach (ActorName activeActorName in activeDestinationActors) { DicomClient dicomClient = GetDicomClient(activeActorName); if (dicomClient != null) { if (dicomClient.TriggerClientVerification(activeActorName) == false) { // set returned result - but continue with other triggers triggerResult = false; } } } } return(triggerResult); }
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)); } }
/// <summary> /// Trigger the Actor Instances of the given Actor Type. /// </summary> /// <param name="actorType">Destination Actor Type.</param> /// <param name="trigger">Trigger message.</param> /// <param name="awaitCompletion">Boolean indicating whether this a synchronous call or not.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerActorInstances(ActorTypeEnum actorType, BaseTrigger trigger, bool awaitCompletion) { bool triggerResult = false; // can only trigger an actor that is started if (_actorState == ActorStateEnum.ActorStarted) { triggerResult = true; ActorNameCollection activeDestinationActors = ActorConnectionCollection.IsEnabled(actorType); foreach (ActorName activeActorName in activeDestinationActors) { if (trigger is Hl7Trigger) { Hl7Client hl7Client = GetHl7Client(activeActorName); if (hl7Client != null) { if (hl7Client.TriggerClient(activeActorName, trigger, awaitCompletion) == false) { // set returned result - but continue with other triggers triggerResult = false; } } } else { DicomClient dicomClient = GetDicomClient(activeActorName); if (dicomClient != null) { if (dicomClient.TriggerClient(activeActorName, trigger, awaitCompletion) == false) { // set returned result - but continue with other triggers triggerResult = false; } } } } } return(triggerResult); }
/// <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); } } } } }