When the surgeon called me a faggot, how was he to know the medical student in the operating room with him at the time was one of my best friends?

My relations with the surgeon had gone sour the prior year, midway through my own surgery rotation as a med student. During a teaching session about the adrenal gland, he casually referred to Brazil nuts (which are around the same size as the glands) as “nigger toes.” When I reacted with shock to his comment, he expressed surprise I that would object, given that there were no black people in the class to hear him say it.

At that, I got up and walked out of the classroom.

Knowing I’d be in for a rough few weeks if I didn’t try to ease tensions, I waited around until the class was ended to speak with him again. I explained that I hadn’t meant to be insubordinate, but given the choice between an angry confrontation and leaving, the latter had seemed better. I left the conversation with the sense that I’d smoothed things over, and the remaining times I scrubbed in on cases with him seemed to pass without evident friction.

Fast-forward to the month or so before my graduation, and my friend mentioned one evening when I was hanging out with him and his girlfriend that this surgeon really, really hated me. During surgery earlier that day, he’d regaled everyone in the OR with his version of the same story, which wasn’t particularly flattering to me. While he hadn’t referred to me by name, he’d wondered aloud where “that faggot” was going for residency, and someone else present must have known I was headed to New York City for pediatrics. Since I was the only openly gay medical student with those plans, it was pretty easy for my friend to know he was talking about me.

It was an extremely unsettling thing to hear.

I sat with the news for a couple of days and decided I couldn’t just let it go. I asked my friend if he’d be willing to corroborate my complaint if I went to the school with it, and with his go-ahead I did so. I made an appointment with the dean of students, laid out the whole sequence of events, and was assured that the matter would be dealt with appropriately.

And that was the last I heard of it. They never contacted my friend; if any action whatsoever was taken, they didn’t bother to let me know. As a result, I resolved to have no relationship with the school as an alumnus.

What made this experience of overt homophobia and administrative indifference so disorienting was how out of keeping it was with my overall experience at the school. I attended medical school at the University of Missouri at Kansas City, and many of my classmates were drawn from some of the most rural, conservative areas of the state. But after I became the first gay man in my class to come out, none treated me with any hostility or derision. (What may have been said behind my back could have been a different story.) Many of my professors knew I was gay, and none but the one surgeon treated me any worse for it.

My relatively isolated experience of homophobia was in marked contrast to that of Dr. Mark Schuster, a Boston pediatrician who spoke in 2012 of his own medical education. Schuster attended Harvard Medical School starting in 1982, a little over a decade before I entered school myself. In his talk, he laid out a harrowing history of rampant homophobia and transphobia directed at patients, families, prospective students, and himself. At one point, an adviser refused to write a letter of recommendation for him because he was gay, which threatened to derail his entire career.

When I first read Schuster’s remarks, I was stunned to learn that a school like Harvard, despite its progressive reputation, could have harbored such institutional bigotry such a relatively short time before I was in school myself. Clearly attitudes had shifted substantially in the intervening years, though not enough that a faculty member at my own school couldn’t get away with tossing off racial and homophobic slurs with impunity.

Yet there’s still a lot of work to be done to make medical school better for LGBTQ students. A 2015 study in the journal Academic Medicine of sexual and gender minority students in American and Canadian medical schools found that roughly one-third of the study’s subjects declined to come out while they were still in school. Among the reasons cited by participants in the study for not coming out were lack of support from both peers and faculty, and concerns about a negative effect on their career prospects.

“There is a subtle devaluation of LGBTQ individuals that I have noticed among my peers and, more so, among older physicians. There are casual comments, jokes, and innuendos; things that wouldn’t be said by most if they knew an LGBTQ person was present,” one gay student said. A lesbian student reported that “I have found no faculty who seem accepting of LGBTQ people based on their casual conversations or discussion about patients.”

Dr. Mitchell Lunn, one of the study’s authors, echoed many of these concerns when I contacted him to discuss the findings.

“Medical school is this horrendously stressful time for people,” Lunn told me. “To have the extra ‘burden’ of dealing with your identity, either figuring out your own identity that’s developing, or to share that identity, is another layer on an already stressful time. Especially when sharing that identity can result in some sort of stigma or discrimination.”

An additional element that may affect LGBTQ students’ decisions not to disclose their sexual or gender identity is the typical structure of medical education, with clinical instruction in various specialties (like pediatrics) separated into discrete blocks, or “rotations.”

“Medicine is such a unique field in that we have four-week rotations, or six-week rotations, or eight-week rotations. If you don’t do well on them, it can wreck your career choices,” Lunn continued. A student who wants to pursue a specific specialty may keep quiet about being lesbian, for example, if she overhears a faculty member in that department making homophobic comments about patients.

“The attitude is ‘I’ll just suck it up for a couple years, until I get to where I want to be,’ ” Lunn continued.

It’s difficult to assess precisely how widespread the experience of discrimination for LGBTQ students is nationwide. The study noted that in 2013, 2.3 percent of respondents to a graduation questionnaire sent out annually by the Association of American Medical Colleges reported having been subjected to offensive comments about their sexual orientation. That figure, however, may appear falsely low at first glance.

“Two percent sounds very small overall,” Lunn clarified, “but those are total medical school samples, looking at a much smaller subset of [LGBTQ students]. If that number is 6 percent, that means that a third of LGBTQ people are having some sort of horrible experience in medical school.”

Medical schools do appear to be paying more attention to these experiences. Laura Castillo-Page, senior director for diversity policy and programs at the AAMC, told me that “when I joined the AAMC more than a decade ago, I don’t believe this was on their radar as much as it is now. About five or six years ago, we really made a concerted effort to expand our notion of diversity to be more inclusive of others. We shared with our medical schools that in addition to race, ethnicity and gender, LGBT should be included in that list, and that creating a climate that is inclusive of all these groups is essential.”

The material that the AAMC has made available to its member institutions about creating an inclusive and welcoming community for LGBTQ students is extensive and thorough. A webinar dedicated to the topic details numerous strategies for fostering a safe and affirming environment for sexual and gender minority students, not merely cosmetic but structural. A 2014 report lays out a comprehensive approach to LGBTQ health education overall, including incorporating our particular health care needs into medical school curricula.

“We will continue to advocate for these issues,” Castillo-Page told me. “This is a priority for us. We know that there’s a need because our members are asking for additional resources in order to understand these issues further.”

So with all of these efforts taking place nationwide, what about things back at my alma mater? How would an expression of homophobia be treated at my school now?

I put the question to Dr. Raymond Cattaneo, assistant dean for first- and second-year medicine students at UMKC. I described my own experience and asked what would happen if a student came to the administration with something similar today. An openly gay man himself, Cattaneo was audibly dismayed when he began to answer my question.

“I can assure you that if a student had a complaint like that about a professor,” he said, “that would be taken seriously, and it would be addressed swiftly. Not only at the med school level, but I imagine that would constitute concern from a universitywide perspective also. It’s amazing how different the culture is here now than it was 20 years ago.”

He went on to describe the efforts the medical school and main campus have made to become more welcoming and inclusive of gender and sexual minority students. The school has an office of LGBTQ programming now and offers a series of lectures during Pride month. There are scholarships for LGBTQ students, and Cattaneo himself is president of the university alumni association. In addition to his assurances that the school had changed, he concluded with a request.

“[Your experience] was significant enough for you to say ‘I don’t want anything to do with that school again.’ I would ask you personally to come back,” he said. “Please come back. I’m inviting you out. Because it’s not like that anymore.”

It’s an invitation I plan to accept.