has_many :through association application for doctors/patients/appointments