Thank you for using JustAnswer.
I'm sorry to hear about your situation. Yes, you do have a right to leave the hospital unless you have a mental health issue or are otherwise detained (i.e. under arrest or detainment by the police / department of corrections, etc...). Now it's hard to assert your rights when they physically will not let you leave. You need to keep track of how many times you tell them that you want to leave, that you want to be discharged, and that you're asserting your right to be. Let them know that this is false imprisonment, and that you will take legal action against the hospital and any doctor / nurse / orderly that detains you without your consent.
Send yourself emails or other electronic texts with these dates, times, who you talked to, what you talked about, reasons given to you for not allowing you to leave, etc... You want to do that in electronic form because they might take away papers / notepads / etc... and doing it through electronic means would be the best option.
Finally, as it seems you're in contact with the outside world, I would contact a couple of attorneys that deal with general legal practice, with an emphasis on criminal law. I understand that you're not a criminal, but criminal lawyers have a pretty good grasp of how to get individuals out of places that they don't want to be. Again, you could have a civil case against them for false imprisonment, because they can't keep you there against your will unless there's a very compelling public health reason or there's a mental health reason, and even then you would have to have had professionals evaluate your mental health within 72 hours.
That being said, you need to contact an attorney in your area that deals with detainment (criminal, civil) cases. Go to www.lawyers.com or www.legalmatch.com to find an attorney in your area. You should be able to find one that will give you a free initial consultation and better advise you of your rights, any problems with your case, likelihood of success, how courts are treating cases such as yours in your area, and what you should do next.
Hope that clears things up a bit. If you have any other questions, please let me know. If not, and you have not yet, please rate my answer AND press the "submit" button, if applicable. Please note that I don't get any credit for the time and effort that I spent on this answer unless and until you rate it positively (3 or more stars). Thank you, ***** ***** luck to you!