Patients often visit several hospitals to obtain medication, generating a significant volume of data. Moreover, hospitals use different data analytic techniques to improve healthcare services, leading to patient data privacy. However, no integrated architecture has a trustworthy data repository and secure communication protocols to store and share the data with various parties (e.g., hospitals and data analysts) for different healthcare services. This study proposes an innovative three-tier secure and distributed privacy-preserving healthcare architecture that addresses the aforementioned challenges. The first tier introduces a trustworthy data repository called custodian, where the data owner stores encrypted data and offer real-time privacy-preserving health monitoring service. The second tier provides Elliptic Curve Cryptography-based authentication for secure data exchange between the data owner and the hospital. The third tier utilizes smart contracts and local differential privacy (LDP) for secure machine learning model training. All transactions are recorded on the blockchain and managed by a smart contract. Security analysis shows that the proposed framework ensures privacy, security, and data integrity. Performance analysis is done based on score metrics, scalability metrics, and formal analysis. A transaction takes 0.00121 s in the first tier, and in the second tier, it takes 0.1267 s. The third tier uses ɛ−LDP with a privacy budget of ɛ = 3 on Random Forest and achieves 97%, 83%, and 74% accuracy on breast cancer, heart disease, and diabetic datasets. This accuracy is higher than the previous state-of-the-art methods. Moreover, the proposed healthcare framework ensures privacy, security and outperforms the previous state-of-the-art methods.