## Services on Demand

## Journal

## Article

## Indicators

- Cited by SciELO
- Access statistics

## Related links

- Similars in SciELO

## Share

## Revista mexicana de ingeniería biomédica

##
*On-line version* ISSN 2395-9126*Print version* ISSN 0188-9532

### Rev. mex. ing. bioméd vol.34 n.2 México Aug. 2013

Nota técnica

**Development of a Software to Determine Disturbances in the Acid-Base Balance in Human Blood**

**Desarrollo de un software para determinar perturbaciones en el balance ácido-base en sangre humana**

**A. Reyes-Lazalde*, M. Reyes-Monreal**, M.E. Pérez-Bonilla*, R. Reyes-Luna***

* *Laboratorio de Biología Interactiva, Escuela de Biología, BUAP. Blvd. Valsequillo y Av. San Claudio, Edificio 112-A, Col. Jardines de San Manuel. CP. 72570, Puebla, Pue*.

** *Dirección General de Innovación Educativa, BUAP. Blvd. Valsequillo y Av. San Claudio, Edificio 1AUB, Col. Jardines de San Manuel. CP. 72570, Puebla, Pue*.

**Correspondencia:**

Arturo Reyes Lazalde,

*15 Pte. No. 1102-A,
Col. Álvaro Obregón,
Atlixco, Puebla, CP: 74260.,
Tel. (01 222) 2295500 Ext. 7072,
Correo electrónico*: arturoreyeslazalde@yahoo.com.mx

Fecha de recepción: 23 de Noviembre de 2012

Fecha de aceptación: 11 de Junio de 2013

**ABSTRACT**

In intensive care units, one of the most frequent emergencies occurring in patients in critical condition is acid-base imbalance. The ability to proficiently manage such patients is achieved through many years of hospital practice. The correct quantification of such imbalances allows for the detection of complex alterations. Although this area is fundamental for the clinical management of many patients, non-specialist doctors rarely receive the appropriate training. In addition, the learning required to master this area is difficult for doctors due to the level of mathematics involved. There are two online support programs available on the internet for determining blood pH based on the Stewart Model, along with a spreadsheet for the patient's collected data. Generally, the calculation of hydrogen ion concentration [H^{+}] uses a table of equivalences between pH y [H^{+}] for discontinuous values of pH, with the Davenport diagram used manually. However, none of these programs unite the methods of classic calculus, chemistry and physicochemistry. This study develops software for the teaching and calculation of acid-base imbalance that combines all the relevant methods, such as the Henderson-Hasselbalch equation, the Siggard-Anderson modified excess base equation, the anion gap calculation, the computational implementation of the Davenport diagram, the calculus of [H^{+}] for any value of pH, the calculus for the compensatory process, and the Stewart Model. The combined use of these methods is complementary, synergic and permits a preliminary diagnosis that interprets and understands both respiratory alterations and miniscule metabolic or mixed alterations. With this software, a doctor can identify acid-base imbalances and the occurrence of compensatory processes, such as the concentration of acid or base, in order to restore pH, while many simulations of clinical cases can be carried out in the classroom for medical training purposes.

**Keywords:** acid-base, base excess, Stewart model, anion gap, medical education.

**RESUMEN**

En las unidades de cuidados intensivos, una de las emergencias más frecuentes de los pacientes en estado crítico es el trastorno del equilibrio ácido-base sanguíneo. El manejo adecuado de estos pacientes se alcanza en la práctica hospitalaria después de varios años. La cuantificación correcta de estos desequilibrios permite detectar alteraciones complejas. No obstante que el tema es fundamental para el manejo clínico de muchos pacientes, los médicos no especializados pocas veces cuentan con este tipo de entrenamiento. Por otro lado, el aprendizaje del tema resulta difícil para los médicos debido a las matemáticas que están involucradas. En Internet existen dos programas online de apoyo para determinar el pH sanguíneo basados en el modelo de Stewart y una hoja de cálculo para el concentrado de datos del paciente. Generalmente, para el cálculo de hidrogeniones [H^{+}] se utiliza una tabla de correspondencia entre el pH y [H^{+}] para valores de pH discontinuos y el diagrama de Davenport es utilizado de manera manual. Sin embargo, ninguno de estos programas reúne los métodos de cálculo clásico, químico y fisicoquímico. En este trabajo se desarrolló un software para la enseñanza y el cálculo de las alteraciones ácido-base que conjunta todos los métodos como la ecuación de Henderson-Hasselbalch, la ecuación modificada de exceso de base de Siggard-Andersen, el cálculo de la brecha aniónica, la implementación en la computadora del diagrama de Davenport, el cálculo de [H^{+}] para cualquier valor de pH, el cálculo de los procesos de compensación y el modelo de Steward. El uso conjunto de estos métodos es complementario, sinérgico y permite un diagnóstico preliminar que comprende alteraciones respiratorias y de manera minuciosa alteraciones metabólicas o mixtas, Con este software, el médico puede determinar desordenes del equilibrio ácido-base, la existencia de procesos compensatorios así como la concentración de ácido o de base para restaurar el pH y en el módulo de enseñanza se pueden realizar numerosas simulaciones de casos clínicos para el entrenamiento médico.

**Palabras clave:** ácido-base, exceso de base, modelo de Stewart, brecha aniónica, educación médica.

**INTRODUCTION**

Acid-base alterations commonly present in patients found in intensive care units [1]. Various organs are involved in the regulation of acid-base and for this reason intensivist doctors are experts in the diagnosis and management of complicated alterations in acid-base balance [2]. In clinical practice, when the acid-base imbalances in the patient are severe, inappropriate and not rapidly corrected, they can lead to the death of the patient.

Compensatory physiological processes and mixed acid-base imbalances may complicate diagnosis and, consequently, the patient's treatment [3]. For this reason, the correct quantification of this imbalance, which permits the detection of complex metabolic alterations, is very important [4,5]. Consequently, the ability to diagnose and manage acid-base alterations rapidly and effectively is fundamental for the treatment of seriously ill patients. The doctor relies on laboratory data such as pH and blood gases (various apparatus measure the concentration of bicarbonate [HCO^{-}_{3}], ion concentration, glucose and routine tests such as blood chemistry and complete blood count, amongst others.

If the doctor needs to carry out more advanced studies with this data in order to determine a complex metabolic alteration or a compensatory process, it is important that it is processed by a program designed to calculate this data. Otherwise, it is necessary to use a scientific calculator and record the corresponding mathematical operations. In these conditions, the simultaneous solution of various equations could become impossible. There is a vacuum of software for both the quantification of acid-base alterations and the teaching of it. In 1990, Siggaard-Andersen y Siggaard-Andersen [6] reported a program for PC that is executable using DOS version 2.11. This program determined the partial oxygen pressure (PaO_{2}), which is the concentration of O_{2} and acid-base state. However, this is not currently available and there exists no update. There are only two programs for the calculation of blood acid-base available on the internet, both of which correspond to the Stewart Model: (1) The program developed by Figge y Fencl (www.figgefencl.org), which has a teaching application and whose computer process 3.0 can be found on their webpage, which, to be used, requires the editor Visual Basic, which is associated with Excel. To achieve this requires both computational knowledge, 2) the program developed by Watson to which, however, access is not always available (www.med.sc.edu:96/watson/Acidbase/Acidbase.htm).

Huerta-Torrijos *et al.,* developed an Excel spreadsheet that permits the annotation of the patient's clinical data and the systematic analysis of the blood acid-base evolution in the patient, and, to determine [H^{+}], uses a table of equivalence between pH and [H^{+}] for discontinuous pH values. It does not, however, carry out other calculations [7]. In these circumstances, it is important to use software to determine acid-base imbalances that is executable, easy to use, does not require an internet connection or another type of software, and includes all the available calculation methods.

There are three specific methods for the quantification of acid-base distortions: (1) the classic, (2) the chemical, and (3) the physicochemical [2,8]. The first is based in the concentration of bicarbonate [HCO^{-}_{3}], the second in base excess (BE)[9], and the third in strong ion difference (SID)[10,11,12,13].

The classic method uses the Henderson-Hasselbalch (H-H) equation; which has a clinical value in two senses: (1) it determines whether the laboratory results are correct, and (2) if the laboratory data are incomplete, this equation males it possible to obtain the missing data - for example if the pH value and arterial pressure of carbon dioxide (PaCO_{2}) are known, it is possible to calculate [HCO^{-}_{3}][14]. However, with this method, it is not possible to precisely measure metabolic imbalances. To resolve this restriction, chemical and physicochemical methods have been used and, in this sense, are complementary. The former uses the standard base excess equation (SBE)[15], while the second uses the Stewart Model[16].

