tiny_pacs.events
Event definitions for the tiny_pacs event system.
Events are built on top of trolleybus: every event is a class carrying
its payload type and listener result type. Events are never instantiated —
the event class itself is broadcast together with a single payload value.
Multi-value payloads are packed into small dataclasses.
Lifecycle events are provided by trolleybus itself
(trolleybus.OnStart, trolleybus.OnStarted and
trolleybus.OnExit) and are emitted by
trolleybus.EventBus.start() / trolleybus.EventBus.stop().
Module Attributes
Single stored file: SOP Class UID, Transfer Syntax UID and either a file name, a dataset or a file object. |
Classes
|
Incoming association request. |
|
Payload of the |
|
Request an atomic transaction context manager. |
Storage Commitment request. |
|
Request device settings by AE Title. |
|
Request the configured remote devices. |
|
|
Incoming C-FIND request. |
|
Payload of the |
|
Incoming C-GET request. |
Request a DICOM client for the provided AE Title. |
|
|
Request a file object to store incoming dataset. |
|
Payload of the |
|
Request stored files by a list of SOP Instance UIDs. |
|
Payload of the |
|
Request the main AE Title of the service. |
Request schema migrations from components. |
|
|
Incoming C-MOVE request. |
|
Payload of the |
|
Incoming C-STORE request. |
Dataset has been stored successfully. |
|
Dataset storage has failed. |
|
|
Payload of the |
Verify that provided SOP Instance UIDs are stored. |
|
Request the string aggregate SQL function for the current DB driver. |
|
|
Request a list of database tables from components. |
- tiny_pacs.events.StoredFile
Single stored file: SOP Class UID, Transfer Syntax UID and either a file name, a dataset or a file object. UID values can come either as
pydicom.uid.UIDobjects or as plain strings (e.g. from the database).alias of
tuple[str|UID,str|UID,str|Dataset|BinaryIO]
- class tiny_pacs.events.AssocPayload(asce: AssociationAcceptor, assoc: AAssociateRqPDU)[source]
Bases:
objectPayload of the
Assocevent.- asce: AssociationAcceptor
Association acceptor handling the incoming connection
- assoc: AAssociateRqPDU
Association request parameters
- class tiny_pacs.events.Assoc[source]
Bases:
Event[AssocPayload,None]Incoming association request.
- class tiny_pacs.events.StorePayload(context: PContextDef, ds: BinaryIO | bytes)[source]
Bases:
objectPayload of the
Storeevent.- context: PContextDef
Presentation context
- class tiny_pacs.events.Store[source]
Bases:
Event[StorePayload,Status]Incoming C-STORE request. Handling result is a C-STORE status.
- class tiny_pacs.events.FindPayload(context: PContextDef, ds: Dataset)[source]
Bases:
objectPayload of the
Findevent.- context: PContextDef
Presentation context
- class tiny_pacs.events.Find[source]
Bases:
Event[FindPayload,Iterable[tuple[Dataset,Status]]]Incoming C-FIND request.
Handling result is an iterable of
(dataset, status)tuples.
- class tiny_pacs.events.MovePayload(context: PContextDef, ds: Dataset, destination: str)[source]
Bases:
objectPayload of the
Moveevent.- context: PContextDef
Presentation context
- class tiny_pacs.events.Move[source]
Bases:
Event[MovePayload,list[tuple[str|UID,str|UID,str|Dataset|BinaryIO]]]Incoming C-MOVE request. Handling result is a list of stored files.
- class tiny_pacs.events.GetPayload(context: PContextDef, ds: Dataset)[source]
Bases:
objectPayload of the
Getevent.- context: PContextDef
Presentation context
- class tiny_pacs.events.Get[source]
Bases:
Event[GetPayload,list[tuple[str|UID,str|UID,str|Dataset|BinaryIO]]]Incoming C-GET request. Handling result is a list of stored files.
- class tiny_pacs.events.Commitment[source]
Bases:
Event[list[tuple[UID,UID]],tuple[list[tuple[UID,UID]],list[tuple[UID,UID]]]]Storage Commitment request.
Payload is a list of
(SOP Class UID, SOP Instance UID)tuples; handling result is a tuple of two lists — successfully stored instances and failures.
- class tiny_pacs.events.GetFilePayload(context: PContextDef, command_set: Dataset)[source]
Bases:
objectPayload of the
GetFileevent.- context: PContextDef
Presentation context
- class tiny_pacs.events.GetFile[source]
Bases:
Event[GetFilePayload,tuple[BinaryIO,int]]Request a file object to store incoming dataset.
Handling result is a tuple of the file object and the starting position of the dataset stream within it.
- class tiny_pacs.events.StoreDone[source]
-
Dataset has been stored successfully. Payload is the stored dataset.
- class tiny_pacs.events.StoreFailure[source]
-
Dataset storage has failed. Payload is the dataset that failed.
- class tiny_pacs.events.GetFiles[source]
Bases:
Event[list[str],Iterable[tuple[str|UID,str|UID,str|Dataset|BinaryIO]]]Request stored files by a list of SOP Instance UIDs.
- class tiny_pacs.events.StoreVerify[source]
Bases:
Event[list[tuple[UID,UID]],tuple[frozenset[tuple[UID,UID]],frozenset[tuple[UID,UID]]]]Verify that provided SOP Instance UIDs are stored.
Payload is a list of
(SOP Class UID, SOP Instance UID)tuples; handling result is a tuple of two frozensets — successes and failures.
- class tiny_pacs.events.Tables[source]
Bases:
Event[None,list[type[Model]]]Request a list of database tables from components.
- class tiny_pacs.events.Migrations[source]
Bases:
Event[None,schema.ComponentMigrations]Request schema migrations from components.
Handling result is the component’s schema name, its tables and its migration list (see
tiny_pacs.schema.ComponentMigrations).
- class tiny_pacs.events.StringAgg[source]
Bases:
Event[None,Callable[[…],Function]]Request the string aggregate SQL function for the current DB driver.
- class tiny_pacs.events.DeviceByAE[source]
Bases:
Event[str,devices.DeviceConfig | None]Request device settings by AE Title.
- class tiny_pacs.events.DeviceConfigs[source]
Bases:
Event[None,dict[str, 'devices.DeviceConfig']]Request the configured remote devices.
Answered by device registry components with a mapping of AE titles to device configurations, e.g. so database-backed registries can import the YAML-configured devices.