Decision Making in Medicine: An Algorithmic Approach