The chemical method uses the SBE and orients the doctor in their administration of doses of acids or bases, depending on the case, to restore the blood pH. The physicochemical method uses the Stewart Model and permits the identification of respiratory and metabolic alterations (specifically metabolic alterations caused by illnesses of the liver, digestive system or kidney). On the other hand, the classic method is not able to specify the cause of a metabolic alteration. Stewart proposed a system formed of three independent variables: SID, PaCO_{2}, and the concentration of weak or nonvolatile anions *(A _{TOT}*)[16]. The changes in these variables affect the concentration of hydrogen ion and bicarbonate. This method has been modified in order to be more practical and is from where the Figge Model (which includes an albumin and phosphoric acid system) and the Watson Model (which uses an algorithm to simplify both models) [17,18,19].

It is clear that all the methods are useful in the diagnosis of acid-base imbalances. Each one of the methods contributes important characteristics: the H-H equation is simple to implement and allows differentiation if the alteration is respiratory or metabolic; the SBE equation is oriented around therapeutic aspects; the Stewart equation allows the differentiation of problems of a metabolic nature.

The issue of acid-base balance does, however, become complicated for both medical students and doctors in general, principally due to the level of mathematics involved. For example, the Stewart Model is formed by non-linear equations that must resolve themselves simultaneously. As mentioned, although this model better permits the differentiation of metabolic alternations than the Henderson-Hasselbalch (H-H) equation, it is not commonly used and is omitted from the relevant courses. This situation is explained by the fact that when the Stewart Model was published, personal computers were very expensive and it was necessary to have computational knowledge and the ability to operate MSDOS. These conditions have changed, where graphic platforms such as Windows^{®} greatly facilitate the use of the computer and, therefore, make the omission of this model from courses on acid-base imbalance unjustified. It is, however, necessary to implement software that makes it easier for the doctor to use. According to Kellum [20], it is possible and desirable to use all of the methods. Consequently, this study develops a computer program to calculate acid-base state that combines all the methods in such a way that they can be used separately or in combination, which in itself would have great use for teaching in this area.

A program that integrates the calculation tools for the study of blood acid-base alterations must be able to carry out the following actions: diagnose respiratory or metabolic acidosis and alkalosis and distinguish whether they stem from an acute or chronic condition. Such a program must also be able to determine whether a compensatory process exists, appropriate [H^{+}] concentration values for any pH value with greater precision than the tables commonly used, determine which organs are involved in metabolic acid-base imbalances, and determine the acid or base deficit, depending on the case, necessary to restore blood pH.

**PROGRAM DESCRIPTION**

The program comprises three principal modules: (1) the physiological approach, (2) the chemical approach, and (3) the physicochemical approach. Figure 1 depicts an operational diagram of the program, showing the different calculations that can be carried out.

The physiological approach module has a menu with the following options:

1. Calculation of [H

^{+}], in which Equation 2 is used.2. Calculation of pH, PaCO

_{2}, or [HCO^{-}_{3}]. When two of these variables are known, Equation 1 is used to obtain the third.3. A table of equivalence between pH and [H

^{+}]. From here it is possible to compare the values of [H^{+}] in the table with the values determined by Equation 2.4. Davenport diagram. Using the H-H equation, a point is obtained and then is placed on the Davenport diagram, which produces a preliminary diagnostic of the corresponding acid-base alteration, in accordance with the classification used by Di lorio

et al.[21]. From this, chronic or acute respiratory acidosis or alkalosis and chronic or acute metabolic acidosis or alkalosis can be determined.5. Anion gap in accordance with Emmett and Narins [22] and Kraut and Medias [23], which allows a diagnostic of metabolic alterations.

6. Compensatory processes. It becomes important for the doctor to know whether the acid-base imbalance is already presenting a compensatory process.

The chemical approach module consists of three secondary modules: excess base calculation, standard base excess calculation, and corrected excess base calculation.

The third module corresponds to Stewart's physicochemical approach. Here, it is possible to calculate pH, [H^{+}], SID, the apparent strong ion difference (SIDa), the strong ion gap (SIG), [HCO^{-}_{3}], the anion gap (AG), the anion gap corrected (AGc), and the standard base excess. For these calculations, it is necessary to know the concentrations of Na^{+}, K^{+}, Mg^{2}^{+}, Ca^{2}^{+}, Cl^{-}, albumin, phosphate, PaCO_{2}, and the strong unmeasured anions that could be obtained indirectly from the calculation of the anion gap corrected (AGc) with the concentration of albumin.

Each module is based on the equations that correspond to the physiological, chemical, and physicochemical approaches.

**Module I: Physiological approach**

