Hannah Alden committed the offences in Wakefield on consecutive days in October this year after being being given a caution for assault.
Leeds Crown Court heard Alden was admitted to Pinderfields Hospital on October 22 after being assaulted in Wakefield city centre.
Police were contacted by hospital staff after they became concerned about her behaviour when she talked about harming herself.
Dave Mackay, prosecuting, said Alden became abusive towards the officers and a nurse who was trying to help her.
Alden shouted racial abuse at the nurse and called her a "b****."
Alden was arrested and taken to a police station.
She claimed she had been angry with the nurse as she thought she was laughing at her.
The defendant was released on bail with a condition not to enter Wakefield city centre.
Police and an ambulance were called to the city's bus station the next day at 9pm after Alden was found unconscious.
Mr Mackay said Alden was "heavily intoxicated" when the emergency services arrived.
She was aggressive towards paramedics and shouted abuse at a female police officer.
Alden called the officer a "common prostitute" and told her: "You will burn in hell."
Two kitchen knives were found in her pockets as she was arrested.
Alden spat in the face of another officer as she was being interviewed.
She later described her behaviour as "despicable and disgusting."
She told officers: "If I could take it back I would. I am deeply sorry."
Alden, of Blenheim Hill, Batley, pleaded guilty to racially aggravated threatening behaviour, assault of an emergency worker and possession of a bladed article.
Anastasis Tassou, mitigating, said Alden pleaded guilty to the offences at an early stage.
He urged Judge Robin Mairs to impose a community-based punishment so Alden could continue to receive support for her mental health issues.
Alden was given an eight-month prison sentence, suspended for 24 months.
She was also ordered to take part in 20 rehabilitation activity requirement days to address her offending.
The judge said: "Staff at A&E departments do an extraordinary job under considerable pressure.
"They are vulnerable because they must treat whatever comes through the door and they are subjected to abuse and violence.
He added: "The officers were there trying to assist and help you.
"They often do a difficult job in an exemplary way because they do not know who or what they will be called out to."