Storescp.exe - ExecOnReception command executes intermittently

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
dflee30
Posts: 5
Joined: Wed, 2008-11-26, 20:13
Location: US

Storescp.exe - ExecOnReception command executes intermittently

#1 Post by dflee30 »

I have written a vb.net wrapper around the storescp.exe executable and it uses the --execonreception command line argument. The command I am executing is:

storescp.exe -v 105 -od "C:\Data\Images\Source" -fe .dcm -xf "C:\OFFISDICOM\storescp.cfg" DEFAULT --fork --exec-on-reception "C:\OFFISDICOM\AddDicomReceipt.bat #f #a"

The batch file executes an osql command to store the calling AE title and filename for later use. This command works consistantly from the command line, including the execonreception portion. However, when it is started from my wrapper application the execonreception command is executed only intermittently - all other aspects of the call execute proprly (i.e. file is received and stored, but AddDicomReceipt.bat may or may not execute).

The wrapper application is written in vb.net and launches the process as follows:

Dim prcStartInfo As System.Diagnostics.ProcessStartInfo = Nothing
Dim prcEcho As System.Diagnostics.Process = Nothing

prcStartInfo = New System.Diagnostics.ProcessStartInfo(strExecutableFilePathToStorescp.exe, strCommandLineArguments) 'see command above

prcStartInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Hidden
prcStartInfo.CreateNoWindow = False
prcStartInfo.RedirectStandardOutput = True
prcStartInfo.RedirectStandardError = True
prcStartInfo.UseShellExecute = False
prcStartInfo.WorkingDirectory = strExecutableFilePath.Substring(0, strExecutableFilePath.LastIndexOf("\"))

prcEcho = System.Diagnostics.Process.Start(prcStartInfo)

Are there any known issues with the execonreception option, particularly when used with --fork? Does anyone have any suggestions to an alternate way to wrap storescp.exe and use the execonreception command?

Thanks

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#2 Post by Per »

The execute on reception options are broken when used with --fork, since the various processes do not communicate with each other about what they receive.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#3 Post by Jörg Riesmeier »

As far as I can remember, --fork and --exec-on-reception should work on Windows systems since the command is executed for every new DICOM object received.
What does not work properly, is the combination of --fork and --exec/rename-on-eostudy. Therefore, we've added a check on this combination for the DCMTK 3.6.0 release. See the corresponding commit.

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#4 Post by Per »

Right. I was thinking of the combination of --exec-on-eostudy and --fork

You mean this should work on non-Windows platforms? From my testing, and my reading of the code, this does not work on any platform. It would require some non-existent IPC mechanism. I'd be very happy to be wrong about this, though.

shlomgad
Posts: 6
Joined: Thu, 2007-12-06, 23:16

Re: Storescp.exe - ExecOnReception command executes intermit

#5 Post by shlomgad »

Has this issue been fixed ? (the use of --exec-on-eostudy and --fork together)
Thanks

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Storescp.exe - ExecOnReception command executes intermit

#6 Post by Michael Onken »

Hi,

No, this is still a limitation. storescp prints an error if you try to start it with both options.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest