This study investigates a new method of measuring quality of care. Taking place at a tertiary psychiatric hospital with 5,128 admissions from January 1989 through December 1995, this study uses artificial neural networks (ANNs) to predict hospital length-of-stay (LOS) and uses the standard deviation of LOS in a formula to measure quality of care, Q. ANNs are trained with data using unique patient identifiers and are compared with identical ANNs trained without these identifiers. These two types of ANNs make a LOS prediction, P, with a slightly different accuracies, and this fact is exploited in measuring Q. The authors defined U as the standard deviation of the difference between the actual and the predicted LOS of the ANNs with unique patient identifiers, and defined G as the standard deviation of the difference between the actual and the predicted LOS of the ANNs without using these unique identifiers. Dividing U, the variation of individual LOS patterns intertwined with systemic LOS patterns, by G, the variation of predominately systemic LOS patterns, yields the ratio U/G, in which systemic effects are factored out leaving a measure of the average severity of patient illness. Ratios that exceed unity are seen in the patients who are more severely ill. The formula for quality of care, Q, divides the best LOS prediction accuracy, P, which is inversely proportional to overall variation in the delivery system, by U/G, which is inversely proportional to quality of care, written as: Q = P/(U/G). Q reflects the patients' perspective because LOS is concrete and tangible to patients. The study took place during hospital downsizing (political change), a consent decree (policy change), new administrative and medical personnel (staffing change), and the introduction of clozapine and risperidone for schizophrenia (therapeutic change). These events had a predominantly positive impact on Q. The value of Q correlated well with the Joint Commission on Accreditation of Health Care Organizations (JCAHO) triennial evaluations. Some conclusions that emerged from this study: 1) System variation, reflected in the standard deviation of LOS, increased with frequent changes in top management. 2) There was a clear-cut beneficial effect of clozapine, and to a lesser extent of risperidone in schizophrenia, allowing more community placement. 3) With a dedicated professional staff quality of care can prevail despite increasing variation in LOS (systemic problems). 4) The number of hospital employees per Q unit halved when the overall hospital Q ranged from low to high values as a result of policy and staffing improvements, suggesting an increased efficiency of operation. 5) Q can be an objective outcome measure of quality care from the patients' perspective.