In the rapidly evolving world of healthcare, the need for efficient medical insurance claiming processes is paramount. With the advent of blockchain technology, we can streamline this process through a decentralized application (DApp) that handles medical insurance claims effectively. In this article, we’ll guide you through the steps to deploy and interact with the Medical Insurance claiming DApp built on Ethereum with Smart Contracts.
How Does This DApp Work?
Imagine a digital office where various stakeholders in the healthcare process — patients, hospitals, and labs — collaborate seamlessly to manage medical insurance claims.
- Patient: The patient submits medical lab test bills that need insurance claiming.
- Hospital Admin: Once notified, the hospital admin verifies and approves the submitted bills.
- Lab Admin: The lab admin does the same for lab-specific bills.
- Insurance Admin: After receiving approvals, this admin computes the claim amount and processes it.
This entire interaction is logged and managed through a smart contract in the HealthCare.sol contract.
Steps to Deploy and Interact with the DApp
Let’s dive into the nitty-gritty of deploying this DApp:
- Copy and paste the contract code on https://remix.ethereum.org.
- Run an instance of ganache-cli on your local machine and connect your MetaMask wallet to it. Import the first three accounts from Ganache and assign names:
- Account 1: Hospital Admin
- Account 2: Lab Admin
- Account 3: Patient
- Pass the Lab Admin’s address as an argument in the constructor while deploying the contract.
- Select Injected Web3 in the Environment field and ensure your MetaMask wallet is unlocked for the Hospital Admin’s account connection.
- Deploy the contract.
- Switch to Account 3 (Patient) and create a new medical record by calling the newRecord function with the respective fields.
- Check the created record and its details by calling the _records mapping with index 1.
- Return to Account 1 (Hospital Admin) in MetaMask, enter the record’s _ID in the signRecord function, and click on transact.
- Repeat step 9 with Account 2 (Lab Admin) in MetaMask.
- Verify the approval status by checking the _records mapping again, where you will see an increment in the signature count.
Note: It is not possible for a patient to sign a record nor can the same account sign a record multiple times.
Interface Update Alert
With the new Remix interface, you may need to manually change the account address in the Deploy and Run tab. This is crucial to ensure you are interacting with the correct account during the signing process.
img width=369 alt=Screenshot 2021-05-02 at 2 10 52 PM src=https:user-images.githubusercontent.com20457952117578650-f00c6480-b10c-11eb-906e-c5ff79252585.png
Troubleshooting
If you encounter issues while deploying or using the DApp, here are some common troubleshooting tips:
- Ensure that your MetaMask wallet is connected to the correct network.
- Make sure to use correct private keys when importing accounts into MetaMask.
- If the contract isn’t deploying properly, recheck the provided code for any syntax errors.
- In case of UI issues, remember that the project might still be in a rudimentary state. Contributions for enhancements are welcome, and as a token of appreciation, you’ll receive some DOGE!
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Known Issues
The table on the React front end may not display the records created by the user (Issue #1). The main goal of this project is the smart contract logic, and the front end was developed in a limited timeframe. Your contributions to fix these open issues will be greatly appreciated.
How to Contribute
If you’re interested in contributing, follow these steps:
- Fork this repository.
- Commit your changes.
- Send a Pull Request (PR) to this project’s master branch and add me as a reviewer.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.