Saturday, 8 December 2007

Conquest Dicom Server Custom Log File

How to setup your own custom Conquest server log file
I have setup my Conquest server with a logging system that effectively saves information to a CSV file every time images are sent or received by the machine.
I then also wrote a small bat script to archive the log files to prevent the log from becoming to large.

  1. open the dicom.ini file with a text editor like notepad or notepad++.
  2. At the end of the file add an export converter.
    You can do this as follows:
    ExportConverters = 1
    ExportConverter0 = append "%d,%f,%p,%m,%s,%b,%o,%u,%c,%i%n" to c:\conquest\logs\incoming_log.csv
This tells conquest to log all incoming dicom images to a csv log file.
The letters preceded by a % are variables that represent things such as the calling AE title et. You can find a list of these in the help file supplied with conquest.

I noticed that this was effective, but the log file would soon fill up, so I created a bat file that would copy the file to an archive folder so that the log file would not become too large and slow when opening it.

the contents of the bat script to copy and rename the file to an archive location are as follows:

@ECHO OFF
copy "C:\conquest\logs\incoming_log.csv" "C:\conquest\logs\archive\%Date:~6,4%.%Date:~3,2%.%Date:~0,2% incoming_log.csv"
del "C:\conquest\logs\incoming_log.csv"
echo "Date","File Name","File Path","Modality","Station Name","File base name","SOP Instance","Calling AE","CalledAE","patient ID" > C:\conquest\logs\incoming_log.csv
This script then also re-creates a blank log file and adds the column headings in the csv file to make viewing easier.
You can copy and paste the above code into notepad and save it as a bat file and run it via the task scheduler.

Hope this helps someone out there.