General Formalism of Decision Making Based on Theory of Open Quantum Systems