Real Time Measurement and Visualization of ECG on … · Real Time Measurement and Visualization of...

12
N.T. Nguyen et al. (Eds.): Adv. in Intelligent Inform. and Database Systems, SCI 283, pp. 67–78. springerlink.com © Springer-Verlag Berlin Heidelberg 2009 Real Time Measurement and Visualization of ECG on Mobile Monitoring Stations of Biotelemetric System Ondrej Krejcar, Dalibor Janckulik, Leona Motalova, Karel Musil, and Marek Penhaker VSB Technical University of Ostrava, Center for Applied Cybernetics, Department of Measurement and Control, Faculty of Electrical Engineering and Computer Science, 17. Listopadu 15, 70833 Ostrava Poruba, Czech Republic [email protected], [email protected], [email protected], [email protected], [email protected] Abstract. The main area of interest of our Biotelemetric System is to pro- vide solution which can be used in different areas of health care and which will be available through PDAs (Personal Digital Assistants), web browsers or desktop clients. In paper we deals with a problem of visualization of measured ECG signal on mobile devices in Real Time as well as with a so- lution how to solve a problem of unsuccessful data processing on desktop or server. The realized system deals with an ECG sensor connected to mobile equipment, such as PDA/Embedded, based on Microsoft Windows Mobile operating system. The whole system is based on the architecture of .NET Framework, .NET Compact Framework, and Microsoft SQL Server. Visu- alization possibilities of ECG data are also discussed as the WPF (Windows Presentation Foundation) solution. The project was successfully tested in real environment in cryogenic room (-136 O C). Keywords: Real Time, PDA, Embedded Device, Biotelemetry, ECG. 1 Introduction Aim of the platform for patients’ bio-parameters monitoring is to offer a solution providing services to help and make full health care more efficient without limita- tions for specific country. Physicians and other medical staff will not be forced to make difficult and manual work including unending paperwork, but they will be able to focus on the patients and their problems. All data will be accessible almost anytime anywhere through special applications designated for portable devices web browser or desktop clients and any changes will be made immediately at disposal to medical staff based on the security clearance. Physicians will have immediate access to the patient’s newest results of accom- plished examinations. In the case that the ambulance have to go to some accident, rescue team can due to portable devices send information about patient health condition directly to hospital where responsible doctors and staff will have

Transcript of Real Time Measurement and Visualization of ECG on … · Real Time Measurement and Visualization of...

N.T. Nguyen et al. (Eds.): Adv. in Intelligent Inform. and Database Systems, SCI 283, pp. 67–78. springerlink.com © Springer-Verlag Berlin Heidelberg 2009

Real Time Measurement and Visualization of ECG on Mobile Monitoring Stations of Biotelemetric System

Ondrej Krejcar, Dalibor Janckulik, Leona Motalova, Karel Musil, and Marek Penhaker

VSB Technical University of Ostrava, Center for Applied Cybernetics, Department of Measurement and Control, Faculty of Electrical Engineering and Computer Science, 17.

Listopadu 15, 70833 Ostrava Poruba, Czech Republic [email protected],

[email protected], [email protected], [email protected], [email protected]

Abstract. The main area of interest of our Biotelemetric System is to pro-vide solution which can be used in different areas of health care and which will be available through PDAs (Personal Digital Assistants), web browsers or desktop clients. In paper we deals with a problem of visualization of measured ECG signal on mobile devices in Real Time as well as with a so-lution how to solve a problem of unsuccessful data processing on desktop or server. The realized system deals with an ECG sensor connected to mobile equipment, such as PDA/Embedded, based on Microsoft Windows Mobile operating system. The whole system is based on the architecture of .NET Framework, .NET Compact Framework, and Microsoft SQL Server. Visu-alization possibilities of ECG data are also discussed as the WPF (Windows Presentation Foundation) solution. The project was successfully tested in real environment in cryogenic room (-136OC).

Keywords: Real Time, PDA, Embedded Device, Biotelemetry, ECG.

1 Introduction

Aim of the platform for patients’ bio-parameters monitoring is to offer a solution providing services to help and make full health care more efficient without limita-tions for specific country. Physicians and other medical staff will not be forced to make difficult and manual work including unending paperwork, but they will be able to focus on the patients and their problems. All data will be accessible almost anytime anywhere through special applications designated for portable devices web browser or desktop clients and any changes will be made immediately at disposal to medical staff based on the security clearance.

