Skip to content

Commit

Permalink
Allow configuration of client AET. (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigatron authored May 14, 2024
1 parent 36cf72b commit eb64294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void main(String[] args) throws IOException {
boolean isStowRs = !flags.peerDicomwebAddress.isEmpty()
|| (!flags.peerDicomwebAddr.isEmpty() && !flags.peerDicomwebStowPath.isEmpty());
boolean isCStore =
!flags.peerDimseAET.isEmpty() && !flags.peerDimseIP.isEmpty() && flags.peerDimsePort != 0;
!flags.peerDimseAET.isEmpty() && !flags.peerDimseIP.isEmpty() && flags.peerDimsePort != 0 && !flags.clientAET.isEmpty();
DicomSender dicomSender = null;
if (isStowRs && isCStore) {
System.err.println("Both C-STORE and STOW-RS flags should not be specified.");
Expand All @@ -99,7 +99,7 @@ public static void main(String[] args) throws IOException {
// C-Store sender.
//
// DIMSE application entity.
ApplicationEntity applicationEntity = new ApplicationEntity("EXPORTADAPTER");
ApplicationEntity applicationEntity = new ApplicationEntity(StringUtil.trim(flags.clientAET));
Connection conn = new Connection();
DeviceUtil.createClientDevice(applicationEntity, conn);
applicationEntity.addConnection(conn);
Expand All @@ -111,8 +111,8 @@ public static void main(String[] args) throws IOException {
flags.peerDimsePort,
dicomWebClient);
System.out.printf(
"Export adapter set-up to export via C-STORE to AET: %s, IP: %s, Port: %d\n",
flags.peerDimseAET, flags.peerDimseIP, flags.peerDimsePort);
"Export adapter set-up to export via C-STORE to AET: %s, IP: %s, Port: %d, client AET: %s\n",
flags.peerDimseAET, flags.peerDimseIP, flags.peerDimsePort, flags.clientAET);
} else {
System.err.println("Neither C-STORE nor STOW-RS flags have been specified.");
System.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public class Flags {
)
public static Integer peerDimsePort = 0;

@Parameter(
names = {"--client_aet"},
description = "Application Entity Title of export adapter."
)
public static String clientAET = "EXPORTADAPTER";

/** Flags for exporting via DicomWeb STOW-RS. */
@Deprecated
@Parameter(
Expand Down

0 comments on commit eb64294

Please sign in to comment.