Computer diagnosis of the heart - pacemaker interface M. Malik and A. J. Camm Department of Cardiological Sciences, St George's Hospital Medical School, London SW17, UK The object of the so-called Electrocardiographic Inverse Problem is the algorithmic analysis and diagnosis of the electrocardiogram (ECG). A part of this general problem is the Pacemaker Inverse Problem, which means the analysis of the ECG in order to establish details of heart-pacemaker interaction (HPI) with special reference to the diagnosis of pacemaker failure. The solution to this problem is of practical importance, because it is often impossible to evaluate such records clinically. The ECG patterns of natural cardiac activity and of the events stimulated by the pacemaker may not be distinguishable and many combinations of potential response of the implanted device have to be taken into account. A computer system providing automatic analysis of the HPI, based on ECG data, has been developed and implemented on an IBM PC AT computer. The system uses a complex algorithm which enables the evaluation of all possible combinations of HPI events, and establishes for each of these combinations its correspondence to the specified pacemaker algorithm. The system is written in Turbo Pascal and its source text has more than 11000 lines. Keywords: Electrocardiographic inverseproblem,implantablepacemakers,heart-pacemaker interaction, diagnosisof pacemaker failure 1 Introduction Implantable cardiac pulse generators have been used clinically for several decades. The original devices were very simple and only enabled the heart to be periodically stimulated at a constant frequency. Later, more soph- isticated devices were developed which allowed natural cardiac activity to be electronically recognised and stimulation actions to be delayed appropriately. Cur- rently, the pulse generators which are used in clinical practice employ very complex internal algorithms (Barold et al, 1986). These sophisticated algorithms allow pacemakers to respond properly to most cardiac rhythms which might be encountered. At the same time, the complexity of pacemaker activity restricts the pos- sibility to forecasting the actions of a generator under complicated circumstances and of evaluating its function for the diagnosis of its faults and technical failures. At the same time, a detailed comprehension of the heart-pacemaker interface (HPI) is important in clinical medicine. In modern pacemakers, parameters such as the refractory periods (during which the natural cardiac activity is ignored), sensitivity of intracardiac elec- trodes, or output amplitude and width of stimulation pulses, can be individually programmed according to the particular patient's need. Therefore, each unusual episode of the HPI has to be explained in detail. Poten- tially, more serious mismatch between the heart and the pacemaker may develop in the future and it might be prevented by proper reprogramming the device parameters. Manufacturers have improved the process of under- standing the HPI by introducing the so-called marker channel (Kruse et al, 1983). The same electronic device that is used to program the pacemaker (ie, to set the parameters of its algorithm) is able to record the ECG signal and to produce it together with special marks which indicate the pacemaker actions and explain how the device responded to natural cardiac activity. However, many unusual and peculiar ECG episodes are recorded in paced patients when the technical sup- port producing the marker channel is not available. In such cases, the mechanisms of the HPI may be difficult to understand. The pacing spikes (recorded pacemaker excitation pulses), which can normally be observed in the ECG, can fuse with the patterns of cardiac exci- tations or can be hidden within the recording noise. The ECG patterns of natural beats may imitate the paced events and the pacemaker can inappropriately respond to electrical potentials due to chest muscle movement, etc. In such cases, the evaluation of the HPI requires all possibilities and their combinations to be taken into account. The large number of such possibilities is the most important difficulty of the HPI evaluation. In order to solve this problem, a computer system has been devel- oped which guides the diagnosis of paced ECGs and suggests possible explanations of the HPI. The aim of this paper is to describe the system and to present the performance of its current computer ver- sion. The paper emphasises the problem of ECG data 118 Measurement Vol7 No3, JuI-Sep 1989