Physicians will have immediate access to the patient’s newest results of accom-plished examinations. In the case that the ambulance have to go to some accident, rescue team can due to portable devices send information about patient health condition directly to hospital where responsible doctors and staff will have

68 O. Krejcar et al.

information needed to execute immediate operation without delaying by prepara-tion of necessary equipment.

All bio-signals data are stored and automatically analyzed by neuronal network. System can evaluate presence of critical values which could be the sign of worse medical condition of a patient. In the moment of crossing the border of monitored bio-signals values predefined by doctor, system will inform responsible medical staff and provides all information which could help to determine the cause and seriousness of the problem.

Fig. 1. Architecture of Guardian II platform

The basic idea is to create a system that controls important information about the state of a wheelchair-bound person (monitoring of ECG and pulse in early phases, then other optional values like temperature or oxidation of blood etc.), his situation in time and place (GPS) and an axis tilt of his body or wheelchair (2axis accelerometer). Values are measured with the existing equipment, which commu-nicates with the module for processing via Bluetooth wireless communication technology. Most of the data (according to heftiness) is processed directly in PDA or Embedded equipment to a form that is acceptable for simple visualization.

Two variants are possible in case of embedded equipment – with visualization and without visualization (entity with/without LCD display). Data is continually sent by GPRS or WiFi network to a server, where they are processed and evalu-ated in detail. Processing and evaluating on the server consists of - receiving data, saving data to data storage, visualization in an advanced form (possibility to recur to the older graph, zoom on a histogram (graph with historical trend), copying from the graphs, printing graphs), automatic evaluation of the critical states with the help of advanced technologies (algorithms) that use Artificial intelligence to notify the operator about the critical state and its archiving. Application in PDA,

Real Time Measurement and Visualization of ECG 69

Embedded equipment is comfortable, with minimum time - the first configuration, but also configuration after downfall of application.

The problem we would like to describe is concerned from the processing of ECG data in Real Time. ECG data are the most complex in compare to each other previously mentioned. The problem was found in processing of 12 channels ECG from BT ECG device to database. Our current software application on .NET plat-form is unable to process these data in real time to provide an online visualization neither on desktop nor on mobile device. We found only two possibilities to sur-pass this problem. First is in SQL server procedure, second solution is in use of embedded microcontrollers unit HCS08 for data preprocessing. These phenomena will be discussed in section 3.

2 Developed Parts of Platform

Complete proposition of solution and implementation of the platform for patient’s biotelemetry as it was described in previous section requires determination and teamwork. Every single part of the architecture has to be designed for easy appli-cation and connectivity without user extra effort, but user must be able to use given solution easily and effectively. Crucial parts of whole architecture are net-work servers, database servers and client applications. Due to these crucial parts the development is focused particularly on proposition and implementation of mobile and desktop client application, database structure and some other impor-tant web services.

2.1 Server Parts

In order to run a server, an operating system supporting IIS (Internet Information Server) is needed. IIS allow to users to connect to the web server by the HTTP protocol. The web service transfers data between the server and PDA/Embedded devices. Web service also read the data, sends acknowledgments, and stores the data in the database. The service is built upon ASP.NET 2.0 technology. The SOAP protocol is used for the transport of XML data.

Methods that devices communicating with the web service can use include:

• receiving measured data, • receiving patient data, • deleting a patient, • patient data sending.

To observe measured data effectively, visualization is needed. A type of graph as used in professional solutions is an ideal solution. To achieve this in a server ap-plication, a freeware Zed Graph library can be used. For data analysis, neural nets are a convenient solution. However, there are problems in the automatic detection of critical states. Every person has a specific ECG pattern. The Neural net has to learn to distinguish critical states of each patient separately.

70 O. Krejcar et al.

Important part of Guardian is central database. There are stored all data of medical staff and patients. Data of patients include different records such as diag-nosis, treatment progress or data which are results of measuring by small portable devices designated to home care. These data represent the greatest problem, be-cause amount of these data rapidly increase with increasing amount of patients. Due to this fact database servers are very loaded.

2.2 Mobile Parts

The main part of the system is an Embedded or PDA device. The difference in applications for measurement units is the possibility to visualize the measured data in both Real-time Graph and Historical Trend Graph, which can be omitted on an embedded device. PDA is a much better choice for Personal Healthcare, where the patient is already healthy and needs to review his condition. Embedded devices can be designed for one user, with the option to use an external display used for settings or with the possibility of usage in extreme conditions.

