A health board has been ordered to apologise to the family of a man who took his own life while under the care of its mental health team.
He died 18 weeks after being discharged home on a community-based compulsory treatment order.
His mother complained to the Scottish Public Services Ombudsman about the care he received from NHS Borders.
The health board said it accepted the SPSO's recommendations and it was sorry for the upset its failings caused.
The ombudsman upheld the complaints relating to failings with the care plan and poor record keeping.
- There were "significant gaps and numerous retrospective entries" in the patient's medical records, which were "unreasonable" and likely to have affected the team's ability to fully understand the man's health and wellbeing.
- He did not receive the planned number of weekly visits - something that should have seen his case escalated to the responsible medical officer.
- The mental health team "did not communicate reasonably" with the man's mother - a failing the health board itself acknowledged.
- A significant adverse case review should have identified failings in record-keeping as part of the patient's care.
The ombudsman has asked NHS Borders to apologise to the man's mother and recommended that, where there is significant deviation from an agreed care plan, it should be escalated to the responsible medical officer for discussion.
A spokesman for NHS Borders said: "The SPSO findings highlighted that the delivery of care in line with the agreed care plan and record upkeep in this case were unacceptable.
"We have accepted all recommendations that were identified and have started to implement changes in line with these recommendations so that failings of this nature are not repeated.
"Relevant discussions will now take place and will also be documented if significant deviation from an agreed care plan occurs in future.
"We are very sorry for the additional upset that our failings have caused [the patient's mother] and her family at such a sad and already difficult time."