Ten companies in the Cara group of pharmacies will exit examinership next Monday after the High Court approved a survival scheme which will save more than 150 jobs.
€14m will be invested in the group.
In approving the survival scheme, Mr Justice Denis McDonald praised the HSE for its efforts to allocate Community Pharmacy Contracts to the companies and the Revenue for its pragmatic approach to issues, including providing a temporary tax clearance certificate, out of concerns to preserve employment.
The judge will issue a written judgment later outlining the reasons for his decision.
The judgment will also deal with whether or not there should be disclosure of details of an employment termination agreement negotiated by two directors of the group, Ramona Nicholas, a former presenter of RTE's Dragons Den, and her husband Canice, with Renrew Ltd, which is investing more than €14m in the group.
The couple have requested the agreement details be kept confidential.
The judge said he cannot give that commitment until he has examined the details of the agreement, which has been provided to the court at his request.
Judge McDonald also praised the examiner, Ken Tyrell of PwC, for the work involved in bringing the matter to a successful conclusion and saving a significant number of "very important" jobs.
Last September, the court confirmed the appointment of Mr Tyrell as examiner following an earlier application by the group's lender and largest creditor, Elm Corporate Credit.
Creditors meetings took place on 4 December last and the agreement between the investor and Mr and Mrs Nicholas was also reached that day.
The court was told Revenue issues had also been sorted and the investor had agreed Mr John Treacy should be appointed to the boards of directors of each of the companies.
The court also heard the scheme preserved 150 jobs, more than €14m investment had been secured and rent reductions had been agreed with landlords. Secured creditors would be paid and dividends would be paid to unsecured creditors who would have got nothing in a winding up.
Judge McDonald made orders confirming the scheme in the case of ten companies in the group, excluding Cara Pharmacy Group Unlimited Company which he said had dropped out.