The physiological approach is based on the classic theory of acid-base balance that requires the use of the H-H equation, where the laboratory values [HCO^{-}_{3}] y PaCO_{2} are used to calculate blood pH. The H-H equation is used in the following manner:

The program determines the concentration of [H^{+}] from any value of blood pH. In order to report the concentration of [H^{+}] with maximum precision, greater than that provided by the calculation tables, a non-lineal mathematical adjustment was carried out on the data reported in the literature with the program Eureqa Formulize 0.96 beta, from which the best adjustment obtained was the following (*r*^{2}=0.99):

Using this equation it is possible to calculate [H^{+}] from any value of pH at an interval of 6.8 to 7.8. In this way, it is not necessary to use a table of equivalent values or record conversion values.

The Davenport Diagram was loaded onto the computer (see Figure 6). A preliminary diagnostic can be obtained from this diagram for metabolic or respiratory acid-base imbalances, which can also distinguish whether the condition is acute or chronic.

To determine the compensatory processes, the empirical equations were integrated on the basis of the medical experience reported in the literature.

• In metabolic acidosis, the compensatory response is a respiratory alkalosis with an expected reduction in PaCO

_{2}, with a response time of between 12 and 24 hours. The equation used for the calculation was:• In metabolic alkalosis, the compensatory response is a respiratory acidosis with an expected increase in PaCO

_{2}, with an irregular response time. The equation used for the calculation was:• In respiratory acidosis, the compensatory response is a metabolic alkalosis with an expected increase in bicarbonate, with a response time expected according to the details of the case: in an acute condition, the response appears within minutes, while in a chronic condition, the response appears within two to four days. The equations used in this calculation were:

Acute condition:

Chronic condition:

• In respiratory alkalosis, the compensatory response is a metabolic acidosis with an expected reduction in bicarbonate, with a response time expected in the according to the details of the case: in an acute condition, the response appears within minutes, while in a chronic condition, the response appears within two to four days. The equations used in this calculation were:

Acute condition:

Chronic condition:

**Module II: Chemical approach**

With this module it was possible to determine the quantity of acid or base necessary to correct the blood pH. The module corresponds to the calculation of base excess. It is based on the Van Slyke equation and allows for the calculation of base excess, standard base excess and corrected base excess with the concentration of albumin and phosphate [9] in accordance with equations 9, 10, and 11. The equation for the calculation of base excess (BE) is applied in *in vitro* conditions and is as follows:

Where HCO^{-}_{3} and hemoglobin (Hb) are expressed in mmol/L.

In accordance with Kellum [20], the following equation of standard base excess (SBE) provides greater precision than BE *in vivo:*

However, these equations assume a normal *A _{TOT}*. When the concentration of albumin and phosphate decrease, as happens in the some case of some critically ill patients, the following corrected equation is used:

Where albumin (Alb) is expressed en g/dL and phosphate (PO^{-}_{4}) in mg/dL. The user has the option to calculate all the equations in the same module. Equations 10 and 11 are adequate, preferably with the value of SBEc; however, for this case, as can be seen, it is necessary to use the concentrations of albumin and PO^{-}_{4}.

**Module III: physicochemical approach**

The model proposed by Stewart is rarely used due to the mathematical difficulties it represents for doctors and is frequently omitted by the relevant courses in medical and related degree programs. The software includes a module that allows the solution to Stewart's mathematical model in two contexts: (1) clinical use and (2) as a didactic tool for the teaching of this area. It is necessary, for clinical use, to enter the patient's laboratory values - similarly for didactic use, the user may increase or decrease the concentrations of each of the variables and observe what happens with the blood pH.

With the Stewart model, it is possible to determine alterations caused by renal, digestive or liver malfunction, which, in this aspect, complements the classic Henderson-Hasselbalch method.

The equations used in this module were based on the Stewart model (equations 4.3.4, 4.3.5 in Kellum y Elbers [12]). The calculation of [H^{+}] y [OH^{–}] is carried out with the following equations:

Where: K*'** _{w}* is the water ion product [20]: K

*'*

*=*

_{w}*K*x [H

_{w}_{2}O], where

*K*is the water dissociation constant. [SID] is the strong ion difference.

_{w}The synthesized non-linear equations in Morgan [24], which are explicitly developed in Kellum [20], Corey [25], Fidkowski and Helstrom [26], and Schück and Matoušovic [27] are also used in this module. The equations are as follows:

The equation used for the strong ion difference:

The equation used for the effective strong ion difference:

Where [A^{–}] is the concentration of weak non-carbonic acids (principally albumin and phosphate) and is calculated in the following manner:

The anion gap (AG) is calculated with the following equation:

The corrected anion gap (AG_{c}) is calculated using:

Where: Albumin (Alb) is en g/dL and phosphate (PO^{-}_{4}) is in mg/dL

The strong ion gap is obtained using the following equation:

The pH is obtained thus:

**Software development**

The program was developed using the language Visual Basic^{®}, version 5.0 (Microsoft Corporation) on a PC with a processor featuring 1.73 GHz, 2.0GB of RAM and Windows XP. The program was compiled as an executable file (Equilibrar.exe) for a Windows^{®} environment. It is executable on any compatible PC available on the market today.

**Interface**

There are various boxes found in each interface; the yellow boxes are for data entry, while the green and blue boxes show the output from the calculations. The windows of the interface show the following menus found in the upper part of the window (Figure 4): (1) How to use - this shows the user how to input the data and how to use the specific module; (2) Unit converter - here the user can convert units from, for example, mmol/L a mEq/L; (3) Examples - here some clinical data is provided as an example; (4) Glossary and normal values - a glossary of abbreviations and normal values of some variables which help the user enter normal data and observe the calculated value, (5) Subject review - the user is able to review some basic concepts and themes here.

**RESULTS**

The computer program that has been developed integrates the classic Henderson-Hasselbalch model, the Davenport Diagram, excess base calculation, the anion gap, Stewart's modified model, and the calculation for compensatory processes. This program allows the user to obtain a preliminary diagnostic for acid-base imbalances, establish whether the condition is acute or chronic, and, moreover, determine the presence of a compensatory process. As the program includes a classification of corresponding acid-base alterations, in accordance with the classification used by Di Iorio *et al.* [21], in Module 1 the user can obtain the following clinical diagnoses: uncompensated acute respiratory acidosis, partially compensated acute respiratory acidosis, compensated respiratory acidosis, uncompensated acute respiratory alkalosis, partially compensated respiratory alkalosis, uncompensated respiratory alkalosis, uncompensated metabolic acidosis, partially compensated metabolic acidosis, compensated metabolic acidosis, uncompensated acute metabolic alkalosis, partially compensated metabolic alkalosis, compensated metabolic alkalosis, mixed acidemia and mixed alkalemia. The program features a table showing the conditions for pH, PaCO_{2} and [HCO^{-}_{3}] for each case (Figure 2).

The concentration of [H^{+}] calculated by the program is more precise than the concentration reported by Huerta-Torrijos *et al.* [7] in their study, in that Equation 2 measures the concentration of [H^{+}] for any value of pH; unlike a table that shows an estimated value at an interval (Figure 3).

With the objective of showing the utility of the *Equilibrar* program in the completion of clinical tasks, some clinical cases are described below. In the diagnostic example outlined below, the H-H equation, the Davenport Diagram and compensatory processes are used to diagnose respiratory acidosis, differentiate between an acute and chronic process, and determine whether a compensatory process is already present. Briefly, it will describe the use of the program: how to enter the data and the calculations it has to carry out.

**Diagnostic example**

A patient presenting pH = 7.35 and PaCO_{2} = 55 mmHg. With this data [H^{+}] y [HCO^{-}_{3}] are calculated and a preliminary diagnosis is made. The steps in the program for the calculations are as follows: «ENFOQUE FISIOLÓGICO» → «CÁLCULO ÁCIDO-BASE» → «ecuación de Henderson-Hasselbalch» → «Conocemos pH y PaCO_{2}» → «CALCULAR». The result is: [H^{+}] = 46.17 y [HCO3] = 28.58 and a box with a preliminary diagnostic now opens: partially compensated respiratory acidosis, in accordance with Di Iorio *et al.* [21] (Figure 4).

The compensatory processes module is then used to determine and confirm whether a compensatory process has already been established. While, with these calculations realized, a preliminary diagnosis of respiratory acidosis has already been made, what now needs to be determined is whether the condition is acute or chronic. To carry this out, the value PaCO_{2} = 55 is entered in the compensation interface and the value of [HCO^{-}_{3}] is checked for an acute condition, with the result being [HCO^{-}_{3}] = 25.5, a value that is far from the 28.68 previously calculated (see Figure 4). For a chronic case, the calculation was [HCO^{-}_{3}] = 29, which is close to the previous calculation. Consequently, a chronic case is suggested (Figure 5).