The information about user, as ID, name, surname, address and application properties are stored in the system registry (HKEY_CURRENT_USER / Software / Guardian). Working (saving, reading, finding) with registry is easier and faster as saving these information in file. User registry values are crypted with simple algo-rithm (shifting char ASCII value).

Devices based on PDA type have a several limitations such as low CPU per-formance, low battery life or small display, which is possible to solve by embed-ded version of such mobile clients. We created a special windows mobile based embedded device. During the development process the several problems occurred. One of them and the most important was the need of a new operation system crea-tion for our special architectural and device needs. We used the Microsoft Plat-formBuilder for Windows CE 4.2 tools. The created operation system based on standard windows mobile has several drivers which we need to operate with communication devices and measurement devices.

As measurement device is possible to connect several device with Bluetooth communication possibility. In our application we use an ECG Measurement Unit (3channels ECG Corbelt or 12 channels BlueECG) through a virtual serial port using wireless Bluetooth technology. Measured data are stored on a SD Memory Card as a database of MS SQL Server 2008 Mobile Edition. The performance of available devices seems insufficient for sequential access [Table 1]; parsing of incoming packets is heavily time-consuming. Pseudo paralleling is strongly re-quired. A newer operating system (Windows Mobile 6) must be used to allow the processing of data from a professional EKG due to thread count limitations.

Table 1. Mobile Devices with LCD 480x800 pixels, GSM, WiFi, BT

Mobile device OS WM Display CPU [Mhz] SPB Benchmark Index HTC Touch HD 6.1 Pro LCD 3,8” 528 553

HTC Touch HD2 6.5 Pro LCD 4,3” 1000 779 HTC Touch Diamond 2 6.5 Pro LCD 3,2” 528 520

Samsung Omnia II 6.5 Pro LED 3,7” 800 565

Real Time Measurement and Visualization of ECG 71

3 Visualization

To make an ECG visualisation the measured data are needed at the beginning. The measurement is made on bipolar ECG corbel and 12 channels BlueECG. The amount0020needed to transfer from source device through a Bluetooth is in Table 2. You can compare the increased data transfer speed in case of 12 channels ECG to 1 500 bytes per second. These data amount is very small; on the other hand the data are going as packets, so the processing is needed before the real data can be accessed.

Table 2. BT ECG Device -> Mobile Device measurement

ECG device Packet Size [Bytes] Speed [Packets/s] Transfer Speed [kB/s] 3 Channels 100 3x 0,3

12 Channels 300 5x 1,5

Table 3. BT ECG device measurement

ECG device Platform Problem Real Time BT – Mobile device – Server –Visualization .NET Frame-

work Memory overflow

Impossible

BT – Mobile device – Server –Visualization C++ Memory overflow

Impossible

BT – Mobile device – Server – DB - Visualization

SQL Server procedure

- Soft RT (2 sec deadline)

BT – MCU - Mobile device – Server - Visualization

MCU HCS08

- Hard RT

This process (called “parsing”) take an unacceptable time in case of mobile de-vice to process the data in Real Time [Table 3]. Same problem is growing on desktop PC, where the C# or C++ is used. In both cases the Memory Overflow is reached. The only possible way we found is in use of SQL procedure which is executed on SQL server. When the data (packets) are stored in table the procedure is call to execute and provide RAW data. In such case the data are ready to user-consumer application until 2 second deadline, so the Soft Real Time is possible to use [Fig. 2].

The RAW data table contains full size packets received from an ECG device. Only the packets with measured data are stored to database. Those packets must contain in part of packet number bytes with a value of 0x0724 [Table 4].

The table with parsed data [Table 5] contains decimal values. Column „I“ con-tains data from bipolar ECG; column „II“ with „I“ contains data from 6-channel ECG. The 12-channel ECG fills after parsing columns „I II V1 V2 V3 V4 V5 V6“.

72 O. Krejcar et al.

Table 4. RAW data table

Table 5. Data table of Parsed data

Fig. 2. Measurement chain: ECG Bluetooth device – mobile device – server - Visualization

Real Time Measurement and Visualization of ECG 73

Fig. 3. Measurement chain detail for FPGA solution inside the USB BT dongle

To get a real ECG data immediately after the measurement the next way can be used. We can use a special microcontroller (MCU) embedded in USB unit. This MCU unit has a full speed (12Mbit/s) USB access and BT is connected through a serial port [Fig. 3]. The MCU unit process all needed operations with parsing to provide a real ECG record to database or directly to visualizing application. In case of WPF application the Hard Real Time mode was reached.

