Walgreens has bought the assets and pharmaceutical records of Medly Health, the parent company of Pharmaca, for $19.35 million, according to court documents. As a result, all 22 Pharmaca stores nationwide are set to close by Feb. 25, including locations at Berkeley and Rockridge.