Star of The Lobster will take lead role in the first feature about Dr James Barry, a 19th-century surgeon who served in the colonies but was later identified as a woman

Rachel Weisz is to play Dr James Barry, the mysterious figure who was a high-achieving medical doctor in the all-male profession in the first half of the 19th century, but who was identified as a woman after dying of dysentery in 1865.

Based on Rachel Holmes’s book The Secret Life of Dr James Miranda Barry: Victorian England’s Most Eminent Surgeon, this is due to be the first feature on the subject. Barry was born Margaret Ann Bulkley in Cork, Ireland, in about 1790, but then gained a place at Edinburgh’s celebrated medical school after adopting a male disguise.

Barry rose to the position of inspector general, HM Army Hospitals, after spells serving in British colonies in South Africa, the West Indies and St Helena. Also recorded is a posting to the Crimea in the 1853-56 war, during which Barry had a ferocious argument with Florence Nightingale.

Barry’s gender remains a subject of controversy, with speculation around a sexual relationship with Lord Charles Somerset (over which Barry fought a duel), governor of the Cape Colony, and questions as to whether Barry identified as male, adopted the identity in order to succeed, was gender-fluid or intersex.