The availability of medication at pharmacies is one of the major problems in the health sector of developing countries. Patients are frequently forced to arbitrarily switch pharmacies in search of the prescribed prescription. Lack of hospital and pharmacy drug information communication and inventory systems, as well as a lack of knowledge about the locations of pharmacies that carry the necessary medications, are some of the issues. The goal of this project is to provide a framework that will make it easier for anyone looking for a local pharmacy to find and locate one. The framework was created using the primary obstacles to obtaining necessary prescribed medications identified in the literature. The framework uses the client's and pharmacies' latitude and longitude coordinates to find the closest pharmacies that have the required prescribed medication in stock. To achieve this, the identified restrictions are optimized (distance, drug cost, travel time, travel cost, opening and closing hours of nearby pharmacies). The framework may reduce patient expenditures and prevent delays in the delivery of medications. It will also pave the way for future pharmacy and e-Health information systems.