As the size of medical data grows exponentially, safeguarding Electronic Health Records (EHR) via cloud blockchain transactions becomes increasingly critical. This paper presents the Multi-User Groupwise Integrity Ciphertext-Policy Attribute-Based Encryption (GI-CPABE), an efficient framework designed to ensure robust data security. By implementing an Improved Ciphertext-Policy Attribute-Based Encryption (ICP-ABE), the GI-CPABE framework is designed to be compatible with both homogeneous and heterogeneous cloud environments, providing secure access that is role-specific and reliable. A distinctive feature of this framework is its role-based access control mechanism, which efficiently assigns user access rights and roles based on multi-user group attributes, considered as integrity measures. An experimental setup was established on a real-time cloud server, simulating a cloud based EHR system. Test data, mimicking real-world EHRs, was generated and subjected to encryption and decryption processes, evaluating the time efficiency of these operations. The proposed GI-CPABE framework demonstrated optimized storage utilization by calculating the overhead of encrypted data, ensuring data integrity through defined attribute-based policies, and enabling secure, controlled access to medical data. Furthermore, a comparative analysis was conducted to ascertain the effectiveness of the proposed framework against existing models. The implementation of access control mechanisms exhibited robust enforcement of access controls tailored to different user roles such as healthcare providers, patients, and administrators.