SCU (Service Class User) client API.
Provides functions to establish outbound DICOM associations and execute
DIMSE-C operations against remote SCPs. This is the client-side counterpart
to the SCP behaviour defined in Dimse.Handler.
Usage
# Open an association
{:ok, assoc} = Dimse.Scu.open("192.168.1.10", 11112,
calling_ae: "MY_SCU",
called_ae: "REMOTE_SCP",
abstract_syntaxes: ["1.2.840.10008.1.1"] # Verification
)
# Execute operations
:ok = Dimse.Scu.Echo.verify(assoc)
# Release the association
:ok = Dimse.Scu.release(assoc)Association Management
The SCU opens a TCP connection, sends an A-ASSOCIATE-RQ, waits for the
A-ASSOCIATE-AC, and returns a Dimse.Association pid. All DIMSE operations
are then sent as GenServer calls to this pid.
Error Handling
- Connection refused →
{:error, :econnrefused} - Association rejected →
{:error, {:rejected, result, source, reason}} - Association establishment timeout →
{:error, :timeout} - Unexpected abort →
{:error, {:aborted, source, reason}}
Summary
Functions
Sends an A-ABORT to forcefully terminate the association.
Opens a DICOM association to a remote AE.
Sends an A-RELEASE-RQ and waits for A-RELEASE-RP.
Functions
@spec abort(pid()) :: :ok
Sends an A-ABORT to forcefully terminate the association.
@spec open(String.t(), pos_integer(), keyword()) :: {:ok, pid()} | {:error, term()}
Opens a DICOM association to a remote AE.
Returns {:ok, association_pid} or {:error, reason}.
Options
:calling_ae— local AE title (default:"DIMSE"):called_ae— remote AE title (default:"ANY-SCP"):abstract_syntaxes— list of SOP Class UIDs (default: Verification):transfer_syntaxes— list of Transfer Syntax UIDs:max_pdu_length— max PDU length (default:16_384):timeout— total association establishment timeout in ms (default:30_000):tls— TLS options (keyword list). When present, the SCU connects via TLS instead of plain TCP. Accepts standard:ssloptions::cacertfile— path to CA certificate for server verification:verify—:verify_peerto verify the server certificate:certfile— client certificate for mutual TLS:keyfile— client private key for mutual TLS
:role_selections— list ofDimse.Pdu.RoleSelectionstructs proposing SCU/SCP roles for specific SOP classes (PS3.7 Annex D.3.3.4):user_identity—Dimse.Pdu.UserIdentitystruct for SCU authentication (PS3.7 Annex D.3.3.7). The SCP handler'shandle_authenticate/2callback is called to accept or reject.
Sends an A-RELEASE-RQ and waits for A-RELEASE-RP.