A hospital patient punched an ambulance technician on the face and tried to gouge his eye with his fingers.
Andrew Smart was warned this week he was lucky not to be jailed for the attack.
Smart, 27, of Greenfield Drive, Cambusnethan, appeared at Hamiton Sheriff Court and admitted the assault at University Hospital Wishaw, on December 10 last year.
He was on bail for another matter at the time.
His not guilty plea to a charge of shouting and swearing was accepted.
The court heard the male ambulance worker was assaulted when he went to investigate a “commotion” in the accident and emergency unit.
Defence agent Stephen MacBride said Smart’s father had taken him to hospital out of concern for his mental health.
Mr MacBride told the court: “My client had been combining drink with prescribed medication and street valium.
“His behaviour was unacceptable, but this incident appears to have been a watershed for him.”
Sheriff Alasdair MacFadyen told delivery driver Smart that prison was an automatic consideration for assault in a hospital setting.
However, given his limited record, the sheriff was willing to impose a direct alternative.
Smart was ordered to do 150 hours of unpaid community work and pay £200 compensation to the assault victim.