All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
If the hospital conditions on the student to work for if after graduation in exchange for the grant paid by the hospital for his studies, then there is nothing wrong with that. Also, as for the fact that the university increases the fees on the hospital and takes a greater fee than when the student pays for himself, then there is also nothing wrong with that, and this is not interest. This is, of course, if what you mean is that the university takes 30,000 from the hospital whereas it takes only 20,000 from the student.
However, if what you mean is that the hospital asks the student, if he does not work for it after graduation, to pay the fees that it had paid on his behalf and pay an increase in compensation for failure to fulfill the requirement, then this falls under the penalty clause, and this is legislated to repel harm. So, this additional fee must be in return for the actual harm. This is estimated by the people who have experience in this field.
The decision issued by the Council of Senior Scholars after discussing the research on the penalty clause reads:
“The Council unanimously decides that the penalty clause being a requirement in the contracts is a considerable condition and that it must be taken into account as long as there is no Islamic excuse for violating the obligation of abiding by the condition, so the excuse drops the obligation of fulfilling it until the excuse no longer exists. If the penalty clause is considered to be big according to the norm, in a way that it is intended for financial threat, and is far away from the Islamic rules requirements, then this must be referred to justice and equity according to the benefit missed or the damage caused. When there is a dispute, then this is estimated by the Muslim ruler through the people of experience and knowledge.”
Also, the resolution of the Islamic Fiqh Academy on the subject of the penalty clause reads:
“First, the penalty clause in the law is an agreement between the contractors while estimating the compensation that he deserves from the one who conditioned on him to pay for the damage caused to him; if the other party did not implement the commitments made by him, or that he procrastinated in implementing it ........
Fourthly, it is permissible to condition the penalty clause in all financial contracts with the exception of the contracts whose original commitment is a loan, as this is pure interest …....
Fifthly, the damage that is permissible to be compensated includes the actual financial damage, and the real damage that the affected person has undergone, and the real earning that he lost, but it does not include moral damage...
Sixthly: the penalty clause is not acted upon if it is proved by the person who failed to fulfill the contract requirements that his breach of the contract was beyond his control or that the other party to the contract did not experience any damage because of the breach of the contract.”
In any case, if the hospital unjustly conditions on you to pay an additional amount and you paid it to them, then you are not sinful for that, but the sin falls on them because of injustice.
Allaah knows best.