pynetdicom.pdu_items.UserIdentitySubItemRQ

class pynetdicom.pdu_items.UserIdentitySubItemRQ

A User Identity (RQ) Sub-item.

A User Identity (RQ) Sub-item is used to notify the association acceptor of the user identity of the requestor.

item_length

The number of bytes from the first byte following the Item Length field to the last byte of the Item.

Type:int
item_type

The Item Type field value (0x58).

Type:int
positive_response_requested

The Positive Response Requested field value.

Type:int
primary_field

The Primary Field field value.

Type:bytes
primary_field_length

The Primary Field Length field value.

Type:int
secondary_field

The Secondary Field field value.

Type:bytes
secondary_field_length

The Secondary Field Length field value.

Type:int
user_identity_type

The User Identity Type field value.

Type:{1, 2, 3, 4}

Notes

A User Identity (RQ) Sub-item requires the following parameters:

  • Item type (1, fixed, 0x58)
  • Item length (1)
  • User identity type (1)
  • Positive response requested (1)
  • Primary field length (1)
  • Primary field (1)
  • Secondary field length (1)
  • Secondary field (only if user identity type = 2)

Encoding

When encoded, a User Identity (RQ) Sub-item has the following structure, taken from Tables D.3-14 [1] (offsets shown with Python indexing). Items are always encoded using Big Endian [2].

Offset Length Description
0 1 Item type
1 1 Reserved
2 2 Item length
4 1 User identity type
5 1 Positive response requested
6 2 Primary field length
8 Variable Primary field
8 + Primary field length 2 Secondary field length
10 + Primary field length Variable Secondary field

References

[1]DICOM Standard, Part 7, Annex D.3.3.7
[2]DICOM Standard, Part 8, Section 9.3.1
__init__()

Initialise a new User Identity (RQ) Item.

Methods

__init__() Initialise a new User Identity (RQ) 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 the item’s values using an User Identity primitive.
to_primitive() Return an User Identity primitive from the current Item.

Attributes

id_type Return the item’s User Identity Type field value.
id_type_str Return a string description of the User Identity Type field.
item_length Return the item’s Item Length field value as an int.
item_type Return the item’s Item Type field value as an int.
primary Return the item’s Primary Field field value.
primary_field_length Return the item’s Primary Field Length field value.
response_requested Return the item’s Positive Response Requested field value as bool.
secondary Return the item’s Secondary Field field value.
secondary_field_length Return the item’s Secondary Field Length field value.
decode(bytestream)

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

Parameters:bytestream (bytes) – The PDU data to be decoded.
encode()

Return the encoded PDU as bytes.

Returns:The encoded PDU.
Return type:bytes
from_primitive(primitive)

Set the item’s values using an User Identity primitive.

Parameters:primitive (pdu_primitives.UserIdentityNegotiation) – The primitive to use to set the Item’s field values.
id_type

Return the item’s User Identity Type field value.

id_type_str

Return a string description of the User Identity Type field.

item_length

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

item_type

Return the item’s Item Type field value as an int.

primary

Return the item’s Primary Field field value.

primary_field_length

Return the item’s Primary Field Length field value.

response_requested

Return the item’s Positive Response Requested field value as bool.

secondary

Return the item’s Secondary Field field value.

secondary_field_length

Return the item’s Secondary Field Length field value.

to_primitive()

Return an User Identity primitive from the current Item.

Returns:The primitive representation of the current Item.
Return type:pdu_primitives.UserIdentityNegotiation