pynetdicom.pdu_items.UserInformationItem

class pynetdicom.pdu_items.UserInformationItem[source]

A User Information Item.

Used by the association requestor and acceptor to include user information in the association negotiation.

Notes

A User Information Item requires the following parameters:

  • Item type (1, fixed, 0x50)

  • Item length (1)

  • User data sub-items (2 or more)

  • Maximum Length Received Sub-item (1)

  • Implementation Class UID Sub-item (1)

  • Optional User Data Sub-items (0 or more)

Encoding

When encoded, a User Information Item has the following structure, taken from Part 8, Table 9-16 of the DICOM Standard (offsets shown with Python indexing). Items are always encoded using Big Endian.

Offset

Length

Description

0

1

Item type

1

1

Reserved

2

2

Item length

4

Variable

User data

References

__init__() None[source]

Initialise a new User Information Item.

Methods

__init__()

Initialise a new User Information Item.

decode(bytestream)

Decode bytestream and use the result to set the field values of the PDU item.

encode()

Return the encoded PDU as bytes.

from_primitive(primitive)

Set up the current Item using User Information primitives.

to_primitive()

Return a list of User Information primitives from the current Item.

Attributes

async_ops_window

Return the Asynchronous Operations Window Sub-item, if available.

common_ext_neg

Return the SOP Class Common Extended Negotiation Sub-items.

ext_neg

Return the SOP Class Extended Negotiation Sub-items.

implementation_class_uid

Return the item's Implementation Class UID field value, if available.

implementation_version_name

Return the item's Implementation Version Name field value, if available.

item_length

Return the item's Item Length field value as int.

item_type

Return the item's Item Type field value as int.

maximum_length

Return the item's Maximum Length Received field value, if available.

role_selection

Return the SCP/SCU Role Selection Sub-items.

user_identity

Return the User Identity Sub-item, if available.

property async_ops_window: Optional[AsynchronousOperationsWindowSubItem]

Return the Asynchronous Operations Window Sub-item, if available.

property common_ext_neg: List[SOPClassCommonExtendedNegotiationSubItem]

Return the SOP Class Common Extended Negotiation Sub-items.

property ext_neg: List[SOPClassExtendedNegotiationSubItem]

Return the SOP Class Extended Negotiation Sub-items.

from_primitive(primitive: _UserInformationPrimitiveType) None[source]

Set up the current Item using User Information primitives.

Parameters

primitive (list of User Information primitives) –

Must contain:

  • MaximumLengthNotification

  • ImplementationClassUIDNotification

May optionally contain one or more:

  • ImplementationVersionNameNotification

  • AsynchronousOperationsWindowNegotiation

  • SCP_SCU_RoleSelectionNegotiation

  • SOPClassExtendedNegotiation

  • SOPClassCommonExtendedNegotiation

  • UserIdentityNegotiation

property implementation_class_uid: Optional[UID]

Return the item’s Implementation Class UID field value, if available.

property implementation_version_name: Optional[str]

Return the item’s Implementation Version Name field value, if available.

property item_length: int

Return the item’s Item Length field value as int.

property maximum_length: Optional[int]

Return the item’s Maximum Length Received field value, if available.

property role_selection: Dict[UID, SCP_SCU_RoleSelectionSubItem]

Return the SCP/SCU Role Selection Sub-items.

Returns

The SCP/SCU Role Selection items as {item.uid : item}.

Return type

dict

to_primitive() _UserInformationPrimitiveType[source]

Return a list of User Information primitives from the current Item.

Returns

Must contain:

  • MaximumLengthNotification

  • ImplementationClassUIDNotification

May optionally contain one or more:

  • ImplementationVersionnameNotification

  • AsynchronousOperationsWindowNegotiation

  • SCP_SCU_RoleSelectionNegotiation

  • SOPClassExtendedNegotiation

  • SOPClassCommonExtendedNegotiation

  • UserIdentityNegotiation

Return type

list of User Information primitives

property user_identity: Optional[Union[UserIdentitySubItemAC, UserIdentitySubItemRQ]]

Return the User Identity Sub-item, if available.