Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

It was just a scraped knee. So 3-year-old Ashley Pacheco's parents did what parents do: They gave her a hug, cleaned the wound twice with rubbing alcohol and thought no more of it.

Two weeks later, the little girl writhed screaming in a hospital bed. Her breathing came in ragged gasps as she begged passing patients for a sip of water.

Her mother stayed day and night in the trauma unit. She kept Ashley on an empty stomach in case she might cut in front of hundreds of other patients for emergency surgery in one of the hospital's few functioning operating rooms.

Her father scoured Caracas for scarce antibiotics to fight the infection spreading through his daughter's body.

They had no idea how much worse it was going to get.

In this Aug. 11, 2016 photo, 3-year-old Ashely Pacheco rests with her father Maykol Pacheco in her hospital bed at the University Hospital in Caracas, Venezuela. Ariana Cubillos / AP

If Venezuela has become dangerous for the healthy, it is now deadly for those who fall ill.

One-in-three people admitted to public hospitals last year died, the government reports. The number of operational hospital beds has fallen by 40 percent since just 2014. And as the economy fails, the country is running short on 85 percent of medicines, according to the national drugstore trade group.

"I really don't know of any other country where things have deteriorated so quickly, to such an incredible extent," said Rafael Perez-Escamilla, a Yale University School of Public Health professor who has worked in Latin America and Africa. "Venezuela's health system was a model for Latin America. Now you are seeing an implosion where people cannot get basic care."

Ashley's parents had been determined to shield her from the chaos engulfing their country. When water began coming out of the taps with a foul smell, they boiled it before her daily bath.

But a week after her fall in mid-July, Ashley started to run a fever.

At the local clinic, doctors said she would soon be on the mend. Yet the fever kept rising, and her knee was swelling. So Maykol and Oriana Pacheco loaded her between them on their motorcycle and took off, determined to find a hospital that would take their case more seriously.

In this Sept. 19, 2016 photo, Maykol Pacheco, places a helmet on his daughter Ashley as they prepare to ride away from the University Hospital in Caracas, Venezuela. Fernando Llano / AP

They went first to the public children's hospital nearest their home, but they didn't have medicine for Ashley.

Next, the family tried the country's main pediatric hospital. There were no beds for Ashley.

As their little girl grew warmer between them, Maykol and Oriana went to the city's largest hospital. Men were lying mostly naked on the floor in the emergency room, IV lines snaking down from poles above them. There was no room for a sick 3-year-old.

By the next morning, Ashley's temperature had spiked to 103 degrees (39.4 degrees Celsius). Out of options neat their home, he turned his motorcycle toward University Hospital, once one of the best hospitals in South America but lately better known for gang shootings in the operating rooms and stickups in the stairways.

They arrived around noon on a Saturday. Ashley's left leg had swollen from the tip of her toe to the top of her thigh. All at once, she was whisked into emergency care.

In Ashley's hospital, the janitorial staff had run out of bleach to clean the floors. Stray dogs wandered the building, and cockroaches scuttled by on the walls. The water in the bathroom sometimes came out black.

In this Aug. 23, 2016 photo, Oriana Pacheo watches intently as a nurse injects antibiotics into the arm of her 3-year-old daughter Ashley, at University Hospital in Caracas, Venezuela. Ariana Cubillos / AP

Doctors diagnosed her with a staph infection. Bacteria had entered the tissue near her knee, and were burrowing into her joint.

They set up an IV drip and poured in the last of the hospital's supply of vancomycin, a widely used antibiotic. Dazed, her father watched the green line on her heart monitor loop up and down.

As night fell, Ashley got dramatically worse. The green heart monitor line began to zigzag wildly. Her breathing sounded strange, like hoarse hiccups.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Doctors suspected bacteria had traveled from her knee to her lung and eaten a hole there. But the hospital's last X-ray machine had given out the month before. The only way to know for sure was to risk transporting Ashley to a private clinic, where the test would cost the family a week's wages.

Two doctors went with them in an ambulance, ready to pump air manually into Ashley's lungs if she went into respiratory arrest.

RELATED: 'We're Hungry': Thousands Protest in Venezuela's 'Toma de Caracas'

The X-ray confirmed their fears: Ashley's right lung had collapsed like a balloon.

Back at the hospital, Ashley sounded like she was drowning. Her breath came in irregular gasps. Doctors looked for the apparatus that could save her: a Pleur-evac chest drainage machine that sells for $100 in the U.S. The hospital had a few, but they were locked away. Like all hospitals here, University Hospital has been pillaged, even by staff, as supplies become rare and valuable contraband.

The emergency room doctors made do with a trick from battlefield medicine instead.

As night fell, they gathered around the crying girl and slid a large needle into her chest. Air came whooshing out. Normally, medics would then insert a one-way valve, but there was none to be found. Still, little by little, Ashley's hiccupping breaths grew less frantic.

Doctors then called her parents out into the hall. The hospital's supply of the intravenous antibiotic was nearly gone. And without a chest drainage machine, Ashley wouldn't live to see the next evening.

When they heard the news, Maykol and Oriana hugged each other and cried.