The doctor can then use the patient's clinical history and finally determine whether the diagnosis suggested by the program is accurate. The results are calculated on the basis of the fact that there is a decrease in the pH and an increase in PaCO_{2}, which is characteristic of respiratory acidosis. The increase in [HCO^{-}_{3}] suggests that the kidney is compensating.

To confirm whether the respiratory acidosis is chronic, the Davenport Diagram is used. Figure 6 shows how blood pH can be calculated from PaCO_{2} y [HCO^{-}_{3}]. With these three variables a point on the Davenport Diagram can be obtained. A circle suggesting chronic respiratory acidosis is presented in the graphic. This can be arrived at by selecting «Conocemos PaCO_{2} y [HCO^{-}_{3}]» and entering the corresponding data obtained by the previous calculation, PaCO_{2} = 55 y [HCO^{-}_{3}] = 28.58.

**Stewart model**

A module for the calculation of acid-base imbalances based on the Stewart Model as modified by Watson has been developed for this software. The module «ENFOQUE FISICOQUÍMICO» enables calculation with units in mmol/L in accordance with Schück and Matoušovic [27] or with units in mEq/L in accordance with Kellum [20]. Figure 7 shows the user interface for the case of units in mEq/L.

**Clinical case and use of Stewart model**

For this example, the normal values proposed by two different authors with entry parameters in mmol/L, albumin in g/L and PaCO_{2} in mmHg were selected. The results reported by Schück and Matoušovic [27], are given in mmol/L; while the results reported by Kellum [20] are given in mEq/L. The module «ENFOQUE FISICOQUÍMICO» should be chosen in the software, which then leads to a menu from which the units that are required can be entered: (1) mEq/L or (2) mmol/L. The results are given in the units that correspond to the case. To obtain mEq/L as an output, it is necessary to input these units. If necessary, the program uses a unit converter for this task. The same process is followed in the case of mmol/L.

Table 1 shows two examples of normal data in mmol/L in Column A, and in mEq/L in Column B, which correspond to those reported by Schück y Matoušovic [27] y Kellum [20], respectively. The output data are: [HCO^{-}_{3}], AG, BE, SID y SIG. It is possible to observe that the calculated values basically coincide with the reported data. The concentrations of [HCO^{-}_{3}], AG y SID are normal in every case; there is no base excess and the value of SIG tends toward zero as would be expected in a normal patient.

The data taken from Kellum [20] can be found in Column C, corresponding to a patient with acidosis. In this case, the results are given in mEq/L, for which the corresponding module is used and the necessary conversions carried out. The results between the program and those reported by the author are practically the same (C article vs C program). In this case, the program reports metabolic acidosis in which there is an increase in the anion gap, a deficit of base and SID has decreased, while the value entered for PaCO_{2} is low, indicating pulmonary compensation.

**The program as a didactic tool**

The subject of acid-base balance is fundamental to medical practice and a clear understanding of it will determine the effective management of critically ill patients. If we take into account that here in México, courses in mathematics and physics are not offered as part of medical degrees, the calculations involved can be very challenging for undergraduate students, principally due to the mathematics involved. This situation brings with it as a consequence a superficial level of learning in these types of areas of medicine. Each of the interfaces in the software presented in this study give the user access to a menu in the upper part of their screen that gives the following options: Exit, Authors, How to use, Examples, Subject Review, Unit Converter, and Glossary. These options give the student access to a comprehensive review of the subject and some examples from the study of blood pH imbalance, while the glossary explains the abbreviations used in the program and indicate the normal values for each of the variables. Of particular didactic use is calculation option using the Stewart Model in units of mmL/L in the «ENFOQUE FISICOQUÍMICO» module, in which it is possible to modify the concentrations of the different entry variables and observe the changes they produce in pH.

**Example of use**

Vomiting, gastric suction, and draining for gastrostomy cause high levels of water, electrolyte and hydrochloric acid loss. The immediate effect of such losses is seen in isotonic dehydration and metabolic alkalosis. One quick example of this comes when pH is increased after the concentration of Cl^{–} is decreased to 96 mmL/L. Figure 8 shows the results.

In these conditions, the pH was calculated at 7.54, which indicates metabolic alkalosis. The user can effect various combinations in changing the concentration of the entry variables and simulate a great diversity of clinical

**DISCUSSION**

