AMA Code Says
The creation of the patient-physician relationship is contractual in nature. Generally, both the physician and the patient are free to enter into or decline the relationship. A physician may decline to undertake the care of a patient whose medical condition is not within the physician's current competence. However, physicians who offer their services to the public may not decline to accept patients because of race, color, religion, national origin, sexual orientation, gender identity, or any other basis that would constitute invidious discrimination. Furthermore, physicians who are obligated under pre-existing contractual arrangements may not decline to accept patients as provided by those arrangements.