Skip to content

EMR Blockchain - Electronic Medical Records with Blockchain Integration || Undergraduate Thesis Project (Skripsi S1)

License

Notifications You must be signed in to change notification settings

Frax404NF/BcHealth-EMR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ EMR Blockchain - Electronic Medical Records with Blockchain Integration

Undergraduate Thesis Project (Skripsi S1)
Blockchain-Based Data Integrity System for Electronic Medical Records
Compliance with PMK No. 24/2022 (Indonesian Health Regulation)

License: MIT HKI Registered Solidity Node.js React


πŸ† Intellectual Property Rights

Registered with Direktorat Jenderal Kekayaan Intelektual (DJKI)

  • Type: Program Komputer (Computer Software)
  • Certificate Number: EC002025168178
  • Registration Number: 001008438
  • Title: Implementasi Teknologi Blockchain untuk Pengelolaan Rekam Medis Elektronik Pasien Instalasi Gawat Darurat
  • Registration Date: October 31, 2025
  • Creators: Frandi Andika
  • Copyright Holders: Frandi Andika, Daniel Febrian Sengkey, Alwin M. Sambul.
  • Protection Period: 50 years from first publication
  • Legal Basis: UU No. 28 Tahun 2014 tentang Hak Cipta

This project is officially protected under Indonesian copyright law, demonstrating its innovation and originality in blockchain-based healthcare systems.


πŸ“– Project Overview

A comprehensive Electronic Medical Records (EMR) system that leverages blockchain technology to ensure medical data integrity and immutability. This full-stack application implements a two-tier blockchain architecture where individual clinical data is hashed and stored on the Ethereum blockchain, providing cryptographic verification and tamper-evident audit trails.

🎯 Key Features

  • Full-Stack EMR System: Complete patient management, clinical workflows, and medical documentation
  • Blockchain Integration: Ethereum smart contracts for data integrity verification
  • Two-Tier Architecture:
    • TIER 1: Individual clinical data hashing (vital signs, diagnoses, treatments)
    • TIER 2: Encounter-level finalization for complete visit integrity
  • Multi-Role Access: Admin, Doctor, and Nurse roles with RBAC
  • Healthcare Compliance: Designed according to Indonesian health regulations (PMK No. 24/2022)
  • Edit Audit Trail: Complete version history with hash chaining for legitimate data corrections

πŸ—οΈ System Architecture & Demo

Architecture Overview

System Architecture
Hybrid architecture: React frontend, Node.js/Express backend with PostgreSQL, and Ethereum smart contracts for cryptographic hash verification

EMR Workflow
Two-tier blockchain implementation: TIER 1 hashes individual clinical data, TIER 2 finalizes complete encounter integrity

Application Screenshots

πŸ–₯️ View User Interface & Features (Click to expand)

Doctor Dashboard - Overview & Quick Actions

Doctor Dashboard

Patient Management - Registration & Data

Patient Management

Create New Encounter - Patient Visit Initialization

Create Encounter

Clinical Documentation - Vital Signs, Diagnosis, Treatments

Clinical Documentation

Admin Dashboard - System Monitoring & Blockchain Management

Admin Dashboard

Blockchain Verification - Encounter Finalization & Hash Comparison

Blockchain Verification

Backend Hash Generation - Console Logs Showing Cryptographic Process

Backend Hash Logs


πŸ—οΈ Project Structure

skripsi-code/
β”œβ”€β”€ backend-emr/           # Backend API (Node.js + Express)
β”‚   └── emr-api/          # RESTful API with blockchain integration
β”œβ”€β”€ frontend-emr/          # Frontend Application (React + Vite)
β”œβ”€β”€ blockchain/            # Smart Contracts (Solidity + Hardhat)
└── docs/                  # Documentation and thesis materials

Component Breakdown

Component Technology Stack Purpose
Backend API Node.js, Express.js, Supabase (PostgreSQL) RESTful API, authentication, clinical workflows
Frontend React 18, Vite, Tailwind CSS, Material Tailwind User interface for multi-role access
Blockchain Solidity, Hardhat, Ethers.js, Sepolia Testnet Smart contracts for data integrity
Database PostgreSQL (via Supabase) Patient records, clinical data, audit trails

πŸš€ Quick Start

Prerequisites

  • Node.js v18+ and npm
  • PostgreSQL database (or Supabase account)
  • Ethereum Wallet with Sepolia testnet ETH (for blockchain features)
  • Alchemy/Infura API key (for Ethereum RPC access)

Installation Steps

  1. Clone the repository

    git clone https://github.com/Frax404NF/emr-blockchain-system.git
    cd emr-blockchain-system
  2. Setup Backend API

    cd backend-emr/emr-api
    npm install
    cp .env.example .env
    # Edit .env with your credentials
    npm run dev
  3. Setup Frontend

    cd frontend-emr
    npm install
    cp .env.example .env
    # Edit .env with backend API URL
    npm run dev
  4. Setup Blockchain (Optional for development)

    cd blockchain
    npm install
    cp .env.example .env
    # Edit .env with your wallet private key and Alchemy API key
    
    # For local development
    npx hardhat node
    
    # For Sepolia testnet deployment
    npx hardhat run scripts/deploy-sepolia.js --network sepolia

