A framework for building cooperative software agents in medical applications