An example of real ECG record is shown in [Fig 4]. In this case only Soft Real Time mode was reached even when a special MCU unit was used for preprocessing

Fig. 4. Real Time visualization of bipolar ECG on desktop device in classical Windows Forms application

74 O. Krejcar et al.

of data. In next subsection the use of WPF application is described as only way when the hard Real Time was reached on windows desktop PC (Windows RTX extension was used).

3.1 ECG Visualization in WPF Application

WPF (Windows Presentation Foundation) provide up to date possibilities to visu-alize ECG data on desktop PC. We create a WPF application to provide a full scale of graphic features to user. WPF technology runs directly on GPU possibili-ties (Graphic Processing Unit) which is founded on modern graphics cards. This fact is key parameter for speed of data presentation of screen. CPU has more time to compute others tasks (e.g. ECG data analyses by neural network tasks). WPF has a more design possibilities in compare to classical Windows Forms including 3D animation, pattern changes of whatever elements etc..

WPF application allows viewing an ECG characteristic of measured patient in Real Time, selection of patient from database and view of historical graphs. The figure [Fig. 5] shows an example of bipolar ECG characteristic in WPF application.

Fig. 5. Real Time visualization of bipolar ECG on desktop device in WPF application

3.2 Battery Consumption Tests

During the real tests the battery consumption tests were executed. Firstly the set of two monocell battery with nominal voltage of 2,5 V were tested without success-ful time of usage. They provide only 2 hours of operation time. At second case the Lithium-Polymer cell was used with nominal voltage of 3,7 V. In this case an additional circuitry is needed to use an USB port for recharging of battery in

Real Time Measurement and Visualization of ECG 75

device. At figure [Fig. 6] the battery test screen of 12 channels ECG is presented. Figure shows the voltage of 3V (discharged battery) where current is presented by light trace on oscilloscope screen and its average value is approximately equal to 106 mA.

Figure [Fig. 7] shows the same at a normal charged battery voltage level where the average current is going down to 81 mA. In case of Li-Pol battery usage the operation time of 12 channels ECG is about 10 hours.

Fig. 6. Battery test screens of 12 channels ECG. Discharged battery

Fig. 7. Battery test screens of 12 channels ECG. Charged battery

76 O. Krejcar et al.

Fig. 8. Infracamera from Cryogenic chamber test

Fig. 9. Real image from Cryogenic chamber test

4 Conclusions

The measuring device (bipolar Corbelt ECG and 12 channels BlueECG) was tested in extreme conditions in a cryogen room in spa Teplice nad Becvou (Czech Republic) (-136°C) [Fig. 8], [Fig. 9]. All developed platforms were tested during these extreme tests with high credibility of measured data for physicians. The

Real Time Measurement and Visualization of ECG 77

reached experimental data will be used by physicians to make a set of recommen-dation for cardiac patient who are healing in this Cryogenic chamber. In such case of patients the time of recovery can be shortness by tens of percent. The Real Time measurement and visualization was reached in case of WPF usage (section 3.1). Necessary condition for comfort measurement is an operation time. Executed battery consumption tests (section 3.2) provide a suggestion to use a Li-Pol battery with nominal voltage of 3,7 V. In such case the operation time is going to suffi-cient 10 hours. As the final improvement in the future, the application would have some special algorithm, which could recognize any symptoms of the QRS curve, and make the job for the doctors much easier.

Acknowledgment. This work was supported by the Ministry of Education of the Czech Republic under Project 1M0567.

References

1. Krejcar, O., Cernohorsky, J.: Database Prebuffering as a Way to Create a Mobile Con-trol and Information System with Better Response Time. In: Bubak, M., van Albada, G.D., Dongarra, J., Sloot, P.M.A. (eds.) ICCS 2008, Part I. LNCS, vol. 5101, pp. 489–498. Springer, Heidelberg (2008)

2. Krejcar, O.: PDPT Framework - Building Information System with Wireless Con-nected Mobile Devices. In: CINCO 2006, 3rd International Conference on Informatics in Control, Automation and Robotics, Setubal, Portugal, Aug 01-05, 2006, pp. 162–167 (2006)

3. Krejcar, O., Cernohorsky, J.: New Possibilities of Intelligent Crisis Management by Large Multimedia Artifacts Prebuffering. In: I.T. Revolutions 2008, Venice, Italy, De-cember 17-19, 2008. LNICST, vol. 11, pp. 44–59. Springer, Heidelberg (2009)

