The use of electronic medical records (EMR) has made processing of patient data easier, because the patient does not need to carry documents and can just show his/her ID to retrieve their complete medical record history. This digitization has revolutionized the medical sector, but there are two major challenges exist, which are security and trust with the online records. Anything stored on the Internet is not secure and needs an additional security framework to safeguard it and to maintain complete trust with the data. In this paper, a blockchain-based security framework is proposed, which aids to maintain the confidentiality of the EMR. This solution is also used to securely access the patient's records in any hospital by using the patient's public key as a universal identifier. This can also help to obtain the medical record history of a patient much quicker even during emergency situations. The proposed work also uses a credit score approach to keep track of the credibility of the entities authorized to input data to the blockchain. In this work, Etherium platform is used to simulate the blockchain, and an interplanetary file system (IPFS) is used to store the EMR. This effectively improves the trust with the uploaded data and reduce errors from the falsification of the data.