The HealthCare scenario shows an example of how an application can have more than one workflow, how one contract can deploy another contract and how to simplify a complex application logic by dividing the logic into several contracts. The HealthCare application has three workflows. The first workflow lets Hospital register in the HealthCare application and create a new smart contract for the Hospital. The second workflow lets the Doctors request to join a Hospital which will create a new Contract for the Doctor. The Hospital can accept or reject Doctors requests to join the Hospital. In case of acceptance, the Doctor contract will be linked with the Hospital contract. The third workflow lets the Doctor interact with the Patient and issue a medical record for Patient.

What it does

An instance of the HealthCare application is created, the contract can then accept Hospitals registration, which will deploy a new contract for each Hospital with Hospital Owner saved to the contract for later use.

Doctors can view available Hospitals from the registration contract Logs, and request to join a Hospital, which will generate a new contract for the Doctor with a Submited state and fires an event to the Hospital to Handle the Doctor request.

Hospital Owner can view Doctors registrations from the Hospital contract Logs, and approve/reject/ban the Doctor from the Hospital, which will update the Doctor contract state to Approved, Rejected or Banned.

After Doctor's Contract state is set to Approved, the Doctor can interact with Patients directly and issue medical records for them.

How I built it

Using Stratis blockchain network.

What's next for HealthChain.

Having a good front end representing these smart contracts.

Built With

Share this project: