You are on page 1of 6

Journal of Information Technology and Applications

Vol. 2, No. 3, pp. 135-140, 2007


* Corresponding author. 135
Construction and Application of an Electronic ECG Management System
Chia-Cheng Chiang
Cathay General Hospital/Hsinchu Branch/Emergency Department
National Chiao Tung University/Department of Electrical and Control Engineering
m9102045@chu.edu.tw

Wen-Ching Tzeng*
Chung Hua University/Department of Bioinformatics
ttzeng@chu.edu.tw

Han-Chin Cheng
Chung Hua University/Department of Bioinformatics
Wei Gong Memorial Hospital
hcchenger@yahoo.com.tw

Chin-Teng Lin
National Chiao-Tung University/Department of Electrical and Control Engineering
Ctpeter.lin@msa.hinet.net

Ya-Chu Yang
Chung Hua University/Department of Bioinformatics
m9202019@chu.edu.tw

Sheng-Fu Liang
University System of Taiwan/Brain Research Center
sfliang@mail.nctu.edu.tw

Soon-Bock Lim
Ching Chyuan General Hospital/Emergency Department
sblim1221@yahoo.com.tw

Abstract
Background and Purpose: Electrocardiogram (ECG) is one of the most used non-invasive and low-cost
diagnostic examinations in clinical practice. Most hospitals use plain paper for ECG recording and storage. In
modern hospitals, medical data need to be digitized for efficient management. The primary objective of this
study was to develop an electronic 12-lead ECG database management system for a local hospital.
Methods: The system was developed by using PHP, MySQL, and Matlab for file transmission, format
conversion, record storage, and signal analysis of SCP-ECG records. Computerized ECG data were collected
in a local hospital since August 2003. Open-source formats (XML, SVG, PNG) were transformed for further
application and representation of ECG.
Results: (1) more than ten thousands complete ECG files were collected; (2) ECG files were transformed
into FDA_XML, ecgML, SVG and PNG formats through the established server; (3) a disease-specific
database was established; (4) physicians and researchers can review and analyze ECG via this database
system.
Conclusions: The established electronic ECG management system can provide effective ECG informatics
services to aid diagnosis for clinical physicians and ECG signal processing for researchers. In the future,
studies will be done on other medical signals such as holter ECG, exercise ECG, patient monitor, and
phenocardiogram. The establishing of an inter-hospital medical signal database will also be investigated.
Key word: Computerized, Database, ECG, SCP, XML

Journal of Information Technology and Applications
Vol. 2, No. 3, pp. 135-140, 2007
136
1. Introduction
ECG is one of the most essential non-invasive
diagnostic examination methods; it is a low cost
procedure wich makes early diagnosis of
heart-related diseases possible. Its the most common
emergency cardiological examination used in
healthcare. Currently, ECGs are mainly done on plain
paper. The paper ECG has many disadvantages: poor
maintenance, low availability, and inferior
interoperability. To overcome these drawbacks and
enhance usability of ECG, its digitization is necessary.
Computerized ECG has been developed for decades.
To facilitate the compatibility of the data of different
electrocardiographs, the OpenECG project has been
promoting SCP-ECG (Standard Communications
Protocol for Computer-Assisted Electrocardiography)
format for decades[1]. However, most ECG
equipment manufacturers use proprietary protocols
for data communication and storage. Some
researchers have developed hard copy or scanning
methods for converting paper ECGs into electronic
format[2,3]. However, poor resolution and tedious
manual processes have been the major impediment to
their applicability. To facilitate the acquisition of raw
ECG data and to promote the usage of open-source
ECG formats, an SCP-compatible ECG decoding
program was designed in a previous study[4]. This
decoding program obtains SCP-related ECG data
from clinical electrocardiographs and then transmits
them to a web server. A web-based electronic ECG
management system was developed and applied in a
clinical environment over the past two years.

2. Materials and Methods
2.1 Materials
SCP-compatible files were collected from the
Emergency Department of the Wei-Gong Memorial
Hospital in Miao-Li County in Taiwan. The
collecting time was from August 2003 to J uly 2006.
The ECG cart used in this study was a
Philips/Agilent PageWriter M1770A Cardiograph
with an Option #A05 storage package. The ECG
records were transmitted to the local host by a RS232
cable.

2.2 ECG Database Management System
(EMS)
A three-tier architecture model, which has been
an industry standard for decades and has been used in
many studies[5,6], was applied for the system
implementation. The database was based on MySQL
and Windows OS with a web-based front-end
interface. The ECG data were managed with a
MySQL database management system (DBMS).
Temporal data and ECG waveform data were stored
in the Windows built-in file-directory system. Open
source software was used for system implementation
dependent upon maintenance cost, stability and
efficiency. The backbone of this system was Apache,
PHP and MySQL, all freeware but with satisfactory
performance. The base of the system (first-tier)
consisted of the MySQL DBMS and a file-directory
system. The file-directory structure was modified to
meet the needs of the MySQL database and the PHP
scripts. On top of first-tier was the second-tier, which
was implemented with Apache and PHP. This was the
core component of the system. Apache was used as
web server to facilitate communications between
each sub-system. PHP was the preprocessor used for
logic interpretation of web applications. Commands
for each sub-system were interpreted and processed
by PHP and then passed to the Apache server for web
representation. Finally, web-browsers formed the
third-tier for end-users (clients) via the Internet.
Figure 1 illustrates the three-tier architecture of the
web-based electronic ECG management system.

Figure 1: The three-tier architecture of the web-based
electronic ECG management system

2.3 Database schema
The ECG database system is a relational
database management system (RDBMS). As shown
in Figure 2, seven tables were established under this
schema.

Figure 2: Schema of the ECG database system
Journal of Information Technology and Applications
Vol. 2, No. 3, pp. 135-140, 2007
137
2.4 File-Directory System
For the flexibility and performance of the
database system, only the index/indices to individual
files is/were stored in the database. Large chunks of
biomedical data were stored in separate files using an
ASCII-based file format (.tx0, .tx1, .tx2). This
file-directory system was built on the Windows
operation system. Waveform data generated from 2.5
seconds standard 12-lead and 10 seconds long-lead
rhythm were stored in filename.tx1 and filename.tx2,
respectively. The path for each file was recorded in
the database system. For further inter-hospital data
exchange, the hospital and department codes were
stored in the database. The decoded files
(.tx0, .tx1, .tx2) and related files (such
as .png, .xml, .svg, etc.) were stored in corresponding
sub-directories. As shown in Figure 3, the
file-directory system was organized in a tree
structure.


Figure 3: Tree structure of the file-directory system

2.5 Data format exchange
ECG raw data were stored in EMS in the ASCII
format. In order to meet the needs of clinical
physicians and academic researchers, several
open-source ECG formats, such as XML (FDA-XML
or ecgML), SVG, and PNG, were used to exchange
ECG information.

3 Results
3.1 ECG database
More than ten thousand complete 12-lead ECG
files were collected over the past two years. As
shown in Figure 4, some useful information decoded
from SCP file was stored in the MySQL database.

Figure 4: Information stored in the MySQL database.

3.2 Web Server Interface
A user-friendly, easy-to-use web interface
(WebECG) was developed[7]. Authorized end-users
can log in the system and browse the database. Figure
5 shows the query function of the EMS system.


Figure 5: Query function of the EMS system

There are two ways an end-user can query the
database: (1) query by patient id; (2) query by date.
Figure 6 shows the results of a query by a patient id.

Figure 6: Results of a query by patient id (pid)

3.3 Data format exchange
Four open-source ECG-related formats were
generated by this system including FDA_XML,
ecgML, SVG, and PNG.

3.3.1 Rendering ECG with XML
An XML-related format has been recommended
by the Food and Drug Administration (FDA) for
annotated ECG waveform data since November
2001[8,9]. An FDA_XML format was developed
using the HL7 Version 3 standard[10,11]. Figure 7
shows the FDA_XML document generated by this
ECG management system.
Journal of Information Technology and Applications
Vol. 2, No. 3, pp. 135-140, 2007
138

Figure 7: FDA_XML document of an ECG shown in
IE6.0 with MSXML4.0 plug-in

An FDA_XML viewer downloaded from AMPS
LLC website can be used to visualize the FDA_XML
file[11,12]. Figure 8 shows the FDA_XML document
of an ECG represented by the FDA_XML viewer.


Figure 8: FDA_XML document of an ECG
represented by the FDA_XML viewer

An alternative XML format for ECG is ecgML,
which was developed by Wang et al and had a
simpler structure[13]. Figure 9 shows an ecgML
document represented by the ecgML browser.


Figure 9: ecgML document represented by the
ecgML browser

3.3.2 Rendering ECG with SVG
In order to represent ECG waveform data on the
web, some graphic formats were used for viewing
and transmitting. SVG and PNG are the most popular
formats and have been recommended by World Wide
Web Consortium (W3C)[14]. For this study PNG was
chosen as the raster image output format and SVG as
the scalable vector image output format.
Comprehensive documentation and support of these
two formats are available on the W3C website and
Internet.
A standalone SVG document was generated
online by the system. Figure 10 shows the SVG
document of an ECG represented by the Adobe SVG
viewer using IE6.0 with Adobe viewer 3.0
plug-in[15].


Figure 10: SVG document of ECG represented by the
Adobe SVG viewer using IE6.0

A PNG file was also generated online by the
system. Figure 11 shows the PNG graphic
representation of an ECG using IE6.0. Almost all
web browsers support the PNG format, including
Netscape and Internet Explore. Authorized end-users
can review the ECG records stored in the database
worldwide via the PNG format.


Figure 11: PNG file representation of ECG using
IE6.0
Journal of Information Technology and Applications
Vol. 2, No. 3, pp. 135-140, 2007
139
3.3.3 Specific Disease Database
During the past two years, three specific disease
databases have been established from the clinical
data:
(1) Hyperkalemia: 67 records
(2) Hypokalemia: 80 records
(3) AMI: 98 records
Every case was diagnosed and reviewed by
clinical physicians to confirm the diagnosis. Related
clinical data and laboratory examinations, such as
electrolyte concentrations (sodium and potassium for
hyper- or hypo-kalemia), and cardiac enzymes (CPK,
MB, and Troponin-I for AMI), were collected from
the results of laboratory tests.

4. Discussion
A web-based electronic ECG management
system , which offers multifaceted solutions for
managing ECGs, such as stability, compatibility,
accessibility, flexibility, user-friendly interface and
easy-to-maintain properties, was developed. Open
source freeware with good performance and stability,
such as Apache, PHP and MySQL, were used to
minimize maintenance cost.
No all-purpose, efficient, user-friendly, and
unified format for ECG data is available yet. The
choice of format depends on the domain of
researchers application[16]. The XML related format
(including FDA_XML, ecgML, and SVG) is a
well-formed format, since it is derived from Standard
Generalized Markup Language (SGML) and verified
by W3C. At present, it seems that the XML format is
preferred for the ECG format.
FDA_XML is well-defined by HL7 and
recommended by FDA[8,9]. A viewer with multiple
functions has been developed for FDA_XML format
representation of an ECG[12]. However, the
FDA_XML is designed for dealing with various
biological signals, and it is not specifically tailored
for ECG. Hence, not only is the format of the
FDA_XML for ECG complex, but the vocabulary of
FDA_XML does not conform to the traditional
nomenclatures of the ECG. To overcome these
drawbacks, ecgML was proposed in 2003[13].
Simplicity, flexibility and extensibility are major
advantages of ecgML. A primitive ecgML browser
with simple functions was developed. However, the
applicability of the ecgML browser is limited,
because only three leads can be seen in the browser at
the same time, and the quality and precision are less
than that of the FDA_XML viewer.
SVG, an extension of XML file format, has been
recommended by W3C[17] and widely used by many
institutes for graphic representation of data in XML
files. It does not only reserve all information of the
raw ECG data but also provides an interactive
function via a properly designed viewer. The
powerful functionality offered by an SVG viewer
makes it an attractive alternative of ECG format.
Some ECG signal analysis modules, such as
ECG characteristic points detection and RR wave
detection, have been developed successfully in a
previous study[4]. Until now, the developed modules
have not been integrated into other components such
as XML or SVG for further analysis. Since
FDA_XML and ecgML both support annotation of an
ECG waveform, the results of the signal analysis can
be embedded in the XML-related ECG files.
Integration of these analysis modules with other
components enhances the functionality of the studied
ECG management system.
Although more then ten thousands ECG records
have been stored in the database, only three
disease-specific databases have been established. The
process of disease database establishment is tedious
and time-consuming because the collection of the
clinical data is done mainly manually. The process
can be accelerated, if this system can communicate
with or be integrated into the Hospital Information
System (HIS).
In conclusion, the established electronic ECG
management system can provide effective ECG
informatics services such as online ECG pattern
recognition to aid diagnosis for clinical physicians
and ECG signal processing and analysis for
researchers. The design and development of this
web-based electronic system is an important
component in providing better and more efficient
online ECG data management. With the addition of
signal analyzing modules, the system can serve as a
diagnosis-aid for physicians and as an analysis
platform for researchers. The format exchanging
programs developed in this study can enhance the
interoperability of ECG data. Other medical signals
such as holter ECG, exercise ECG, patient monitor,
and phenocardiogram could be studied in future.
Other possible studies could include intra-hospital
integration systems, for example communication with
HIS, interaction with Picture Archiving and
Communication System (PACS) and integration with
Electronic Patient Record (EPR). Eventually, a
country-wide inter-hospital medical signal database
should be aimed at.

Acknowledgements
This project is granted by NSC (National
Science Council, NSC 93-2213-E-216-011 and NSC
93-2213-E-216-030), Taiwan. Our gratitude is
extended to Shih-Ming Shieh, M.D., the head of
Wei-Gong Memorial Hospital, who generously
assisted our research. Finally, we thank for the
funding and support provided by Chung Hua
University, Taiwan.


Journal of Information Technology and Applications
Vol. 2, No. 3, pp. 135-140, 2007
140
References
[1] Chronaki C. E., Chiarugi F., Lees P. J ., et al,
2002, OpenECG: a European Project to
Promote the SCP-ECG Standard, a Further Step
Towards Interoperability in
Electrocardiography, Computers in Cardiology
Vol. 29, pp. 285-288.
[2] Lobodzinski S. M., Teppner U., Laks M., 2003,
State of the art techniques for preservation and
reuse of hard copy electrocardiograms,
Journal of Electrocardiology, Vol. 36(Suppl.),
pp. 151-155.
[3] Badilini F., Erdem T., Zareba W., et al, 2005,
ECGScan: A method for conversion of paper
electrocardiographic printouts to digital
electrocardiographic files, Journal of
Electrocardiology, Vol. 38, pp. 310-318.
[4] Chiang C. C., Yang Y. C., Tzeng W. C., et al,
2004, An SCP Compatible 12-Lead
Electrocardiogram Database for Signal
Transmission, Storage and Analysis,
Computers in Cardiology, Vol. 31, pp. 621-624.
[5] Paracha M. A., Mohammad S. N., Macfarlane P.
W., et al, 2003, Implementation of Web
Database for ECG, Computers in Cardiology,
Vol. 30, pp. 271-274.
[6] Zhou S., Guillemette G., Antinoro R., et al,
2003, New Approaches in Philips ECG
Database Management System Design,
Computers in Cardiology, Vol. 30, pp. 267-270.
[7] WebECG website. Available from: [Accessed
on 20 September 2006].
[8] Stockbridge N., Brown B. D., 2004, Annotated
ECG waveform data at FDA, Journal of
Electrocardiology, Vol. 37, pp. 63-64.
[9] Specification for Annotated
Electrocardiographic Waveform Data in
Electronic Format; Request for Comments,
[FDA Docket No. 03N-0158]. Available from:
[Accessed on 18 December 2005].
[10] HL7 Version 3 Standard, Document: Health
and Clinical Management Domains, Available
from:[Accessed on 18 December 2005].
[11] Brown B., Kohls M., Stockbridge N., 2005,
FDA XML Data Format Design Specification,
Draft B, Available from: [Accessed on 18
December 2005].
[12] Badilini F., Isola L., 2004, Freeware ECG
Viewer for the XML FDA Format,
S5.5_PA.pdf, AMPS LLC, Montichiari. New
York, USA, Italy. 2nd OpenECG Workshop,
Berlin, Germany.
[13] Wang H., Azuaje F., Jung B., et al, 2003, A
markup language for electrocardiogram data
acquisition and analysis (ecgML), BMC
Medical Informatics and Decision Support, Vol.
3, pp. 4
[14] W3C, graphics on the web. Available from:
[Accessed on 18 May 2006].
[15] Adobe SVG Viewer. Available from: [Accessed
on 18 May 2006].
[16] Varri A., Kemp B., Penzel T., et al, 2001,
Standards for biomedical signal databases
IEEE Engineering in Medicine and Biology
Magazine, Vol. 20, No. 3, pp. 33-37.
[17] SVG Home Page. Available from: [Accessed on
18 May 2005].

You might also like