pynetdicom.association.ServiceUser

class pynetdicom.association.ServiceUser(assoc, mode)[source][source]

Convenience class for the Association Service User.

An Association object has two ServiceUser attributes, one representing the association requestor and the other the association acceptor. Once both ServiceUser’s have been defined sufficiently to be considered valid then association negotiation can begin. The requestor ServiceUser requires (at a minimum) the following in order to be valid:

  • For association as requestor:

    • AE title (ae_title)

    • Address and port number (address and port)

    • Maximum PDU length (maximum_length)

    • Implementation class UID (implementation_class_uid)

    • At least one presentation context (requested_contexts)

  • For association as acceptor:

    • AE title

    • Address and port number

The acceptor ServiceUser requires (at a minimum) the following in order to be valid:

  • For association as requestor:

    • Address and port number

  • For association as acceptor:

    • AE title

    • Address and port number

    • Maximum PDU length

    • Implementation class UID

address

The TCP/IP address of the AE.

Type

str

ae_title

The AE’s AE title.

Type

bytes

port

The port number of the AE.

Type

int

primitive

The A-ASSOCIATE primitive (request if mode is ‘requestor’, accept/reject if mode is ‘acceptor’) sent or received by the AE during association negotiation.

Type

None or pdu_primitives.A_ASSOCIATE

__init__(assoc, mode)[source][source]

Create a new ServiceUser.

Parameters
  • assoc (association.Association) – The parent Association.

  • mode (str) – The operation mode of the AE represented by the ServiceUser, either ‘requestor’ or ‘acceptor’. This is not necessarily the same as the association’s mode.

Methods

__init__(assoc, mode)

Create a new ServiceUser.

add_negotiation_item(item)

Add an extended negotiation item to the user information.

get_contexts(cx_type)

Return a list of PresentationContext corresponding to cx_type.

remove_negotiation_item(item)

Remove an extended negotiation item from the user information.

reset_negotiation_items()

Remove all extended negotiation items.

Attributes

accepted_common_extended

Return a dict of the accepted SOP Class Common Extended Negotiation.

asynchronous_operations

Return the Asynchronous Operations Window operations numbers.

extended_negotiation

Return a list of Extended Negotiation items.

implementation_class_uid

Return the Implementation Class UID as a pydicom UID.

implementation_version_name

Return the Implementation Version Name as str (if available).

info

Return a dict with information about the ServiceUser.

is_acceptor

Return True if the ServiceUser is the association acceptor.

is_requestor

Return True if the ServiceUser is the association requestor.

maximum_length

Return the maximum PDV size as int.

mode

Return the mode as str, either 'requestor' or 'acceptor'.

requested_contexts

Return a list of the requestor's requested presentation contexts.

role_selection

Return any SCP/SCU Role Selection items as a dict.

sop_class_common_extended

Return any SOP Class Common Extended items as dict.

sop_class_extended

Return any SOP Class Extended items as dict.

supported_contexts

Return a list of supported presentation contexts.

user_identity

Return the User Identity Negotiation Item (if available).

user_information

Returns a list of the User Information items.

writeable

Return True if the current object can be changed.