Man who posed as medical student given community service