update appointment view and add relationships in model.