Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return a list of all the destination actor names of the given actor type that are active.
        /// </summary>
        /// <param name="actorType">Destination actor type.</param>
        /// <returns>ActorNameCollection - all active destination actor names of the given actor type.</returns>
        public ActorNameCollection IsEnabled(ActorTypeEnum actorType)
        {
            ActorNameCollection actorNames = new ActorNameCollection();

            // search for connection to destination with the given actor type
            foreach (ActorConnection actorConnection in this)
            {
                if ((actorConnection.ActorName.Type == actorType) &&
                    (actorConnection.IsActive == true))
                {
                    // return this active actor name
                    actorNames.Add(actorConnection.ActorName);
                }
            }

            return(actorNames);
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 /// <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);
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Return a list of all the destination actor names of the given actor type that are active.
        /// </summary>
        /// <param name="actorType">Destination actor type.</param>
        /// <returns>ActorNameCollection - all active destination actor names of the given actor type.</returns>
        public ActorNameCollection IsEnabled(ActorTypeEnum actorType)
        {
            ActorNameCollection actorNames = new ActorNameCollection();

            // search for connection to destination with the given actor type
            foreach (ActorConnection actorConnection in this)
            {
                if ((actorConnection.ActorName.Type == actorType) &&
                    (actorConnection.IsActive == true))
                {
                    // return this active actor name
                    actorNames.Add(actorConnection.ActorName);
                }
            }

            return actorNames;
        }