First of all, your prayers and other obligatory acts are valid, and if they are done properly they will be accepted Insha’Allah.
Secondly, have you tried talking to your advisors or those in charge of your department and explained to them that you have this religious restriction? Have you discussed this with them and asked them to give you other alternatives? Do try that as many times it could work.
Third, if they reject, and you have absolutely no other alternative (even by transferring to another environment for example), and the field are you going into is considered a necessary field (meaning there is a shortage of doctors in that field, or in your community there is a shortage, or there is a high need for a Muslim female doctor in your community to treat women for example), then it would be ok out of necessity. But if this is not the case, then touching their hand directly would be haram. It doesn’t mean that your prayer is invalid, but technically it would be a sin.