By Gary Duffy
BBC News, Sao Paulo
Many of the sufferers are children
A Brazilian judge has ordered Rio de Janeiro state and city to start using private hospitals to help cope with a surge in cases of dengue fever.
At least 54 people have died across Rio state since the start of the year while the number of people infected is now said to have passed 43,000.
The judge accused the authorities of neglect and indifference to sufferers of the mosquito-borne fever.
They had failed to act to prevent and contain the epidemic, she said.
For weeks, hospitals in Rio have been struggling to cope with the latest outbreak of dengue, a disease which is spread by one type of mosquito and which in extreme cases can be fatal.
On Friday at just one hospital in the city people said they had been waiting around five hours to receive attention, and a long queue stretched out of the emergency room into the street outside.
A short time afterwards, a woman waiting in the hot sun for attention fainted and had to be carried away.
Judge Patricia Cogliatti de Carvalho has now ruled that the state and city have to send patients with dengue to private hospitals and clinics when demand exceeds the capacity of public hospitals.
The state would then have to pay for the treatment within 20 days.
In her ruling, the judge spoke of the "neglect and indifference" shown by the authorities in relation to dengue.
This had meant patients, including old people and children, passing through indescribable agony and embarrassment as they waited hours for treatment, as well as running the risk of losing their lives.
Brazil's Health Minister, Jose Gomes Temporao, has acknowledged that incomplete information means the death toll and the number of cases reported are almost certainly much higher.