In the cloud-based electronic medical records (EMRs) system, the doctors upload EMRs to the cloud for storage and sharing. However, the integrity of EMRs stored in the cloud cannot be guaranteed and sharing EMRs may leak the patients’ private information. Furthermore, shared EMRs contain a lot of duplicate data, leading to data redundancy. To solve the above issues, we propose a cloud storage auditing and data sharing scheme with data deduplication and private information protection for cloud-based EMR. In our proposed scheme, we introduce the sanitizer to sanitize the data blocks containing the private information in EMR, and transform these blocks’ authenticators into the authenticators of sanitized EMR. The authenticators are utilized to check the data integrity. Using the above method, the EMR stored in the cloud can be shared with researchers while ensuring the privacy of private information and the integrity of EMR. In addition, our scheme can achieve block-level deduplication, in which only one copy of the deduplicated blocks in EMR needs to be stored. The conducted security analysis and performance evaluation affirm the security and efficiency of the proposed scheme.