In this Sept. 19, 2016 photo, Marvin Osuna sits near a sunlit window in a passageway at University Hospital, in Caracas, Venezuela. Fernando Llano / AP

Then, in the hospital waiting room, they assembled a search team. They pulled in siblings, grandparents, aunts and cousins. Everyone was on their phones, calling people who might know where to find medical supplies on a Saturday night.

Oriana's sister went to hospital after hospital, tearfully begging administrators to donate their machines. Some accused her of looking to resell medical equipment. No one was willing to help.

After midnight, a friend of Maykol's aunt found a doctor at a private clinic who agreed to donate a Pleur-evac. Oriana's sister headed to the clinic through empty streets at 1:30 in the morning, long past the crime-ridden city's unofficial curfew.

Coming onto his shift Sunday, pediatric resident Richard Rangel approached his new patient with dread.

Sprouting tubes and wires, Ashley looked like another desperate case. Her leg had swollen to the diameter of a dinner plate and taken on an ugly purple tone.

Ashley now required surgery to drain her infected knee. Only two of the hospital's 27 operating rooms were fully functional, and 150 children were waiting for a spot.

Ashley needed an empty stomach for the operation. For two days she kept pleading for food and water. By Tuesday morning, she was begging to drink from the pouch of saline solution dripping into her arm.

Maykol was out on his motorcycle when he got the call that Ashley had been booked for surgery. He began speeding down the highway and crashed into another biker, falling and bruising his shin. Bleeding, he continued to the hospital.

Doctors said the bacteria had damaged the membrane that lubricates Ashley's knee, and could have affected the growth plate. She might walk with a limp, and one leg might grow to be shorter than the other. But if the operation went well, she could still be a mostly healthy little girl.

In this Aug. 24, 2016 photo, Ashley Pacheco, 3, cries as she receives an injection as her mother Oriana watches at the University Hospital in Caracas, Venezuela. Ariana Cubillos / AP

Two surgical residents sterilized a used needle and injected Ashley with anesthetic. It took them half an hour to clean and drain her knee. They had become experts in the procedure over the summer, as more children come in with complications from simple injuries. The only thing unique about Ashley was how well-fed she seemed; healthy enough to fight to save.

The family celebrated a week later as Ashley was able to breathe without her oxygen mask. Her fever was running below 100 degrees (37.8 degrees Celsius). With any luck, she would soon be back to dancing on her bed to music videos.

But the next day, the fever was inexplicably worse again, 102 degrees. By the end of the week, she was quaking under her Dora the Explorer sheets, drenched in sweat, with a fever of 106 (41 Celsius).

And Oriana noticed something new: red spots spreading across her still-swollen skin.

Rangel felt a wave of disappointment as he recognized the telltale sign of a heart infection. There hadn't been enough antibiotics to stop the staph from quietly spreading all this time. Disgusted, Rangel thought of the two months he'd spent working with an aid group in Sierra Leone, where at least he'd had basic supplies.

A heart infection is such a rare complication in a healthy child that no one had thought to warn Ashley's family about it. Maykol took the news stoically. But he was devastated. He'd done all he could to protect his child, and now, just as she seemed out of danger, the doctors said she was sicker than ever.

Rangel said she would need more vancomycin - three doses daily for three weeks, without fail — to stop the infection before it ruined her heart or spread to her brain.

RELATED: In Miami, Recently Arrived Venezuelans Face Desperate Times

Finally, in mid-August, nearly a month after she was hospitalized, Ashley's fever subsided. She giggled during an echocardiogram when the technician let her hear the rhythm of her heart. But Oriana watched, worried, as the technician went back again and again to look at the same spot from different angles. That couldn't be good.

The bacteria had receded, but Ashley's heart was scarred. And as she grew, her tricuspid valve would likely begin to leak. Eventually, this could lead to congestive heart failure, and she would need to get the valve replaced. Exhausted, her mother filed that information away to think over later.

With few laboratory supplies available in the hospital, Maykol took vials of Ashley's blood all around the city looking for clinics to do basic tests. Worried about hospital-acquired infections, he wanted to get her home as soon as possible.

In the end, help came from the next room over. The mother of the boy with the lung infection donated his medicine to Ashley.

Her son was dead.

In this Sept. 19, 2016 photo, 3-year-old Ashley Pacheco waves goodbye after she was discharged from University Hospital in Caracas, Venezuela. Fernando Llano / AP

In late September, two months after she was first admitted, Rangel declared Ashley infection-free.

Oriana sold the medication the family had left over to other mothers on the floor. She used some of the money to get Ashley's ultrasound done in a private clinic, and put the rest away for her future treatment.

"We have nothing left," she said. "I could have sold the medicine for four times as much as I did, it's so precious."

There was something else to save for, too. After years of putting it off, Maykol and Oriana were planning to have Ashley baptized. It would be a celebration of her recovery and a safeguard in case she fell ill again.

When she was discharged, Ashley limped down the hallway clutching a balloon and a child-sized motorcycle helmet for the trip home. Residents and nurses shouted after the departing family.

They called out not "goodbye," but "good luck."

Follow NBC News Latino on Facebook, Twitter and Instagram.