pynetdicom.events.trigger#
- pynetdicom.events.trigger(assoc: Association, event: NotificationEvent | InterventionEvent, attrs: dict[str, Any] | None = None) Any | None[source]#
Trigger an event and call any bound handler(s).
Notification events can be bound to multiple handlers, intervention events can only be bound to a single handler.
Special Attributes
If attrs contains:
_is_cancelled key then
Event.is_cancelledwill be hooked into the value’s callable function.a C-FIND, C-GET or C-MOVE request key then
Event.identifierwill return the decoded Identifier parameter value.a C-STORE request key then
Event.datasetwill return the decoded Data Set parameter value.an N-ACTION request key then
Event.action_informationwill return the decoded Action Information parameter value.an N-CREATE request key then
Event.attribute_listwill return the decoded Attribute List parameter value.an N-EVENT-REPORT request key then
Event.event_informationwill return the decoded Event Information parameter value.an N-SET request key then
Event.modification_listwill return the decoded Modification List parameter value.
- Parameters:
assoc (assoc.Association) – The association in which the event occurred.
event (events.NotificationEvent or events.InterventionEvent) – The event to trigger.
attrs (dict, optional) – The attributes to set in the
Eventinstance that is passed to the event’s corresponding handler functions as{attribute name : value}, default{}.
- Raises:
Exception – If an exception occurs in an intervention event handler then the exception will be raised. If an exception occurs in a notification handler then the exception will be caught and logged instead.