Bat files for running docloader


If you want to run docloader to load investigation results the attached bat files should help those running OpenVPMS under windows.  These files are designed to handle the following problems:

1) if you want to run docloader often (say every 5 minutes) then there is significant overhead in simply starting docloader and if there are no files to load then this is a waste of resources.  It is far better to check whether there are files to load before starting docloader.

2) if you have multiple results for one investigation and the file names are the same although the file contents differ, then you have to be careful about where the loaded result files are put - if you simple tell docloader to put them in a folder called say Loaded, then there will be a problem when the second results file (of the same name but different contents) is loaded - because a file with the same name will already exist in the Results-Loaded file.

The solution is to have docloader output the results to a 'temporary' folder - say TLoaded and then have the bat file move any files in this to the Loaded folder with the 'ovewrite if exists' option set.

Two bat files are attached - they have been renamed to have the extension .txt so that they can be uploaded - you will need to rename to .bat .

docload-x.bat is the one that is invoked by the Windows task scheduler to run every 5 minues.  It simply calls docload-r.bat which actually does the work, and it calls it with the log output to docload.log

docload-r.bat will need editing to change the folders where everything is.  As it stands the bat files (and the docloader.log log file) are in C:\OpenVPMS\TestRes and it is assumed that this folder has the following sub-folders:

  • Results - this is where the test result files should be put in order to be loaded
  • TLoaded - this is the 'temporary' folder where docloader puts the loaded files
  • Loaded - this is where the loaded files are moved to
  • Not-Loaded - this is where files that could not be loaded end up

If you are not familiar with the Windows task scheduler, see

A typical schedule setup is as follows:

Syndicate content