The health of the hundreds of asylum seekers and refugees held on island nations in the Pacific has become a defining political issue for Australia.
More than seven years have passed since Australia reopened its offshore detention centre on the Pacific island of Nauru. There, and in Papua New Guinea, refugees and asylum seekers were sent to wait in limbo for years, the human collateral of a harsh policy. Many got sick, both physically and mentally.
Fast forward to today. The government desperately wants to repeal the "medevac" law, which, by giving doctors a greater say, makes it easier for the hundreds still in island detention to access medical treatment in Australia.
The issue has become a defining one, and debate on the medevac repeal is likely to feature in Australia's final political sitting week of 2019.
But how did we get here?
When Kevin Rudd unseated Julia Gillard to return as prime minister in 2013, he made a surprise announcement: nobody who came to Australia by boat in the future would ever be settled in Australia.
Gillard, who led a centre-left government, had reopened detention centres on Nauru and Papua New Guinea's Manus Island for offshore processing in 2012, as thousands of people tried to make it to Australia by boat. But Rudd's ban on ever being re-settled in Australia was new.
The policy was justified as an attempt to discourage people from taking the treacherous boat journey to Australia and halt the people smuggling trade in its tracks.
When the conservative Coalition won the election in September 2013, they doubled down on Rudd's pledge and introduced Operation Sovereign Borders — a military-led operation that includes intercepting boats before they arrive in Australian waters and turning them back to where they came from.
The numbers of potential refugees in the detention centres on Nauru and Manus Island escalated, starting from Rudd's declaration.
By June 2014, there were more than 2,500 asylum seekers in offshore detention: 1,198 men on Manus Island, and 1,268 people on Nauru — including women and children.
24-year-old Iranian asylum seeker Hamid Khazaei, who was held on Manus Island, died from a leg infection in September 2014.
After Khazaei contracted the leg infection, he developed flu-like symptoms. After three days, the Australian government approved his transfer to Port Moresby. He had a series of cardiac arrests. He was transferred to Brisbane, Australia, but he died a week later. A coroner would later find that Khazaei could have lived if he had received appropriate medical care when his condition first deteriorated. He found that Khazaei would have survived if he had been evacuated to Australia for medical treatment earlier.
Khazaei was the third man to die in offshore detention. Earlier in 2014, Reza Berati was murdered by security guards at the Manus Island regional processing centre, and Sayed Ibrahim Hussein drowned.
Meanwhile the number of people needing medical treatment for serious and complex complex in Australia was escalating. But in mid-2015, the government put on the brakes, deciding transfers to Australia should become "increasingly rare".
In 2013, 92 people were transferred to Australia. The following year that number went up to 362. The first half of 2015 saw similarly high numbers of transfers.
But in May 2015, after a review of the number and purpose of medical transfers, the government decided they should become "increasingly rare". According to a directive issued by immigration department secretary Michael Pezzullo, a patient would need to be in a "life and death" situation, or one "involving the risk of life-time injury or disability", to come to Australia. He said he expected at least half the asylum-seekers temporarily in Australia for medical treatment to be returned within a month.
Previously, family members of a patient were automatically transferred with them. After the review, the immigration department would decide on a case-by-case basis.
The review also led the government to invest in more medical facilities and expertise on Nauru and Manus.
A failed legal challenge to offshore detention saw people take to the streets for the Let Them Stay campaign at the start of 2016.
On Feb. 3, 2016 the High Court rejected a claim from a refugee that Australia's system of offshore detention was illegal.
In the wake of the case, refugee advocates launched the Let Them Stay campaign, demanding that 267 people in Australia for medical treatment (including 37 babies and more than 50 children) not be sent back to Nauru and Manus Island. The campaign achieved widespread support, with churches offering to provide sanctuary, and the 267 people were able to stay in Australia.
While the government largely stopped returning people to offshore detention, transfer numbers dropped dramatically.
In the calendar year 2016, just 73 people came to Australia from offshore detention. The number fell to 37 in 2017.
Although it is not government policy to keep sick refugees from offshore detention in Australia, since the Let Them Stay campaign very few people have been returned, even if they are not granted a visa. The last person went back to Nauru voluntarily in April 2018.
In the middle of 2016, two more refugees aged in their 20s died.
Omid Masoumali, 26, set himself on fire on Nauru on April 29, 2016. More than 24 hours later, he was flown to Brisbane, where he died several days later. Just two weeks later, Rakib Khan died at 26 from a suspected overdose.
A groundbreaking case in May 2016 laid the foundations for a legal campaign to get sick refugees to Australia.
A young woman refugee who became pregnant after a sexual assault on Nauru, and wanted an abortion, brought the case in the Federal Court. The Australian government wanted to take her to Papua New Guinea for the abortion, but the court found she could not receive a safe or legal termination there. The government gave evidence that they did not bring her to Australia because her case was not "exceptional" enough to comply with their strict policy.
In a landmark ruling, Justice Mordecai Bromberg found that the Australian government had a duty of care to the people it holds offshore.
In November 2016, the United States agreed to resettle refugees from Nauru and Manus Island.
After a famously heated phone call, US president Donald Trump agreed to continue the arrangement, which prime minister Malcolm Turnbull had negotiated with the Obama administration. The first refugees left for the US in September 2017.
In the face of the "unique and complex" medical problems facing refugees on Nauru and Manus Island, the government convened a taskforce of bureaucrats to decide who would come to Australia.
The transitory persons committee, established in mid-2016, sat without a doctor among its members for nine months. Meeting records obtained by BuzzFeed News showed the committee discussed the department's reputation and the likelihood of litigation when considering what to recommend. Until the medevac law, the secretive committee was the forum where transfer decisions were made.
The memo setting up the transitory persons committee noted that the government continued to see "unique and complex" cases, involving a combination of physical health, mental health and child protection issues. It said the committee's purpose was to consider the “medical, legal, diplomatic, policy and financial implications” of medical transfers to Australia.
After reading the minutes, a former doctor on Nauru, Nick Martin, told BuzzFeed News: "They’re coming at it from the position of, what can we do to keep this person out of Australia? That a dangerous point to start off from."
Taiwan and Australia secretly reached a deal in September 2017, allowing sick refugees to receive high-quality care for complex medical conditions — without being brought to Australia.
The first transfers happened in January 2018. At least 33 people have gone from Nauru to Taiwan for treatment, but many have refused to go.
Between August 2016 and November 2017, five more detainees died. Four had been held on Manus Island, and one on Nauru.
Building on the May 2016 decision, a flood of cases seeking medical transfers from offshore detention hit the Federal Court throughout 2018.
Some of the cases were brought on behalf of children on Nauru suffering from serious psychiatric problems.
All up, lawyers brought 48 court cases between December 2017 and February 2019 to have clients transferred for treatment. They won every case.
Lawyers who fought the cases have said the government routinely ignored requests to evacuate desperately ill refugees, forcing lawyers to front court on weekends and in the middle of the night.
In the midst of the legal onslaught, the Department of Home Affairs formalised its hardline policy: nobody would come to Australia unless there were "exceptional" circumstances.
A health crisis was building. Evidence grew that the environment of offshore detention not only made it more difficult to access medical treatment, but was causing health problems in the first place.
By mid-2018, health contractor International Health and Medical Services had started regularly reporting that the environment on Nauru was a factor causing ill health among refugees and asylum seekers.
International medical charity Médecins Sans Frontières agreed. "Living under a policy of indefinite processing creates a perpetual state of despair, making it impossible for asylum seekers and refugees to recover," said the organisation's Australian president in December 2018. After spending 11 months working on Nauru, MSF was expelled by the Nauruan government. MSF described the mental health situation on Nauru as "disastrous".
"In fact the mental health situation and suffering is amongst the most severe that MSF has seen around the world, including in projects providing care for victims of torture," president Stewart Condon said.
In mid-2018, two more asylum seekers died.
Children on Nauru developed Resignation Syndrome, a rare psychological illness where they withdrew from the world.
BuzzFeed News reported, and MSF later confirmed, that a number of children held on Nauru had developed the condition, which doctors liken to "going into hibernation". Children with the condition withdraw from the world, cease eating, drinking, speaking, and using the toilet, and fall into a seemingly comatose state.
Revelations in the media and the courts meant the Kids Off Nauru campaign gathered pace in the last months of 2018.
Meanwhile in Canberra, home affairs minister Peter Dutton launched a leadership challenge against prime minister Malcolm Turnbull.
Dutton was unsuccessful in the first spill, but over the course of a chaotic parliamentary week, Turnbull lost the numbers and resigned as leader.
A second spill saw Scott Morrison emerge victorious and be sworn in as prime minister in August 2018.
Turnbull also resigned from parliament altogether — causing a by-election in Wentworth. In a historic victory for a previously blue-ribbon Liberal seat, doctor and independent candidate Kerryn Phelps beat Liberal candidate Dave Sharma.
During her campaign, Phelps had spoken out about the treatment of refugees in offshore detention.
Her victory, together with the resignation of MP Julia Banks from the Liberal party because of her disgust with the leadership spill, left the Coalition with less than half of the seats in the lower house of parliament.
In February 2019, Phelps and the combined forces of Labor, the Greens and other independents succeeded in getting the medevac law through parliament.
It was the first time a government had lost a substantive vote on the floor of the House of Representatives in 78 years. The government stridently opposed the changes, which gave doctors a greater role in deciding who would be transferred. The government claimed it would lead to a flood of people smuggler boats making a dangerous sea voyage to Australia.
The first people transferred under medevac came to Australia on March 29, after the law commenced at the start of March.
Meanwhile, the health crisis in detention was worsening. In the first three months of 2019, 43 detainees were admitted to Nauru’s Regional Processing Centre Medical Centre (RPCMC), for stays between 1 and 44 days. The majority of admissions were for mental health treatment and some of the 43 were admitted more than once, with 73 admissions in total. There were 359 detainees in total on Nauru at the end of March.
Although the minority government could not repeal medevac, it fought the law in the courts, but lost in the Federal Court and the Full Federal Court. It has also tried to argue the courts cannot order refugees to be transferred from offshore, but was unsuccessful in the Full Federal Court. It wants to appeal the judgment in the High Court.
In February 2019, the last four children left Nauru, boarding a plane for settlement in the US.
The Morrison government was returned in the May election, this time with a majority.
But that election also brought back Tasmanian senator Jacqui Lambie.
With its newfound parliamentary majority, the government passed a bill to repeal medevac through the lower house in July. But it needs Lambie's vote to secure a victory in the Senate before it is passed into law and medevac is gone.
Meanwhile, medevac has continued to operate.
Under the first six months of the medevac regime, 127 people were approved to come to Australia. Since medevac became law, there have been no deaths in offshore detention. The independent panel which reviews government vetos of medical transfers has agreed with the government most of the time.
With one week left for the government get it done before the end of the year, all eyes are on Jacqui Lambie. She's said she'll vote to repeal medevac, on one condition...
...but has refused to reveal the condition, citing national security. Nine newspapers reported that she wants the government to secure third-country resettlement for the people remaining on Nauru and Manus, perhaps by taking up New Zealand's offer.
What happens next? We'll find out this week.