A mathematical model of whole-body acid-base and fluid-electrolyte balance was used to provide information leading to the diagnosis and fluid-therapy treatment in patients with complex acid-base disorders. Given a set of measured laboratory-chemistry values for a patient, a model of their unique, whole-body chemistry was created. This model predicted deficits or excesses in the masses of Na+, K+, Cl- and H2O as well as the plasma concentration of unknown or unmeasured species, such as ketoacids, in diabetes mellitus. The model further characterized the acid-base disorder by determining the patient's whole-body base excess and quantitatively partitioning it into ten components, each contributing to the overall disorder. The results of this study showed the importance of a complete set of laboratory measurements to obtain sufficient accuracy of the quantitative diagnosis; having only a minimal set, just pH and PCO2, led to a large scatter in the predicted results. A computer module was created that would allow a clinician to achieve this diagnosis at the bedside. This new diagnostic approach should prove to be valuable in the treatment of the critically ill.