Click here to Skip to main content
Click here to Skip to main content

Storing ECG to a PACS

By , 16 Oct 2008
 

Introduction

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

Background

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" ?>
<configuration>
	<appSettings>
		<add key="ImportDir" value="C:\ecg2pacs" />
		<add key="EraseOnSuccess" value="true" />
		<!-- configuration items for the DICOM-ECG format -->
		<add key="Mortara Compatibility" value="true" />
		<!-- configuration items for the DICOM PACS -->
		<add key="Server" value="127.0.0.1" />
		<add key="AESCU" value="ANYSCU" />
		<add key="AESCP" value="STORESCP" />
		<add key="Port" value="104" />
	</appSettings>
</configuration>

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);
	return;
}

if ((src == null)
||  !src.Works())
{
	ServiceLogger.Instance.Log("Unknown error during reading of ECG!", 
				EventLogEntryType.FailureAudit);
	return;
}

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!", 
				EventLogEntryType.FailureAudit);
	return;
}

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

History

  • 13th October, 2008: First version of ECGtoPACS

License

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
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionsave dicom files to pc without pacsmemberVincentZh11 Apr '13 - 20:54 
i have some ecg files(scp-ecg、 XML), i wanna save them somewhere(dicom format). i use your Storing ECG to a PACS, but it doesn't work. So sad.
Questionsupport for Mortara XML files?memberalwittta29 Feb '12 - 23:09 
Hello sir,
 
I am doing a research on different ECG XML file format as part of my final year project.
 
Could you please tell me, whether this program supports Mortara ECG XML Files?
 
Thanks and Regards,
Alvin
This is me

QuestionUnable to open the sample .xml file.membervib_mun@indiatimes.com23 Jan '11 - 1:42 
I have .xml which represents an ECG.
 
But I am unable to view it in the ECGViewer.
Also uploading it to the pacs sevrer is also failing.
 
The machine from which the .xml is got is "Philips trim II".
Can u please look into this.If you give me you email address, I will send the sample file.
AnswerRe: Unable to open the sample .xml file.membervib_mun@indiatimes.com31 Jul '11 - 18:54 
Hi,
 
I am still not able to open the ECG files in the viewer, which are .xml based.
I am able to open the sample *xml file present as a sample.
 
Am I missing here something.
I will email the sample files, if you give me the addr.
 
[Marteen], the addr of your is not reachable. Can u please provide me alternate email address.
 
-Vibhav
Generalnicememberkarapelerin20 Dec '09 - 4:59 
nice application. about tutorial youtube
GeneralWrong storing ECG to PACSmemberMember 19947322 Jan '09 - 1:02 
I am trying to save to PACS DICOM ECG format but it fails.I always get message -"Storing ECG to PACS failed!"
How it has to be stored ? What parameters of configuration i have to change - only Server and Port ?
GeneralRe: Wrong storing ECG to PACS [modified]memberMJB van Ettinger22 Jan '09 - 1:58 
Off course the Server and port should be configured right, but you should also take a look at the following issues.
 
1 The AESCU and AESCP should be correct, because an PACS might reject your request based on these values.
 
2. The PACS should also be configured to accept the SOP Class UIDs:
to be safe allow these four on the PACS:
WaveformStorageTrialRetired
HemodynamicWaveformStorage
TwelveLeadECGWaveformStorage
GeneralECGWaveformStorage
 
3. The DICOM TransferSyntaxUID used should be supported by the PACS:
a. If Mortara Compatibility = true then ImplicitVRLittleEndian is used.
b. If Mortara Compatibility = false then ExplicitVRLittleEndian is used.
 
Hope this will help you solve the issues.
 
modified on Friday, January 30, 2009 5:19 AM

GeneralHOW TO CONNECT ECG TO PC?membercuthkid24 Jun '09 - 19:55 
I AM TRYING TO CONNECT ECG TO PC,BUT THE ‘ECGStoreSCU' MODULE DO NOT WORK.
IECGManagementSystem pacs = ECGConverter.Instance.getECGManagementSystem("PACS");
bool Anonymize = false;
string patid = null;
 
if (pacs == null)
{
Console.Error.WriteLine("Error: DICOM plugin not available!");// Frown | :( FALIDE HERE? WHAT SHUOULD I DO???
 
return;
}
AnswerRe: HOW TO CONNECT ECG TO PC?memberMJB van Ettinger24 Jun '09 - 21:07 
Most likely the application did not load the DICOM plug-in. You should add the "ECGCpluginDICOM.dll" (together with "dicomcs.dll") in the same folder as the main assembly.
 
If this doesn't work you can also add a line of code at the beginning of the application to specifically load any plug-in DLL:
ECGConverter.AddPlugin("path/to/plugin/dll");
Or for multiple plug-ins:
ECGConverter.AddPlugins("path/to/plugin/dir");
I hope this will solve your issue.
GeneralRe: HOW TO CONNECT ECG TO PC?membercuthkid24 Jun '09 - 22:34 
It's my first time to do something about DICOM,
I'll try later,thanks.

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

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