Skip to content

Commit 9a0565f

Browse files
committed
Minor improvements, uping version. and also taking in fileindex while generating dcm file
1 parent 81f8f50 commit 9a0565f

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

Pacs_Simulator/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ pixelmed library version is no longer available on maven repos. version of jar i
2020
### Basic command to run
2121
> cd utilities/Pacs_Simulator
2222
23-
> java -Ddcmsnd_path=/path-to-dcmsnd-cmd/ -jar target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar 8087 20000 dcm4chee DCM4CHEE@192.168.33.10:11112
23+
> java -Ddcmsnd_path=/path-to-dcmsnd-cmd/ -jar target/pacssimulator-1.0.0-jar-with-dependencies.jar 8087 20000 dcm4chee DCM4CHEE@192.168.33.10:11112
2424
2525

2626
In the above:
27-
2827
* 8087 - is the listening port
2928
* 20000 - is connection timeout in milisec
3029
* dcm4chee - is the PACS server type. possible values are dcm4chee or orthanc
@@ -33,20 +32,24 @@ In the above:
3332
Note, while sending to DCM4CHEE it is required that you have the "dcmsnd" utility command in your local path.
3433
You can do so like above passing through system parameter "dcmsnd_path". If not passed, then default path /var/lib/bahmni/dcm4che-2.0.28/bin/ will be used. Notice the trailing slash "/" that must be passed.
3534

35+
Also note, the jar file name "pacssimulator-1.0.0-jar-with-dependencies.jar" maybe different. Please check your build.
3636

3737
### Generate a DICOM file with minimum details
3838
You may also generate a sample DICOM file with minimum patient detail and related to an accession number by using the DicomFileGenerator.java.
3939

4040
This is useful when you do not want to run the simulator, but want to upload a DICOM file manually using "dcmsnd" command yourself.
4141

4242

43-
> java -cp target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator [patientId] [givenName] [familyName] [accessionNumber] [filepath]
43+
> java -cp target/pacssimulator-1.0.0-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator [patientId] [givenName] [familyName] [accessionNumber] [filepath]
4444
4545
example
4646

47-
> java -cp target/pacssimulator-1.0-SNAPSHOT-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator GAN123 Gajendra Singh ORD-309 /tmp/test.dcm
47+
> java -cp target/pacssimulator-1.0.0-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator GAN123 Gajendra Singh ORD-309 /tmp/test.dcm
48+
49+
The above should tell you the location of the generated file.
50+
Note in the above command, you may also pass an index of sample files which are bundled with the library.
4851

49-
The above should tell you the location of the generated file.
52+
> java -cp target/pacssimulator-1.0.0-jar-with-dependencies.jar org.bahmni.pacssimulator.DicomFileGenerator GAN123 Gajendra Singh ORD-309 0
5053
5154
You can then take the file and use "dcmsnd" command manually to send the file. But before that
5255
1. In DCM4CHEE, create an AE (Application Entity) with name "DCMSND" and port "11113" (can be anything, make sure AE and port is not already in use)

Pacs_Simulator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.bahmni</groupId>
88
<artifactId>pacssimulator</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>1.0.0</version>
1010

1111
<properties>
1212
<log4jVersion>1.2.17</log4jVersion>

Pacs_Simulator/src/main/java/org/bahmni/pacssimulator/DicomFileGenerator.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public static void main(String[] args) {
2121
String familyName = "Ragos";
2222
String accessionNumber = "ORD-307";
2323
String dicomFilePath = sampleFiles[i-1];
24-
//String dicomFilePath = "/Users/angshus/work/bahmni/utilities/Pacs_Simulator/0002.DCM";
2524

2625
if (args.length > 0) {
2726
patientId = args[0];
@@ -35,7 +34,18 @@ public static void main(String[] args) {
3534
accessionNumber = args[3];
3635
}
3736
if (args.length > 4) {
38-
dicomFilePath = args[4];
37+
String fileRef = args[4];
38+
try {
39+
int index = Integer.parseInt(fileRef);
40+
if (index >= sampleFiles.length) {
41+
System.out.println("Passed image index is invalid. Please make sure that its within - " + sampleFiles.length);
42+
return;
43+
}
44+
dicomFilePath = sampleFiles[index];
45+
} catch (NumberFormatException nfe) {
46+
System.out.println("Index parameter is not a number. Checking if its an available file");
47+
dicomFilePath = fileRef;
48+
}
3949
}
4050
}
4151

0 commit comments

Comments
 (0)