With the rise of Healthcare IT infrastructures, the need of healthcare data sharing and integration has become extremely important. Cloud computing paradigm is one of the most popular healthcare IT infrastructures for facilitating electronic health record sharing and integration. Many predict that managing healthcare applications with clouds will make revolutionary change in the way we do healthcare today. Enabling the access to ubiquitous healthcare not only will help us improve healthcare as our data will always be accessible from anywhere at any time, but also it helps cutting down the costs drastically. However, since healthcare data contains lots of sensitive private information, how to protect data privacy within the untrusted cloud is facing a huge challenge. Thus, a mechanism to protect the privacy of healthcare data is needed when these data are stored and processed within the cloud to provide various medical services. To address this issue, in this paper, we present a generic framework named PriGen that preserves the privacy of sensitive healthcare data in the cloud. PriGen allows the users to preserve privacy while accessing cloud based healthcare service without the help of a trusted third party. With making use of homomorphic encryption function on sensitive private information; our proposed framework maintains confidentiality of private information sent by the cloud users to untrusted cloud based healthcare service providers. In this paper, we also present a brief discussion of different components of PriGen framework.