Skip to Content
go-dicom(3)
Command line

upsscu

Works with Unified Procedure Steps on a UPS SCP: creates a step, reads it, claims it, updates it, completes or cancels it, asks for its cancellation, queries steps, and watches for their event reports.

When to use it

Use upsscu to drive a UPS worklist from a shell: to schedule a post-processing or reporting task, to act as the performer that claims and finishes it, to test a UPS SCP, or to watch what happens to steps. Each action is one flag; one action per run.

FlagDIMSEUPS SOP class
-createN‑CREATE, state SCHEDULEDPush
-get UIDN‑GET, every attribute or those of -attrsPull
-claim UIDN‑ACTION, to IN PROGRESSPull
-set UIDN‑SET, the -json attributesPull
-complete UID, -cancel UIDN‑ACTION, to COMPLETED or CANCELEDPull
-request-cancel UIDN‑ACTION, Request CancellationPush
-queryC‑FINDQuery
-watch UID|globalN‑ACTION subscribe, then N‑EVENT‑REPORTWatch

It does not run a UPS SCP; the library's network.UPSHandler is one. For Modality Worklist and MPPS, use findscu -worklist and mppsscu.

dcmtk has no UPS tool; pynetdicom does it in a script.

Examples

Schedule a step

go-dicom upsscu -aec UPSSCP -create -label 'CT chest reconstruction' -patient-name 'Doe^Jane' -patient-id PID1002 -priority HIGH -uid 1.2.826.0.1.3680043.10.511.6.1 pacs:11112
Requesting Association with pacs:11112 (AE: UPSSCP)
N-CREATE Success (status 0x0000)
Procedure step 1.2.826.0.1.3680043.10.511.6.1 is SCHEDULED

Without -uid the step's UID is generated. -start sets the scheduled start (YYYYMMDDHHMMSS, default now); -json adds any other attributes.

Read it

go-dicom upsscu -aec UPSSCP -get 1.2.826.0.1.3680043.10.511.6.1 -attrs ProcedureStepState,PatientName,ScheduledProcedureStepPriority pacs:11112
Requesting Association with pacs:11112 (AE: UPSSCP)
N-GET Success (status 0x0000)
  Patient's Name                           Doe^Jane
  Patient ID                               PID1002
…
  Procedure Step State                     SCHEDULED
  Scheduled Procedure Step Priority        HIGH
  Procedure Step Label                     CT chest reconstruction

-attrs sends an Attribute Identifier List (tags or keywords, comma separated); without it every attribute is asked for. What comes back is the SCP's choice: the one here returned every attribute.

Claim it, report progress, complete it

go-dicom upsscu -aec UPSSCP -claim 1.2.826.0.1.3680043.10.511.6.1 pacs:11112
Requesting Association with pacs:11112 (AE: UPSSCP)
N-ACTION Success (status 0x0000)
Procedure step 1.2.826.0.1.3680043.10.511.6.1 is IN PROGRESS
Transaction UID 2.25.68815721200213829336867860877277092901: give it to -set, -complete or -cancel
go-dicom upsscu -aec UPSSCP -set 1.2.826.0.1.3680043.10.511.6.1 -transaction 2.25.68815721200213829336867860877277092901 -json progress.json pacs:11112
go-dicom upsscu -aec UPSSCP -complete 1.2.826.0.1.3680043.10.511.6.1 -transaction 2.25.68815721200213829336867860877277092901 pacs:11112
N-SET Success (status 0x0000)
Procedure step 1.2.826.0.1.3680043.10.511.6.1 is updated
…
N-ACTION Success (status 0x0000)
Procedure step 1.2.826.0.1.3680043.10.511.6.1 is COMPLETED

The Transaction UID is the performer's proof of the claim (PS3.4 CC.1.1); -set, -complete and -cancel refuse to run without it. -claim -transaction UID claims with a Transaction UID of your choosing.

Important

Keep the Transaction UID that -claim prints. Without it no one can update, complete or cancel the step while it is IN PROGRESS.

Watch every step

go-dicom upsscu -aec UPSSCP -aet WATCHER -watch global -port 11115 -max-events 3 pacs:11112
Receiving event reports for WATCHER on port 11115 as well
Requesting Association with pacs:11112 (AE: UPSSCP)
N-ACTION subscribe Success (status 0x0000)
Subscribed to 1.2.840.10008.5.1.4.34.5; waiting for event reports (interrupt to stop)

--- Event report 1: UPS Cancel Requested (2) for procedure step 1.2.826.0.1.3680043.10.511.6.2 ---
  Reason for Cancellation                  Ordered twice

--- Event report 2: UPS State Report (1) for procedure step 1.2.826.0.1.3680043.10.511.6.2 ---
  Procedure Step State                     IN PROGRESS

--- Event report 3: UPS State Report (1) for procedure step 1.2.826.0.1.3680043.10.511.6.2 ---
  Procedure Step State                     CANCELED

Unsubscribed from 1.2.840.10008.5.1.4.34.5 after 3 event report(s)

Meanwhile another performer ran -request-cancel … -reason 'Ordered twice', -claim and -cancel on that step. -watch UID watches one step, global every step (with -json keys, a filtered global subscription). Many SCPs, the library's among them, send event reports on an association they open to the watcher: -port listens for those, under the -aet title, which the SCP must map to this machine's address. Without -max-events the watch runs until interrupted, then unsubscribes. -deletion-lock asks the SCP to keep finished steps until you unsubscribe.

Notes

  • -query sends a C-FIND with -patient-id, -state and -json as keys; it needs an SCP that serves the UPS Query SOP class (the test peer used for these examples did not, so no example is shown).
  • -request-cancel only asks: the performer decides, and cancels with its own -cancel.
  • Exit status is 0 when the SCP answered Success, 1 on a refusal, a missing -transaction, or a failed association.
  • -v prints the data set sent. -timeout is in seconds (default 30). The -tls… options are those of echoscu; -events records the association (Events).
  • See CONFORMANCE.md, Service classes.

See also

Options

On this page