πŸ“š Documentation

Each component has detailed documentation in its respective directory:


πŸ’» Code Quality

  • Modular Architecture: Clean separation of concerns (MVC pattern)
  • Modern JavaScript: ES6+ with async/await, arrow functions
  • Comprehensive Error Handling: Try/catch blocks with detailed logging
  • Security Best Practices: Environment-based configuration, no exposed credentials
  • Well-Documented: JSDoc comments for critical functions and smart contracts
  • RESTful API Design: Standard HTTP methods and status codes

πŸ” Security Considerations

⚠️ Important Security Notes

  1. Never commit .env files - They contain sensitive credentials
  2. Rotate credentials before going public if previously exposed
  3. Use test networks - This project uses Sepolia testnet, not mainnet
  4. Private keys - Keep blockchain private keys secure; they control wallet funds
  5. No production data - This is a thesis/educational project

Environment Variables

Each component requires environment variables. Copy .env.example to .env and configure:

  • Backend: Database credentials, JWT secret, blockchain RPC URL
  • Frontend: Backend API URL
  • Blockchain: Wallet private key, Alchemy/Infura API key

πŸ§ͺ Testing

Backend Tests

cd backend-emr/emr-api
npm test                    # Run all tests
npm run test:unit          # Unit tests only
npm run test:integration   # Integration tests only

Frontend Tests

cd frontend-emr
npm test                    # Run tests
npm run test:coverage      # With coverage report

Smart Contract Tests

cd blockchain
npx hardhat test           # Run all contract tests
npx hardhat coverage       # Coverage report

πŸŽ“ Academic Context

Thesis Information

  • Title: Blockchain-Based Data Integrity System for Electronic Medical Records
  • Focus: Healthcare data security using cryptographic hashing and smart contracts
  • Compliance: Indonesian Health Ministry Regulation (PMK No. 24/2022)
  • Innovation: Two-tier blockchain architecture for clinical data verification

Research Contributions

  1. Two-tier blockchain architecture for granular data integrity
  2. Edit audit trail system with hash chaining for legitimate corrections
  3. Healthcare regulation compliance mapping to technical implementation
  4. Performance optimization for clinical workflows with blockchain overhead

πŸ“Š Key Technologies

Backend

  • Node.js 18.x, Express.js 4.x
  • Supabase (PostgreSQL)
  • JWT Authentication, Joi Validation
  • Ethers.js for blockchain interaction

Frontend

  • React 18, Vite, React Router v7
  • Tailwind CSS, Material Tailwind
  • Axios, React Context API
  • Hot Toast for notifications

Blockchain

  • Solidity ^0.8.28
  • Hardhat development environment
  • Ethereum Sepolia Testnet
  • Alchemy RPC provider

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright Protection: This software is registered with DJKI Indonesia (EC002025168178) and protected under UU No. 28 Tahun 2014 tentang Hak Cipta for 50 years from publication.


Related Resources


⚠️ Disclaimer

This is an educational/research project developed as part of an undergraduate thesis. It is NOT intended for production use with real patient data. The system demonstrates concepts of blockchain integration with healthcare systems but would require additional security audits, compliance certifications, and regulatory approvals for real-world deployment.


🀝 Contributing

This is an academic project, but suggestions and feedback are welcome! Please note this is primarily for thesis/portfolio purposes.

Why This Project is Public

This repository is made public for several important reasons:

  1. πŸ“š Educational Resource: To serve as a learning reference for students and developers interested in blockchain integration with healthcare systems
  2. Knowledge Sharing: Contributing to the Indonesian tech community by sharing implementation patterns and solutions
  3. Peer Review: Inviting constructive feedback, suggestions, and code reviews from the developer community
  4. Collaboration Opportunity: Open to discussions, improvements, and potential collaborations on blockchain healthcare solutions
  5. Academic Transparency: Demonstrating real-world application of blockchain technology in compliance with healthcare regulations
  6. Portfolio Showcase: Highlighting capabilities in full-stack development, blockchain integration, and system architecture

We believe in open-source education and collaborative learning. If you find this project helpful, have suggestions for improvements, or spot any issues, please feel free to:

  • Open an issue for bugs or suggestions
  • Submit a pull request for improvements
  • Star the repository if you find it valuable
  • Share with others who might benefit from it

Note: While feedback is welcome, please remember this is a thesis project completed in 2025 and represents work done within academic constraints and timelines.


πŸ‘€ Author

Frandi Andika (Frax404NF)
Undergraduate Computer Science Student
Universitas Sam Ratulangi

Supervisors: Ir. Daniel F. Sengkey, ST, M.Eng., Ir. Alwin M. Sambul, ST, M.Eng, Ph.D.

Contact: GitHub | LinkedIn


Last Updated: December 2025
Status: Thesis Project - Educational Use Only

About

EMR Blockchain - Electronic Medical Records with Blockchain Integration || Undergraduate Thesis Project (Skripsi S1)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published