Add diagnosis encoding