Click here to Skip to main content
13,292,205 members (57,061 online)
Click here to Skip to main content
Add your own
alternative version


48 bookmarked
Posted 16 Oct 2008

Storing ECG to a PACS

, 16 Oct 2008
Rate this:
Please Sign up or sign in to vote.
An article on a service that will store an ECG copied to a directory at a PACS. (supported formats SCP-ECG, DICOM-ECG and a recent version of HL7 aECG)


The application in this article will allow easy storing of electrocariographs (ECGs) to a DICOM PACS.


Many ECG Cart manufacturers have got their own closed format. For Medical Images, the DICOM standard has provided hospitals with manufacturer independent solutions. Some manufacturers recently started adopting DICOM for ECG systems.

In 2008, an ECG Toolkit has been released which provides support for 3 major open ECG formats: SCP-ECG, HL7 aECG and DICOM-ECG. The Toolkit is available here.

Besides providing an ECG Library, the ECG Toolkit also has got some handy applications including a basic ECG viewer:

ECG Viewer provided by the C# ECG Toolkit

Using the Application

The application can be used as a Service or as a command line application.

To use the application as a service, use installutil to register the service. Start application manually from the management console.

To use the application from the command line, use:

> ECGtoPACS.exe runcmd

To configure the application, change the values specified in ECGtoPACS.exe.config:

<?xml version="1.0" encoding="utf-8" ?>
		<add key="ImportDir" value="C:\ecg2pacs" />
		<add key="EraseOnSuccess" value="true" />
		<!--<span class="code-comment"> configuration items for the DICOM-ECG format --></span>
		<add key="Mortara Compatibility" value="true" />
		<!--<span class="code-comment"> configuration items for the DICOM PACS --></span>
		<add key="Server" value="" />
		<add key="AESCU" value="ANYSCU" />
		<add key="AESCP" value="STORESCP" />
		<add key="Port" value="104" />

Place a SCP-ECG, HL7 aECG or DICOM-ECG file into the ImportDir. Example ECG files can be found here.

Using the Code

Reading an ECG of unknown type can be done by:

UnknownReader reader = new UnknownReader();
IECGFormat src = reader.Read(sFilePath);

if (reader.getError() != 0)
	ServiceLogger.Instance.Log("Reading ECG error: " + 
		reader.getErrorMessage() + "!", EventLogEntryType.FailureAudit);

if ((src == null)
||  !src.Works())
	ServiceLogger.Instance.Log("Unknown error during reading of ECG!", 

Sending ECG to PACs is performed by:

IECGManagementSystem pacs = ECGConverter.Instance.getECGManagementSystem("PACS");

pacs.Config.Set(_SystemConfig); // set configuration of PACS

// save ECG to PACS providing an PatientID (null) and DICOM format configuration.
if (pacs.SaveECG(src, null, _FormatConfig) != 0) 
	ServiceLogger.Instance.Log("Storing ECG to PACS failed!", 

Points of Interest

Retrieving of ECG information can be achieved by using five properties provided by IECGFormat interface. The five properties are:

  • Demographics
  • Signals
  • Diagnostics
  • GlobalMeasurements
  • LeadMeasurements


  • 13th October, 2008: First version of ECGtoPACS


This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


About the Author

MJB van Ettinger
Software Developer Erasmus MC
Netherlands Netherlands
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 3 Pin
Member 1029152423-Sep-13 1:33
memberMember 1029152423-Sep-13 1:33 
GeneralRe: My vote of 3 Pin
MJB van Ettinger23-Sep-13 2:34
memberMJB van Ettinger23-Sep-13 2:34 
GeneralRe: My vote of 3 Pin
Member 1029152421-Jan-14 3:49
memberMember 1029152421-Jan-14 3:49 
Questionsave dicom files to pc without pacs Pin
VincentZh11-Apr-13 21:54
memberVincentZh11-Apr-13 21:54 
AnswerRe: save dicom files to pc without pacs Pin
MJB van Ettinger3-Jun-13 2:18
memberMJB van Ettinger3-Jun-13 2:18 
Questionsupport for Mortara XML files? Pin
alwittta1-Mar-12 0:09
memberalwittta1-Mar-12 0:09 
AnswerRe: support for Mortara XML files? Pin
MJB van Ettinger3-Jun-13 2:23
memberMJB van Ettinger3-Jun-13 2:23 
QuestionUnable to open the sample .xml file. Pin
vib_mun@indiatimes.com23-Jan-11 2:42
membervib_mun@indiatimes.com23-Jan-11 2:42 
AnswerRe: Unable to open the sample .xml file. Pin
vib_mun@indiatimes.com31-Jul-11 19:54
membervib_mun@indiatimes.com31-Jul-11 19:54 
Generalnice Pin
karapelerin20-Dec-09 5:59
memberkarapelerin20-Dec-09 5:59 
nice application. about tutorial youtube

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 16 Oct 2008
Article Copyright 2008 by MJB van Ettinger
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid