Dimse.Association.State (Dimse v0.8.7)

Copy Markdown View Source

Association state struct carried by the Dimse.Association GenServer.

Tracks everything needed during the lifetime of a DICOM association: socket, negotiated contexts, message assembly buffers, and counters.

See PS3.8 Section 9.2 for the Upper Layer state machine specification.

Summary

Types

Progress of the C-STORE sub-operations of one C-GET or C-MOVE request.

t()

Types

phase()

@type phase() :: :idle | :negotiating | :established | :releasing | :closed

sub_operation()

@type sub_operation() :: %{
  type: :c_get | :c_move,
  message_id: integer(),
  context_id: pos_integer(),
  sop_class_uid: String.t(),
  remaining: [Dimse.Handler.instance()],
  in_flight_uid: String.t() | nil,
  completed: non_neg_integer(),
  failed: non_neg_integer(),
  failed_uids: [String.t()],
  warning: non_neg_integer(),
  sub_assoc: pid() | nil
}

Progress of the C-STORE sub-operations of one C-GET or C-MOVE request.

remaining holds the elements not yet sent (Dimse.Handler.instance/0, binaries or fetchers). in_flight_uid is set only while a C-GET C-STORE-RQ awaits its C-STORE-RSP. failed_uids collects the SOP Instance UIDs of failed sub-operations, newest first, for the Failed SOP Instance UID List of the final response.

t()

@type t() :: %Dimse.Association.State{
  artim_timer: reference() | nil,
  association_id: String.t(),
  bytes_received: non_neg_integer(),
  bytes_sent: non_neg_integer(),
  collecting_results: boolean(),
  config: Dimse.Association.Config.t() | nil,
  current_abstract_syntax_uid: String.t() | nil,
  current_context_id: pos_integer() | nil,
  current_dimse_message: term(),
  current_transfer_syntax_uid: String.t() | nil,
  get_mode: boolean(),
  handler: module() | nil,
  implementation_uid: String.t() | nil,
  implementation_version: String.t() | nil,
  local_ae_title: String.t() | nil,
  max_pdu_length: pos_integer(),
  negotiated_contexts: %{required(pos_integer()) => {String.t(), String.t()}},
  pdu_buffer: binary(),
  pending_release: GenServer.from() | nil,
  pending_request: GenServer.from() | nil,
  pending_results: [binary()],
  phase: phase(),
  proposed_contexts: %{required(pos_integer()) => String.t()},
  remote_ae_title: String.t() | nil,
  role_selections: %{required(String.t()) => {boolean(), boolean()}},
  socket: :inet.socket() | nil,
  started_at: integer(),
  sub_operation: sub_operation() | nil,
  transport: module() | nil
}