Doctor has very few options available to support them in the calculation of acid-base imbalances. As has been mentioned, there are only two programs available on the internet based on the physicochemical method: (1) A teaching website developed by Figge and (2) a program on which the calculation can be carried out, which is not always available. Di Iorio *et al.* [21] have reported a rule for the calculation of pH that uses the classic method and produces a preliminary diagnostic. There is also an Excel spreadsheet which basically serves as an archiving tool in which the patient's clinical history and laboratory results can be noted, and in which the calculation of [H^{+}] is based on the use of a table of equivalence between blood pH and [H^{+}]; however, the principal intention behind the spreadsheet is the systemization of data. This study outlines the implementation of a computer program that allows for the calculation of acid-base through the principal of combining the relevant methods of calculation [20, 25]. In the examples of clinical cases that have been outlined here, it is possible to see how to arrive at a diagnosis of partially compensated chronic respiratory acidosis using the calculation modules, each of which complement and confirm the diagnosis.

With this program, it is possible to choose any of the methods separately or all of them together. In accordance with Kellum [20], it is ultimately more effective to use all the methods together. It is opportune to mention that this program allows for the calculation of the acid-base variables and produces a preliminary diagnosis; however, the definitive diagnosis is the responsibility of the doctor - based on their experience, the data from the clinical history, a physical examination and on the correct laboratory results. In accordance with Huerta-Torrijos *et al.,* some calculations can be used to corroborate the accuracy of laboratory results [7]. Moreover, this program can be used for the teaching of this area through the use of the help windows, the review of the topic option, and through simulations based on the clinical case details the program details. It can also be used as a teaching aid where the help windows permit a quick review. With the teaching module, various clinical cases can be simulated. There is a large amount of clinical case details available on the internet, including laboratory data, and diagnostic and treatment data. The student can enter these details into the program and carry out a simulation of the relevant clinical case.

There are few clinical cases which report the use of the Stewart Model, probably due to the large quantity of data that it requires and the complexities involved in its use. This study used the data provided by Kellum (2005) [20] and compared them with the calculations produced by the program. It should also be noted that the concentrations of Ca^{++} y Mg^{++} used by Kellum [20] were not used in this study. However, the small variations found in the different parameters did not modify the diagnostic interpretation. It should also be noted that the values that this study reports here were confirmed by means of alternative equations and in each case were calculated using every equation - such as those that use different units for phosphate and albumin. The program is able to calculate other variables not reported by Kellum [20].

**CONCLUSIONS**

This study describes the development of a computer program for the study of blood acid-base balance that is easy to operate, combines all the calculation tools available today, and fills the void that exists in computer programs of this type. The program allows for preliminary diagnoses of respiratory or metabolic alkalosis and acidosis to be carried out, and distinguishes whether the condition is acute or chronic. It also can determine whether a compensatory process is in effect, calculate the [H^{+}] for any value of pH with greater precision than the relevant calculation tables, determine which organs are involved in the acid-base imbalance, and calculate the base or acid deficit - depending on the case - in order that blood pH can be restored. The examples used in this study demonstrate that the results calculated by this program are essentially the same as those reported in the bibliography from which the data used by this study were obtained - equally, the program also obtained the same suspected diagnoses as those arrived at in the literature. It is important to emphasize that, in order to arrive at a certain diagnosis, the patient's clinical history and a physical examination are required. This program should, therefore, be seen as a support tool and not as a medically intelligent diagnostic program. Its use has been envisioned principally to facilitate the mathematic calculations for the doctor. It is advised that the program can be used to teach and update medical students and those studying related degrees on this area of medicine. It is also recommended tool for continuous education for medical residents and medical experts in intensive care. In general, while the program is easy to operate and allows for the calculations to be carried out in a straightforward way, it needs to be made clear that it is not a substitute for a doctor. The program will be able to be ordered at the email address provided.

**DISCLAIMER**

The Equilibrar program is not a substitute for clinical criteria. No medical decision should be taken solely on the basis of the results given by this program.

**ACKNOWLEDGEMENTS**

We thank the Programa Institucional de Fortalecimiento a la Capacidad Académica 2012 for the support given to this publication. We thank Ben Stewart for English revision.

**REFERENCES**

1. Gauthier PM, Szerlip HM. "Metabolic acidosis in the intensive care unit". Crit Care Clin 2002; 18:289-308. [ Links ]

2. Kellum JA. "Determinants of blood pH in health and disease". Crit Care 2000; 4(1):6-14. [ Links ]

3. Walmsley RN, White GH. "Mixed acid-base disorders". Clin Chem 1985; 31(2):321-325. [ Links ]

