The smart contract that guarantees patient satisfaction

Ryan Cody
MedX Protocol
Published in
4 min readSep 17, 2017

As the first decentralized healthcare service platform, MedCredits is able to both increase patient access to medical care and reduce the cost and inconvenience of traditional office visits. We firmly believe these improvements should never come at the expense of patients and doctors. This is why we have carefully designed measures to guarantee that our patients receive high quality evaluations while simultaneously ensuring that doctors are fairly compensated.

In a traditional office visit, if a patient is dissatisfied with a doctor’s recommendation, the patient has the option of seeing another doctor for a second opinion. Although often costly and time consuming for the patient, a second opinion can give a patient confidence or sometimes even catch a misdiagnosis.

Utilizing the ‘Hippocrates’ smart contract, MedCredits allows patients to obtain second opinions at reduced rates with the click of a button.

Opting for a second opinion: Non-technical overview

Upon submitting a case, the patient transfers the evaluation fee PLUS 50% to the smart contract account. After a doctor evaluates the case and submits a recommendation, the patient has the option of accepting or challenging the diagnosis/recommendation.

If the patient accepts the diagnosis/recommendation, the smart contract executes, sending the initial fee to the doctor and the extra 50% back to the patient.

If the patient challenges the diagnosis/recommendation, the case will automatically be re-listed on the network for re-evaluation. In this situation, the case can then be evaluated by another doctor on the network. Of note, from the doctor’s point of view, patient cases that are up for second opinions appear identical to initial evaluation cases.

  • If the second doctor’s opinion matches the first doctor’s opinion, then the smart contract executes sending the initial evaluation fee to the first doctor (rewarding the first doctor for his diagnosis), and the extra 50% to the second doctor. In this case, the two doctors independently responding with the same diagnosis give the patient confidence in the medical recommendation. The patient was able to obtain 2 independent medical consultations for a reduced rate with the click of a button. Simultaneously, the doctors are also compensated for providing quality recommendations.
  • If the second doctor’s opinion does NOT match the first doctor’s opinion, then the smart contract executes, refunding the initial evaluation fee back to the patient and transferring the extra 50% to the second doctor. The first doctor does not receive any payment in this scenario.

In traditional office visits, a patient in the above situation has now paid full price twice and waited weeks/months for two medical consultations that are in disagreement. The patient is now left with the difficult decision of spending more money and time seeking a third opinion or choosing which medical recommendation to follow. We believe that this system is not fair to the patient.

On the other hand, on the MedCredits platform, the patient was able to obtain two independent medical consultations for only 50% of the initial evaluation fee. The patient was given a significant discount because of the conflicting medical opinions.

Opting for a second opinion: Technical overview

For the more technical reader, let’s go through the logic pathway of the smart contract. Below we define the legend and terms of the smart contract in simple language:

The MEDX token smart contract is built on the basic ERC-20 standard token smart contract. The diagram below outlines the relationship between MEDX and the base class for ERC-20 tokens:

Now let’s dig into the actual smart contract. The CaseManager contract inherits from an Ownable contract class. The Ownable contract has modifiers in place making sure only the owner can change certain values. The CaseManager owner will be the only user allowed to change fees, review times, and choose the token used in the interaction. The CaseManager contract will manage the fee, case timing, and doctor status for each case submitted via the app. This contract also enables UI interaction functionality via events. The contract is diagrammed below:

The contract below represents a case submitted via the app by a patient. It contains properties that track the status of the case, the doctors that are analyzing the case and the associated fees. It also contains functions that allow the patient to alter the status of the case, such as accepting or rejecting a diagnosis.

Finally, let’s define the case modifiers:

In summary, the Hippocrates smart contract ensures that patients receive convenient and affordable encounters while still maintaining high quality evaluations and fairly compensating the doctors. This is a vast improvement over the traditional office-visit model.

--

--