pynetdicom.status.Status

class pynetdicom.status.Status(value)[source]

Constants for common status codes.

Added in version 1.5.

New constants can be added with the Status.add(name, code) method but the documentation for it is missing due to a bug in Sphinx. name is the variable name of the constant to add as a str and code is the corresponding status code as an int.

Examples

from pynetdicom.status import Status

# Customise the class
Status.add('UNABLE_TO_PROCESS', 0xC000)

def handle_store(event):
    try:
        event.dataset.save_as('temp.dcm')
    except:
        return Status.UNABLE_TO_PROCESS

    return Status.SUCCESS
__init__()

Methods

conjugate

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

bit_count()

Number of ones in the binary representation of the absolute value of self.

to_bytes(length, byteorder, *[, signed])

Return an array of bytes representing an integer.

from_bytes(byteorder, *[, signed])

Return the integer represented by the given array of bytes.

as_integer_ratio()

Return integer ratio.

add(name, code)

Add a new constant to Status.

Attributes

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

SUCCESS

0x0000 - Success

CANCEL

0xFE00 - Operation terminated

PENDING

0xFF00 - Matches or sub-operations are continuing

MOVE_DESTINATION_UNKNOWN

0xA801 - Move destination unknown

CANCEL = 65024[source]

0xFE00 - Operation terminated

MOVE_DESTINATION_UNKNOWN = 43009[source]

0xA801 - Move destination unknown

PENDING = 65280[source]

0xFF00 - Matches or sub-operations are continuing

SUCCESS = 0[source]

0x0000 - Success

classmethod add(name: str, code: int) None[source]

Add a new constant to Status.

Parameters:
  • name (str) – The name of the constant to add.

  • code (int) – The status code corresponding to the name.