A systems approach for monitoring anesthesia