4. Fencl V, Jabor A, Kazda A, Figge J. "Diagnosis of metabolic acid-base disturbances in critically ill patients". Am J Respir Crit Med 2000; 162:2246-2251. [ Links ]

5. Manozzo MB, Cerveira PRC, Kappel RC, Rios SRV. "Acid-base disorders evaluation in critically ill patients: we can improve our diagnostic ability". Intensive Care Med 2009; 35:1377-1382. [ Links ]

6. Siggaard-Andersen O, Siggaard-Andersen M. "The oxygen status algorithm: a computer program for calculating and displaying pH and blood gas data". Scand J Clin Lab Invest Suppl 1990; 203:29-45. [ Links ]

7. Huerta-Torrijos J, Díaz-Barriga RP, Sardiñas-Hernández JJ, Godoy-Vega I. "Análisis sistemático del equilibrio ácido-base en formato automatizado". Principios básicos y propuesta. Medicina Critica y Terapia Intensiva 2001; 15(3):69-79. [ Links ]

8. Adrogue HJ, Gennari FJ, Galla JH, Medias NE. "Assessing acid-base disorders". Kidney International 2009; 76:1239-1247. [ Links ]

9. Siggaard-Anderson O, Fogh-Andersen N. "Base excess or buffer base (strong ion difference) as a measure of a no-respiratory acid-base disturbance". Acta Anaesthesiol Scand 1995; 107:123-128. [ Links ]

10. Stewart PA. "Independent and dependent variables of acid-base control". Respir Physiol 1978; 33:9-26. [ Links ]

11. Stewart PA. "Modern quantitative acid-base chemistry". Can J Physiol Pharmacol 1983; 61:1441-1461. [ Links ]

12. Kellum JA, Elbers PW. Stewart's textbook of acid-base. 2da ed. AcidBase.org, Amsterdam; 2009. [ Links ]

13. Kurtz I, Kraut J, Ornekian V, Nguyen MK. "Acid-base analysis: a critique of the Stewart and bicarbonate-centered approaches". Am J Physiol Renal Physiol 2008; 294:F1009-F1031. [ Links ]

14. Schlichtig R, Grogono AW, Severinghaus JW. "Human PaCO_{2} and standard base excess compensation for acid-base imbalance". Crit Care Med 1998; 26(7):1173-1179. [ Links ]

15. Singer RB, Hastings AB. "An improved clinical method for the estimation of disturbances of the acid-base balance of human blood". Medicine (Balt) 1948; 27:223-242. [ Links ]

16. Stewart PA. "How to understand acid-base". In: A quantitative acid-base primer for biology and medicine. Edited by Stewart PA, New York: Elsevier 1981; p. 1-286. [ Links ]

17. Figge J, Rossling TH, Fencl V. "The role of serum proteins in acid-base equilibria". J Lab Clin Med 1991; 117:453-467. [ Links ]

18. Figge J, Mydosh T, Fencl V. "Serum proteins and acid-base equilibria: a follow- up". J Lab Clin Med 1992; 120:713-719. [ Links ]

19. Watson PD. "Modeling the effects of proteins on pH in plasma". J Appl Physiol 1999; 86:1421-1427. [ Links ]

20. Kellum JA. "Clinical review: Reunification of acid-base physiology". Crit Care 2005; 9:500-507. [ Links ]

21. Di Iorio C, Rufolo L, Melillo EM, Granata A, Melillo G. "The slide rule: a new method for the assessment of acid-base equilibrium disorders". Minerva Anesthesiol 2007; 73:339-342. [ Links ]

22. Emmett MM, Narins RG. "Clinical use of the anion gap". Medicine (Baltimore) 1977; 56(1):38-54. [ Links ]

23. Kraut JA, Medias NE. "Metabolic acidosis: pathophysiology, diagnosis and management". Nat Rev Nephrol 2010; 6:274-285. [ Links ]

24. Morgan TJ. "Clinical review: The meaning of acid-base abnormalities in the intensive care unit - effects of fluid administration". Critical Care 2005; 9(2):204-211. [ Links ]

25. Corey HE. "Bench-to-bedside review: fundamental principles of acid-base physiology". Critical Care 2005; 9(2):184-192. [ Links ]

26. Fidkowski C, Helstrom J. "Diagnosing metabolic acidosis in critically ill: bridging the anion gap, Stewart, and base excess methods". Can J Anesth 2009; 56:247-256. [ Links ]

27. Schück O, Matoušovic K. "Relation between pH and the strong ion difference (SID) in body fluid". Biomed Papers 2005; 149(1):69-73. [ Links ]