| ||
If you're not interested in mathematics or computer programs, you have probably read too far already!
The section describes the logic utilized to generate the text reports. as well as the development of the necessary equations and iterative subroutines required to convert the raw data into the diagrams on the screen.
This diagram shows the radial zones employed to generate the sentence fragments. Radiating out from the center are the rectangles which determine the choice of adjective to describe the magnitude of the respiratory and metabolic components. Each zone is numbered. The numbers correspond to the radial search used to choose a code which generate the Sentence Fragments.
For the six Classical Zones an extra phrase or sentence is added describing the selected typical zone.
The expanding family of rectangles determine the choice of adjectives used to describe the degree of acidosis and alkalosis. Normal; Minimal; Mild; Moderate; Marked; Severe. The corners of these rectangles corresponds to the slope for pH = 7.4.
| To Simulate Human Report |
The intention behind this reporting algorithm was to produce reports with a style and a range of distinctions to which a human being might aspire when writing Acid-Base reports. Each report, or even a small series of reports, should appear to be "human". However, because no random variation is included, there is no pretense that a longer series of reports might be mistaken as actually coming from a human hand.
| Radial Search & Characterize Magnitude |
The computer program conducts a radial search of the diagram to determine which sector (1 - 29) contains the result. The sector corresponds to a stored numerical sequence, each number in which corresponds to a sentence fragment in the final report. Two additional numbers govern the adjectives which describe the magnitude of the respiratory and metabolic components; these numbers are derived from the location either inside or outside the central rectangles ( A - E) and are inserted at the appropriate point in the numerical sequence. A final descriptive phrase is included when the location is characteristic of a chronic or an acute disturbance.
| [H+] (30.17 + BE) = 22.63 (PCO2 + 13.33) |
These are the equations used to obtain a first approximations, e.g., to obtain bic from BE and PCO2.
| BE = 0.9287 * bic + 13.77 * pH - 124.58 |
It is a pleasure to thank Dr. Severinghaus for giving me these equations which are used in iterative procedures to obtain successively better approximations
| [H+] x [HCO3-] = 24 x PCO2 |
This is the equation used to derive [HCO3-] from pH and PCO2.
| Java Applet |
The following Java Code shows how these equations were employed to derive accurate bicarbonate values from PCO2 and BE:
| double PCO2andBEtoBIC() { | |
| bic = (BE + 30.17) / (0.94292 + 12.569 / PCO2); | // bic approximation via Grogono equation |
| for (int i=0;i<6;i++) { | // iterative procedure six times |
| H = BICandPCO2toH(); | // [H+] via Modified Henderson Equation |
| bic = (bic + BEandHtoBIC())/2; | // split old value and new Siggaard-Anderson |
| } | |
| return bic; | // return bic |
| } | |
| double BEandPHtoPCO2() { | |
| return Math.exp((9-pH)*2.302585) * ((BE -13.77 * pH +124.578)/0.9287) / 24; | //Siggaard-Anderson |
| } | |
| double BICandPCO2toH() { | |
| return (24*PCO2/bic); | //Modified Henderson Equation |
| } |
| Computing Strategy |
Getting the Java-based pieces of this site to run was challenging and the results were sometimes unexpected. Some of the planned features (mostly color changes) had to be omitted initially because they wrecked the function of the program. As Java stabilized, they were reintroduced. Some of the applets - notably the "pH Playground" - sometimes stall temporarily and fail to respond to the mouse clicks. Any advice or suggestions from Java-experts will be appreciated. Details about how each Applet is used are in the following paragraphs.
To avoid problems with Java applications or Java scripts, a good first step is to go to Java Web Hosting to find websites that use Java applets or are entirely JSP based.
| Acid-Base Graph |
There is only one applet running the diagrams. Each Applet can run in four different modes and, in the "resting condition", will assume a gray background color. The color of the background is supplied by the HTML text. If you plan to use one of the applets, this explanation about the required HTML tags will help you get the best out of it.
A complete call to one of the Graph Applets would look like this
<APPLET CODE = "AcidGrog.class" WIDTH=520 HEIGHT=360>
<PARAM NAME=pH VALUE = "7.25">
<PARAM NAME=PCO2 VALUE = "62">
<PARAM NAME=color VALUE = "FFFF9F">
</APPLET>
Note: All of the following parameters are optional and may be omitted
| Henderson Equation |
Like the Graph Applets, this Applet can run in four different modes. If you plan to use this applet, this explanation about the required HTML tags will help you get the best out of it.
A complete call to the Henderson Applet would look like this
<APPLET CODE ="Henderson.class" width=540 height=360>
<PARAM NAME=pH VALUE = "7.25">
<PARAM NAME=PCO2 VALUE = "62">
<PARAM NAME=color VALUE = "FFFF9F">
</APPLET>
| The pH Playground |
The Applet operates in only one mode. The HTML tag required to call it is:
<applet code="pHcalc.class" width=280 height=210></applet>
|
Acid-Base Tutorial Alan W. Grogono |
Copyright Nov 2009. All Rights Reserved |