With the growing demand of cloud computing most healthcare organizations are moving software to the cloud in form of web services. Web services are popular in terms of distributed technology that can successfully solve integration problems between heterogeneous systems. There is now an increasing demand for sharing medical records between healthcare providers due to treatment duplication between healthcare providers which increases the cost of medication as well as medical errors. This paper aims to provide a web service broker framework in the cloud that facilitates the exchange of medical records between a large variety of providers such as large and local hospitals, imaging labs, clinics, laboratories and healthcare institutes which will allow doctors to obtain a complete patient medical records, and allow healthcare organizations to avoid duplication, reduce medical errors and medical cost. Furthermore, the broker will provide a QoS-Based optimization algorithm that can discover and compose medical services based on healthcare requester workflow and QoS requirements. To demonstrate the efficiency and effectiveness of our algorithm, a case study and experimental results will be provided.