They are factories of despair: the detention centres where asylum-seekers desperate enough to risk their lives trying to reach Australia in leaky boats find themselves locked up, sometimes for years, by one of the world’s wealthiest nations,

That the conditions in these factories – the sexual abuse, the suicide attempts, the cockroach-infested living quarters – are well documented is in large part due to the doctors and other health professionals who have worked there and subsequently spoken out, horrified by what they witnessed.

Now the Australian government is seeking to shut down the sources of bad news stories, passing legislation which threatens not only doctors but nurses, teachers and social workers with two years in jail if they divulge information from inside the centres to the media or anyone else without express permission.

The harsh new law affects immigration facilities at home as well as Australian-run camps on the remote Pacific island of Nauru and impoverished Manus Island, in Papua New Guinea.

A candlelight vigil is held in Melbourne in memory of an Iranian man who died in a detention camp in Papua New Guinea (AFP/Getty)

John-Paul Sanggaran, a GP who detailed shockingly poor healthcare in the detention centre on Christmas Island, an Australian territory in the Indian Ocean, after completing a three-month stint there in 2013, believes it will have a “chilling effect”.

“It’s clear that they want to silence people, to intimidate and scare them,” he says.

The legislation, which came into force on 1 July, has caused an uproar, with all the main professional bodies, including the Australian Medical Association, uniting in condemnation. It has also been denounced overseas, including in the British Medical Journal.

Australian health workers are fighting back. Public rallies have been held, and Dr Sanggaran has released an open letter signed by 40 or so doctors who have worked in detention facilities, challenging authorities to prosecute them.

They have even forced a retreat of sorts, with the government now claiming that it never intended to target whistleblowers and that the law would affect only “sensitive operational information”, not disclosures made in the public interest.

Even so, there seems little doubt that many will think twice before contemplating a job in immigration detention, deterred by the prospect of being caught between their duty of care to patients and a potential prison sentence.

Even before the new legislation, doctors and other professionals were forced to sign a confidentiality agreement, meaning that those who spoke out risked losing their jobs, harming their careers and possible prosecution.

For Dr Sanggaran, though, like many others, there was simply no choice. “These are some of the most vulnerable people you can imagine. They’ve come from war-torn countries, they’ve often got visible signs of torture on their bodies, they’re pregnant women, they’re children.

“We’re taking tortured and traumatised refugees and putting them into dysfunctional camps with poor conditions and really terrible medical care, sometimes indefinitely, and children are being denied an education.”

And these are the ones that make it – or made it before Tony Abbott’s conservative government slammed the door shut on people fleeing Afghanistan, Iran, Iraq, Sri Lanka and Myanmar.

Mr Abbott boasts that he has “stopped the boats”, although in reality the boats are still leaving from Indonesia, the main transit country for asylum-seekers from the Middle East and South Asia: they get intercepted by the Australian Navy mid-ocean, turned round and sent back.

These “on-water operations” are shrouded in extraordinary secrecy, with the Australian public – as well as MPs – given little or no information. The new law gagging doctors draws the veil down even further.

Meanwhile, the Labor Party recently helped to defeat a Greens party motion that would have introduced mandatory reporting for child abuse in the centres – already the case in every Australian state and territory.

Facilities at the Manus Island Regional Processing Facility (Getty) (Getty Images)

While Australia’s Human Rights Commission recently highlighted the sexual abuse of women and children in the Nauru camp, as well as the sweltering and insanitary living conditions, it was the sub-standard healthcare at Christmas Island that scandalised Dr Sanggaran.

Exhausted and filthy asylum-seekers straight off the boat had their medication taken from them and thrown away, he says, even though often the drugs they needed were not available on the island.

People whose conditions would have seen them admitted as emergency cases and operated on almost immediately in an Australian city were forced to wait weeks and sometimes months to be transferred to the mainland.