removed extra joins in methods for getting both primary and secondary diagnosis