Tammi Bruce, described by doctors as a prescription-drug user who self-harmed to ensure her medication was never stopped, was found “unresponsive” on her bed in Cornton Vale Prison, Stirling.
Miss Bruce, of Auchterarder, Perthshire, and formerly of Pitlochry, had appeared four days before her death in unusual circumstances at Perth Sheriff Court.
A petition alleged she had assaulted a man with a baseball bat, but she was not brought into one of the public courtrooms because she was suffering from the contagious skin condition impetigo.
The case was heard in a cell with the sheriff and staff remaining outside the door and she was remanded in custody.
Prison GP Dr Jahangir Khan, who saw her the next day, told the inquiry at Falkirk Sheriff Court: “She was very tearful, and when I asked her why the only reason she gave was that her five cats and two dogs had been taken into care and were going to be re-housed.”
Dr Khan, 51, said Miss Bruce, 38, had “historic” slipped discs and fractured ribs and had been prescribed the opiate painkiller Tramadol, the tranquiliser diazepam, and the nerve-pain killer Pregabalin.
He said the prescription of the drugs contravened health guidelines from NICE - the National Institute for Health and Care Excellence - and “rang alarm bells”.
He said: “My concerns were raised because the pain she was describing didn’t tally with the medication.
“Tramadol produces the same effect as heroin, diazepam is a strong sedative, which could be compared with the likes of marijuana, and Pregabilin is described as a high.”
He said he decided to withdraw the drugs after phoning Miss Bruce’s own GP.
He said: “The doctor said he and his partners had been trying to start a gradual reduction of the three drugs but ‘something always happened’, such as a fall or or an injury.
“I believe he was trying to tell me that there was self-harming going on to keep these drugs being prescribed.
“My recollection is that he said he’d be grateful if these drugs could be stopped, and he wouldn’t be reissuing them.”
The inquiry will continue at a date to be fixed.