Common Medical Diagnoses: An Algorithmic Approach