Quick disclaimer: it's impossible to be a "good colonialist." That said, Barry seemed to help things everywhere he went: he improved sanitation in South Africa, worked for better conditions in the West Indies, and helped contain a cholera epidemic in Malta. We know, we know, containing an epidemic seems easy now, with all of our science and medical expertise, and-- haha, just kidding.
Anyway, James Barry was a helpful dude! He frequently advocated for improved housing and nutrition, making the apparently unprecedented connection between decent living conditions and public health. When he finally died of dysentery in 1865, he demanded to be buried in the clothes he was wearing, and his body remain unwashed. This request was ignored, but Major D.R. McKinnon, the man who signed Barry's death certificate, said his gender was "none of my damn business."
Sadly, that didn't stop the secret from getting out. British press reported on "the woman" who got an MD and served in the military for 40 years, which the military huffily denied while sealing Barry's records for a century. Real mature reactions all around, but, as we've said, the 19th century was goddamn depressing.