Hyperledger Use Case, in Healthcare

0
25

In this article, we will understand how blockchain helps healthcare industry in which clinical trials can happen much better than traditional and complex data flow.

Clinical trials are experiments or observations done in clinical research. Such prospective biomedical or behavioral research studies on human participants are designed to answer specific questions about biomedical or behavioral interventions, including new treatments (such as novel vaccines, drugs, dietary choices, dietary supplements, and medical devices) and known interventions that warrant further study and comparison. (Source Wiki)

Having read that, it is very clear that Clinical Trials has to happen under close monitoring circle and every actions they perform or take should be documented and tamper proof. Many existing technologies are there to perform this better, but after “Blockchain” evolved. Healthcare industry have started adopting this in every phases where the data security, integrity & high availability is met.

We will see this use case in 4 article, by end of 4th article you should be able to setup a blockchain network using Hyperledger, write chaincode and create rest-API to access the same.

Unfortunately, I am not a front-end developer, so I cannot promise the front end design, but I will ensure the complete backend is up & running without any flaw.!

No more talking!, Let’s get into business..

Steps to be done

  • Pre-Requisites — Environment Prep
  • Hyperledger Network Setup
  • Chaincode Setup — Use Case
  • REST-API Setup — To read and write into Blockchain

Step 1 — Hyperledger Network Setup — Environment Preparation

# Exit on any failure
set -e
# Array of supported versions
declare -a versions=('trusty' 'xenial' 'yakkety', 'bionic')
# check the version and extract codename of ubuntu if release codename not provided by user
if [ -z "$1" ]; then
   source /etc/lsb-release || \
       (echo "Error: Release information not found, run script    passing Ubuntu version codename as a parameter"; exit 1)
   CODENAME=${DISTRIB_CODENAME}
else
   CODENAME=${1}
fi

Update Package List

# Updating package lists
sudo apt-add-repository -y ppa:git-core/ppa
sudo apt-get update

Install Git

echo "# Installing Git"
sudo apt-get install -y git

Install NVM

# Execute nvm installation script
echo "# Executing nvm installation script"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

Setup npm environment without restarting the Shell

export NVM_DIR="${HOME}/.nvm"
[ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh"
[ -s "${NVM_DIR}/bash_completion" ] && . "${NVM_DIR}/bash_completion"

Install Node

echo "# Installing nodeJS"
nvm install 8.16.1
nvm use 8.16.1

Ensure CA Certificates are installed

sudo apt-get -y install apt-transport-https ca-certificates

Add Docker repository key to APT keychain

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Update where APT will search for Docker Packages

echo “deb [arch=amd64] https://download.docker.com/linux/ubuntu ${CODENAME} stable” | \
sudo tee /etc/apt/sources.list.d/docker.list

Update Package List

sudo apt-get update

Verifies APT is pulling from the correct Repository

sudo apt-cache policy docker-ce

Install kernel packages which allows us to use aufs storage driver if V14 (trusty/utopic)

if [ "${CODENAME}" == "trusty" ]; then
   echo "# Installing required kernel packages"
   sudo apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual
fi

Install Docker

echo "# Installing Docker"
sudo apt-get -y install docker-ce

Add user account to the docker group

sudo usermod -aG docker $(whoami)

# Install docker compose

echo "# Installing Docker-Compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.13.0/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Install python v2 if required

set +e
COUNT="$(python -V 2>&1 | grep -c 2.)"
if [ ${COUNT} -ne 1 ]
then
   sudo apt-get install -y python-minimal
fi

Install unzip, required to install hyperledger fabric.

sudo apt-get -y install unzip
sudo apt-get -y install zip

Install Nginx

echo "# Installing Nginx"
sudo apt install nginx

# Install mongodb

echo "# Installing mongodb"
sudo apt install -y mongodb
sudo apt-get install jq

# Install Go & Setup path

1) sudo apt install -y golang
2) export GOROOT=/usr/lib/golang
3) export GOPATH=$HOME/projects
4) export PATH=$PATH:$GOROOT/bin
5) Set this in .profile file for permenantly
6) . ~/.profile -> this command will help you to refresh the profile without loggingout

# Install Fabric

------curl -sSL http://bit.ly/2ysbOFE | bash -s <fabric> <fabric-ca> <thirdparty>----
1) curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.4 1.4.4 0.4.18
So if you want 1.4.0 version, change that accordingly in above command

This will take some time to download images for Fabric & once it is done. You should be able to see fabric-samples folder.

If you can able to setup this environment without any issues, you are ready to move into next article.

let’s catch up in next article.


Hyperledger Use Case, in Healthcare was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.