Pharma Supply Chain System using Smart
Contracts
  1) Background/ Problem Statement
The pharmaceutical industry faces significant challenges related to the
security and integrity of the supply chain, including issues such as
counterfeiting, diversion, and theft. These challenges can compromise
patient safety, reduce the effectiveness of drugs, and cause financial
losses for companies. In addition, traditional paper-based supply chain
management systems are outdated and inefficient, increasing the
likelihood of errors and delays in the supply chain. There is a need for a
more secure and transparent system that can enable efficient tracking
and tracing of drugs from the point of manufacture to the point of
consumption.
Our Pharmaceutical Supply Chain systems using smart contracts can
have a wide range of applications across the pharmaceutical industry.
Smart contracts are self-executing agreements with the terms of the
agreement directly written into the code. They can be used to
automate the process of supply chain management and reduce costs,
increase transparency and accountability, and improve patient safety.
  2) Working of the System
The system comprises 6 modules: Admin, Supplier, Manufacturer,
Wholesaler, Distributor and Customer.
The admin can log in using their credentials. They can manage the
Supplier, Transporter Manufacturer, Wholesaler, and Distributor and
create and assign smart contracts to them. They will have to approve
the customer’s account and create and assign smart contracts. The
admin can view the supply chain of each order along with the
transaction and block details. If any block or transaction has been
tampered with or manipulated, the admin will get to know.
The supplier can log in using their credentials. They can manage the raw
materials. They can view the orders from the manufacturer and assign a
transporter.
The manufacturer can log in using their credentials. They can manage
the medicines and add the raw materials. They can add, update, view
and delete the orders for raw materials. They can verify the order and
update the status.
The wholesaler can log in using their credentials. They can manage the
order they placed from the manufacturers. They can verify the order
and update the status. They can view the medicine orders placed by the
distributor. They can assign a transporter.
The distributor can log in using their credentials. They can manage the
orders they placed from the wholesaler. They can verify the order and
update the status. They can view the orders placed by the customers.
They can assign a transporter.
The customers would require to register first to access the system. They
can log in using their credentials. Customers can search for the
medicines they want to buy and order them. They can also verify the
source of the medicines. They can view the orders they placed and view
the source of the medicines.
Here, we are using Stratis Smart Contract. Smart Contracts and accounts
are created manually in Cirrus Core Dashboard and then assigned the
account information in the system. We have used SHA (Secure Hash
Algorithm) cryptographic hash functions to create a hash block.
The system involves HTML, CSS and JavaScript in the front end and
ASP.net with C#. The database is MSSQL. The IDE used is Visual Studio.
  3) Advantages
 The system helps to create a transparent and immutable record of
  every transaction in the supply chain.
 It helps to prevent fraud, counterfeiting, and other illegal
  activities.
 It can reduce the time and resources needed to manage the
  supply chain.
 It helps to improve efficiency and reduce costs.
 It assists to prevent hacking, data breaches, and other security
  threats.
 It eliminates intermediaries in the supply chain, such as brokers.
4) System Description
The system comprises 2 major modules with their sub-modules as
follows:
   Admin:
   Login:
     The admin can log in using their credentials.
   Manage Supplier:
     They add/update/delete/view suppliers.
     They can create and assign smart contract accounts.
   Manage Transporter:
     The admin can add/update/delete/view transporters.
     They can create & assign smart contract accounts.
   Manage Manufacturer:
     The admin can add/update/delete/view manufacturers.
     They can create & assign smart contract accounts.
   Manage Wholesaler:
     The admin can add/update/delete/view wholesaler.
     They can create & assign smart contract accounts.
   Manage Distributor:
     They can add/update/delete/view distributors.
     They can create & assign smart contract accounts.
   Manage Customer:
  They can view the customers.
  They will have to approve the customer’s profile.
  They can create and assign smart contract accounts.
 View Orders:
  The admin can view the supply chain of each order along with the
  Transaction and Block details.
  If any block or transaction has any tampering or manipulation, the
  admin will be able to see it here.
 Supplier:
 Login:
  The supplier can log in using their credentials.
 Manage Raw Materials:
  They can add/update/delete/view raw materials.
 View Orders:
  They can view all the orders.
  They can assign a Transporter.
 Manufacturer
 Login:
  The manufacturer can log in using their credentials.
 Manage Medicine:
  They can add/update/delete/view medicines.
  They can add raw materials.
 Raw Materials:
  They can add/update/delete/view orders of raw materials.
  They can verify orders and update the status.
 View Manufacturer Orders:
  The manufacturer can view the orders placed for medicines.
  They can assign a transporter.
 Wholesaler
 Login:
  The wholesaler can log in using their credentials.
 Medicines (Ordered from Manufacturer):
  They can add/update/delete/view orders.
  They can verify orders and update the status.
 View Distributor Orders:
  They can view the orders placed by the distributor.
  They can assign a Transporter.
 Distributor
 Login:
  The distributor can log in using their credentials.
 Medicines (Ordered from Wholesaler):
  They can add/update/delete/view orders.
  They can verify the order and update the status.
 View Customer Orders:
  The distributor can view orders placed by the customer.
  They can assign a Transporter.
 Customer
 Register:
  The customer would require to register first to access the system.
 Login:
  They can log in using their credentials.
 Medicines:
  They can search for any medicines they require and order them.
  They can verify the source of the medicine.
 View Orders:
  They can view the orders.
  They can view the source of the medicine.
5) Project Life Cycle
     The waterfall model is a classical model used in the system
development life cycle to create a system with a linear and sequential
approach. It is termed a waterfall because the model develops
systematically from one phase to another in a downward fashion. The
waterfall approach does not define the process to go back to the
previous phase to handle changes in requirements. The waterfall
approach is the earliest approach that was used for software
development.
  6) System Requirements
   I.          Hardware Requirement
         i.      Laptop or PC
                     Windows 7 or higher
                     I3 processor system or higher
                     4 GB RAM or higher
                     100 GB ROM or higher
   II.         Software Requirement
         ii.     Laptop or PC
                     Visual Studio 2019
                     SQL Server Management Studio latest
7) Limitations/Disadvantages
 The system may have limitations in terms of scalability and
  performance.
8) Application
 Our Pharma Supply Chain System using Smart Contracts can be
  used to automate the process of supply chain management.
9) Reference
  https://www.researchgate.net/publication/
  338366172_A_Novel_Framework_for_Pharmaceutical_Supply_Chain_Man
  agement_using_Distributed_Ledger_and_Smart_Contracts
  https://www.researchgate.net/publication/
  349652647_Automating_Procurement_Contracts_in_the_Healthcare_Suppl
  y_Chain_Using_Blockchain_Smart_Contracts
  https://theblockchaintest.com/uploads/resources/Research%20Paper%20-
  %20Blockchain%20to%20Optimise%20Pharma%20Supply%20Chain%20-
  %202022%20Jan.pdf
  https://www.sciencedirect.com/science/article/pii/S0148296323000048