Information about healthcare is derived from healthcare data. Healthcare data sharing helps make healthcare systems more efficient as well as improving healthcare quality. Patients should own and control healthcare information, one of their most valuable assets, instead of letting data be spread out among health care providers differ. This protects data from being shared between healthcare systems and privacy. Public ledger accompanied by a decentralized network of peer's compromises patient has been demonstrated to be able to achieve trusted, auditable computing by blockchain. The use of access control and cryptographic primitives are insufficient in addressing modern cyber threats all privacy and security concerns associated with a cloud-based environment. In this paper, the authors proposed a lightweight blockchain technique based on privacy and security for healthcare data for the cloud system. The cost-effectiveness of our system's smart contracts is evaluated, as well as the procedures used for data processing in order to encrypt and pseudonymize patient data.