4. Janckulik, D., Krejcar, O., Martinovic, J.: Personal Telemetric System – Guardian. In: Biodevices 2008, Insticc Setubal, Funchal, Portugal, pp. 170–173 (2008)

5. Krejcar, O., Cernohorsky, J., Janckulik, D.: Portable devices in Architecture of Per-sonal Biotelemetric Systems. In: 4th WSEAS International Conference on Cellular and Molecular Biology, Biophysics and Bioengineering, BIO 2008, Puerto De La Cruz, Canary Islands, Spain, December 15-17, 2008, pp. 60–64 (2008)

6. Krejcar, O., Cernohorsky, J., Czekaj, P.: Secured Access to RT Database in Bio-telemetric System. In: 4th WSEAS Int. Conference on Cellular and Molecular Biology, Biophysics and Bioengineering, BIO 2008, Puerto De La Cruz, Canary Islands, Spain, December 15-17, 2008, pp. 70–73 (2008)

7. Krejcar, O., Cernohorsky, J., Janckulik, D.: Database Architecture for real-time access-ing of Personal Biotelemetric Systems. In: 4th WSEAS Int. Conference on Cellular and Molecular Biology, Biophysics and Bioengineering, BIO 2008, Puerto De La Cruz, Canary Islands, Spain, December 15-17, 2008, pp. 85–89 (2008)

8. Penhaker, M., Cerny, M., Martinak, L., Spisak, J., Valkova, A.: HomeCare - Smart embedded biotelemetry system. In: World Congress on Medical Physics and Biomedi-cal Engineering, Seoul, South Korea, August 27-September 2001, vol. 14(1-6), pp. 711–714 (2006)

78 O. Krejcar et al.

9. Cerny, M., Penhaker, M.: Biotelemetry. In: 14th Nordic-Baltic Conference an Bio-medical Engineering and Medical Physics, IFMBE Proceedings, Riga, Latvia, June 16-20, vol. 20, pp. 405–408 (2008)

10. Krejcar, O., Janckulik, D., Motalova, L., Kufel, J.: Mobile Monitoring Stations and Web Visualization of Biotelemetric System - Guardian II. In: Mehmood, R., et al. (eds.) EuropeComm 2009. LNICST, vol. 16, pp. 284–291. Springer, Heidelberg (2009)

11. Krejcar, O., Janckulik, D., Motalova, L.: Complex Biomedical System with Mobile Clients. In: Dössel, O., Schlegel, W.C. (eds.) IFMBE Proceedings The World Congress on Medical Physics and Biomedical Engineering 2009, WC 2009, Munich, Germany, September 07-12, 2009, vol. 25(5), Springer, Heidelberg (2009)

12. Krejcar, O., Janckulik, D., Motalova, L., Frischer, R.: Architecture of Mobile and Desktop Stations for Noninvasive Continuous Blood Pressure Measurement. In: Dössel, O., Schlegel, W.C. (eds.) The World Congress on Medical Physics and Bio-medical Engineering 2009, WC 2009, Munich, Germany, September 07-12, 2009, vol. 25/5, Springer, Heidelberg (2009)

13. Cerny, M., Penhaker, M.: The HomeCare and circadian rhythm. In: conference pro-ceedings 5th International Conference on Information Technology and Applications in Biomedicine (ITAB) in conjunction with the 2nd International Symposium and Sum-mer School on Biomedical and Health Engineering (IS3BHE), Shenzhen, May 30-31, vol. 1(2), pp. 110–113 (2008)

14. Vasickova, Z., Augustynek, M.: New method for detection of epileptic seizure. Journal of Vibroengineering 11(2), 279–282 (2009)

15. Cerny, M., Martinak, L., Penhaker, M., et al.: Design and Implementation of Textile Sensors for Biotelemetry Applications. In: konference proceedings 14th Nordic-Baltic Conference an Biomedical Engineering and Medical Physics, Riga, LATVIA, June 16-20, vol. 20, pp. 194–197 (2008)

16. Idzkowski, A., Walendziuk, W.: Evaluation of the static posturograph platform accu-racy. Journal of Vibroengineering 11(3), 511–516 (2009)

17. Cerny, M.: Movement Monitoring in the HomeCare System. In: Schleger, D. (ed.) IFMBE proceddings, (25), Springer, Berlin (2009)