Yes, but is it worth the trouble?
Also, you may be able to build robots to dispense pills. But have you seen a European automated pharmacy supplier? Everything is automated. They dispense all the blister packs into a small cart that gets delivered to the pharmacy. In the end it does not matter if you supply a pharmacy with 2-20 medicines or a consumer with 1-10.