Mr Nichol died of a methadone overdose after entering the clinic
An inquiry into the death of a man in a clinic has been told the doctor who prescribed a methadone dose which later killed him was himself a former addict.
Dr David McCartney had been "clean" for two years before he prescribed the heroin-substitute to 20-year-old Kieran Nichol at Castle Craig Hospital.
Mr Nichol died of a methadone overdose two days after being admitted to the Borders clinic in November 2005.
The fatal accident inquiry at Edinburgh Sheriff Court continues.
The inquiry has heard that Mr Nichol was an occasional user of heroin but was not addicted to the drug.
It was his second stay in the hospital, at Blyth Bridge in the Borders, for treatment for an addiction to valium and alcohol.
Dr McCartney, who now heads the Lothians and Edinburgh Abstinence Programme (LEAP), said his own experience of heroin addiction made him better-equipped to help others.
He was the clinical assistant at the hospital and examined Mr Nichol, from Hawick, when he arrived.
He said Mr Nichol told him he had been using between £60 and £80 worth of heroin a day, and Dr McCartney said there were physical signs - including pin-point pupils - to back this up.
He prescribed 30mg of methadone, despite conceding that there was no way of knowing what Kieran's tolerance level to the drug was.
He was given three doses in just over 24 hours, totalling 90mg of methadone, and died shortly afterwards.
Dr McCartney told the court he felt the clinic had proper safeguards
Dr McCartney admitted he could have waited to see if Kieran showed any signs of heroin withdrawal before prescribing methadone, but said that was not the procedure at Castle Craig.
Nursing staff on duty were free to contact doctors after hours or vary prescriptions if patients showed ill effects to medication, he said.
"I was comfortable when I left work on the Friday night that there were enough safeguards in place," said Dr McCartney.
Fiscal depute Angus Reith asked him if it would not have been safer to wait for signs of withdrawal before prescribing methadone.
"Yes that would be the safest thing to do," said Dr McCartney.
"I think with all the information I have heard I think it would be safer to wait until the signs of withdrawal."
However, he denied that he would have acted differently in Mr Nichol's case, even with hindsight.
"I don't think I could have done anything else," said the doctor.
"What happened wasn't what I expected to happen," he added.
The inquiry, before Sheriff Gordon Liddle, continues.