Doctors and medical personnel are required to keep aside their personal beliefs while treating a patient. They cannot refuse treatment to patients only on the grounds of gender, sexuality, caste, religion, race or place of birth. Further, no one can refuse treatment on the basis of illnesses like HIV+ status or other socially stigmatized conditions.
Discrimination based on caste
If a doctor refuses you treatment based on your caste, it is against your fundamental right guaranteed under the Constitution1 (Right Against Untouchability). If such treatment is refused by a hospital or clinical establishment, a person can seek remedy by making a complaint to a SC/ST Protection Cell. (( Section 4, Scheduled Caste and Scheduled Tribe (Prevention of Atrocities) Act, 1989; Charter of Patient Rights, Ministry of Health and Family Welfare.))
Discrimination based on gender identity or sexual orientation
Persons of the LGBTQ+ community may find it difficult to access safe, secure, dignified medical care for a variety of reasons. However, no one can be denied or discriminated against while providing medical treatment based only on their gender or sexual orientation. The Government has to2 provide specific healthcare services and ensure access to existing ones for transgender persons. For instance, ensuring non-discrimination against a transgender person by denying or discontinuing healthcare services or unfair treatment to them.3. Doing so will be punishable with jail term between 6 months to 2 years, with a fine.4.
Please see here to know what you can do if you face any harassment. Further, you can also take help and support from lawyers, NGOs, etc who will guide you through any issues you may face.
If you face discrimination at the hands of a doctor or clinical establishment, you can go to several authorities. For instance, you can approach the police, National or State Consumer Protection forums etc. Read more here.