Juan Coronel was so thin that his kneecaps jutted out like tent poles in his sweatpants. He was 39 when I met him a few weeks ago, with reddish-brown hair that clung to his scalp like a baby's and deep hollows below his cheekbones. His voice was soft and raspy, and he seemed dazed at his own fragility. "I need to go and look for medicine," he said, "but I'm having trouble getting around."

I had not seen a person who looked like Mr. Coronel – a person dying of untreated AIDS – since I covered the pandemic in Africa at its height more than a decade ago. In fact, there is nowhere in the world today where people are dying of AIDS at the pace and in the sheer numbers that they are in Venezuela: Even the poorest African countries today have HIV treatment programs. They still don't reach everyone, and people are still dying, or getting treatment only after they become very ill – they may come to look as Mr. Coronel did when I met him. But in other countries, they are the exception. Today, in Venezuela, his case is the rule.

Back when I was covering the African epidemic, Venezuela was invoked with admiration: This country has had free, public treatment for HIV since 1999. Its AIDS program was a model for countries throughout the developing world. Venezuela's socialist government imported affordable generic drugs from India, challenged the patent monopolies of Western pharmaceutical companies and targeted marginalized communities, including sex workers, gay men and transgender people for free condom distribution – while most other countries were still grappling with the shame of HIV.

Story continues below advertisement

Read more: While the people of Venezuela suffer, its president paints a rosy picture

But Venezuela is now years into a political and economic crisis that began under that same socialist government, implemented by Hugo Chavez. Nationalizations, price and currency controls mean there are chronic shortages, and the once-leading AIDS program is in ruins.

If and when this crisis begins to be resolved, thousands of people will have died needlessly, and this country will once again have an out-of-control HIV epidemic, as it did 30 years ago. Today, there are no HIV tests available in the public system, people are unwittingly spreading the virus to sex partners and pregnant women are passing the virus on to their babies.

The national program is chronically short of drugs, which means that people living with the virus not only aren't getting treated, they are developing drug-resistant strains of HIV.

Hospitals lack even the most basic drugs to treat the infections that plague patients who can't get anti-retrovirals. People such as Mr. Coronel are dying from a lack of drugs that cost just pennies a dose.

There are no publicly available condoms, and they are wildly expensive in private pharmacies.

There is no infant formula for HIV-positive women to give their babies to avoid transmitting the virus in breast milk.

Story continues below advertisement

I have been reporting on Venezuela's deepening crisis for four years, and I knew about the state of the health system. But the reality of this AIDS program, which I knew from its excellent reputation, brought home the scale of how far this country has deteriorated. Feliciano Reyna, a veteran activist who founded one of Venezuela's oldest HIV organizations, Accion Solidaria, recognized my shock. "If you're not here and you don't see it, it's very hard for anyone to believe that any of this is true," he said.

I met Mr. Coronel and his mother, Matilde Munoz, in a ward of Caracas' Central University Hospital, once this country's leading public medical institution. The ward had patients with cancer, tuberculosis and gastroenteritis; for at least half of them, HIV was the underlying cause of their illness. Ms. Munoz brought her son to the hospital when days of uncontrolled fever and diarrhea left him so weak she feared for his life. But the hospital had no antibiotics, or even rehydrating fluid to run into the IV that someone optimistically inserted into his arm. This has been the state of Venezuela's public health system for some time now, and I had to ask Mr. Coronel, whose suffering was so evident and who was getting no relief at all: why come? Before he could answer me, the young doctor who was meant to be treating him interrupted: "I ask myself the same question," she said. "Why do they come?"

Even before Venezuela stopped testing people for HIV, it was hard to tell how many people were living with the virus. The government of Nicolas Maduro, who was tapped as a successor by Mr. Chavez before he died in 2013, has only erratically released health statistics in recent years, and doctors dispute their accuracy. The last reliable UNAIDS figures said 130,000 people in Venezuela had HIV/AIDS in 2012, with another 11,000 people, approximately, being diagnosed each year – that puts the current figure near 200,000, but it doesn't take into account that the rate of death from AIDS, and of new infections, have both accelerated.

As of 2015, 63,000 of those people were taking anti-retroviral medication to control the virus, according to UNAIDS. But today the drugs show up in the Caracas outpatient clinics for a month, then disappear for two or three; they are not available in any but the large urban centres, Mr. Reyna said.

The hospitals in Caracas reminded me of Zimbabwe in 2002, but they transport AIDS activists I met here even further back in time: to the early 1980s. "In Venezuela now we have deaths like you had in the first years of the epidemic," said Mauricio Gutierrez, who heads an activist organization called Positivos en Colectivo. "Except that people don't die with the same level of care that they had back then."

Medical supplies are seen in Hospital Victorino Santaella in Los Teques, a satellite city of Caracas. Many hospitals only have limited supplies to offer patients, with some having to reuse medical materials despite the risk of HIV transmission. Alejandro Cegarra/The Globe and Mail

Mr. Gutierrez has been making hospital visits to people with AIDS since the crisis set in. Three or four years ago, he started needing to bring sheets and soap, things that could be scarce in hospitals. Now he just tries to find drugs. Each patient gives him a list of the medications they need, and he spends the rest of the week hunting. "By the time I get back, not always with the medicines, they're dead," he said. In the month of May alone, he knew 22 people who died. For now, he has stopped making the visits, he told me this week. "For my sanity."

Story continues below advertisement

Mr. Gutierrez, who has been living with HIV for 23 years, said he is getting his own drugs from the central hospital program, and they are only available every couple of months. He knows exactly what this means: anti-retrovirals (ARVs) need to be taken daily, or the virus quickly mutates and becomes resistant. When the national AIDS program does have drugs in stock, they are only two basic ARVs, and there are no options to switch to if they stop working. Patients who can afford it buy their drugs on the black market, he said, but that's a tiny number of those infected.

It's all incredibly stressful, Mr. Reyna said, knowing you need the drugs, not knowing if you'll find them, and knowing what the end will look like if it comes. "Health is not only physical – it's your mental health too, and now there is a lot of distress," he said. "People who come to us very severely affected in terms of how they feel and how they see the future."

Occasional drug shortages began back in 2012, Mr. Reyna said; over the next two years, supplies often ran short, until the government reached a sourcing agreement through the Pan American Health Organization (PAHO) that helps countries in the region (the rest of them are officially poorer than Venezuela) to buy drugs at a collectively negotiated price. "We got everyone back on treatment and they should have been tested for resistance, but already there were no tests like that available," he said.

Mr. Gutierrez said condoms disappeared from the AIDS program in 2015, and basic HIV tests stopped being available a year ago. People on ARV treatment are supposed to have regular tests of their viral load (how much HIV is in their bloodstream) and their CD4 count, a measure of immunity, to confirm the drugs are working. The reagents needed to perform those were last available in September, 2016, in the capital, he said; the national laboratory that did the tests has been closed for six months.

Maria Eugenia Landaeta, the chief of infectious disease at the teaching hospital who oversees the HIV program for 5,600 patients, told me that the small group of AIDS physicians had been scrambling to hold it together for years. "The HIV and TB programs were the last to deteriorate," she said. "We have tried to defend the program in all possible ways."

Mr. Coronel, who worked in a cement factory until the shortage of raw materials caused his company to shut down, never got drugs from the national program. He had had HIV for years, he told me, but by the time he was sick enough to need ARVs, the program was chronically short of medications. While I was talking to his doctor, in a small office on the medical floor, a nurse came up to ask a question about a procedure for another patient. The doctor reminded her the man also had HIV, and the nurse reacted with surprise and distress; the doctor asked what was wrong. The nurse replied, "Because we're reusing all the tubes! But if we know a patient has HIV, we don't do it for them."

Today, the only HIV screening in the public system is at the blood banks, which, for now, still have tests. The lack of testing in antenatal care means that doctors there don't know if women are at risk of passing the virus to their babies when they come to deliver, Dr. Landaeta said, but then, most of the time, there are no drugs available to prevent transmission in any case. And when children turn up with the symptoms of AIDS, they can't treat those either. "We know we're having big problems with the control of the epidemic – but we have no access to tests," Dr. Landaeta said.

The only thing her program has to offer now is doctors, bed frames and gauze, she said. But even staffing presents a problem: She once had 12 infectious disease specialists to run the AIDS program but six have emigrated and two more will retire this year, worn out with trying to work with no supplies. She trains a new crop of residents each year, she said, and they promptly take their new skills out of the country.

Why, I asked her, are you still here? "It's stubbornness – nothing else. Because no person in their right mind would keep doing it," she said fiercely. "But my patients don't have anywhere else to go."

In 2016, a coalition of Venezuelans living with HIV asked the Global Fund to Fight AIDS, Tuberculosis and Malaria for help; in January, its director replied that because Venezuela remains a high-income non-OECD country, the fund would not help. (Venezuela has the world's largest oil reserves, and continues to export petroleum.) Those activists are continuing to push – although it is not clear if the Maduro government, which denies there is a humanitarian crisis in the country, would agree to accept the help, or how it might work. There is no other effort under way, from other countries or multilateral bodies, to get medicines into the country.

"When we're able to get some of these systems back, then we will probably find that we have been set back," Mr. Reyna said. "In not being able to prevent new infections, in reaching a lot of young people who could have benefited from prevention programs – we will find many were infected who could have been protected."

For now, small miracles come in the form of donations of drugs abroad, which Mr. Reyna and his activist friends haul back to Caracas in their luggage. A few days after I met him, Mr. Coronel got access to a month's worth of ARVs. Almost immediately, he began to get better – the Lazarus effect, they call it in the world of HIV. In the first draft I wrote of this article, he was recovering, but with a rapidly dwindling stash of pills.

But then, after I left Caracas, came a text message from his doctor. "I just wanted you to know Juan died this morning," it said. "The diarrhea started again and we didn't have fluids to hydrate him."