Is it illegal for a hospital to give your medical file to another patient
Yes it is. Google HIPPA violation for more information.
I should add, however, that HIPAA (not HIPPA) provides no private right of action for violations. You have to file a complaint with the U.S. Dept. of Health and Human Services, and they take it from there as far as penalties. If you have suffered direct monetary loss or other harm from the disclosure you could probably craft a cause of action for medical malpractice based on the failure to follow HIPAA, but you cannot sue just for the HIPAA violation itself.