Skip to content

A Solidity smart contract designed for healthcare sector to manage and track patient-related tasks securely on the blockchain. It allows individual health workers to create, view, update, and delete medical tasks linked to patient IDs, ensuring accountability and data integrity. Developed as part of my blockchain developer cohort Assignment.

Notifications You must be signed in to change notification settings

otsimaofficial/MedTasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ MedTasks – Decentralized Health Task Manager

MedTasks is a Solidity smart contract built for the healthcare industry to manage and track patient-related tasks on the blockchain. It enables healthcare workers to securely create, view, update, and delete medical follow-up tasks linked to specific patient IDs, promoting accountability, transparency, and data integrity in clinical workflows.


πŸ”§ Features

  • βœ… Task Creation: Add follow-up tasks tied to a patient's unique ID.
  • πŸ“‹ Task Management: View, update, or delete only your own tasks.
  • ⏳ Status Tracking: Tasks can be Pending, Ongoing, or Completed.
  • πŸ•’ Timestamps: Each task records when it was created.
  • πŸ” Access Control: Only the creator of a task can modify or delete it.
  • πŸ“‘ Events: Emits events on creation, update, and deletion for frontend or audit integration.

🧱 Smart Contract Structure

  • Enum: Status defines task state: Pending, Ongoing, Completed.
  • Struct: Task includes patientId, description, status, and createdAt.
  • Mapping: tasks[address] stores each user's tasks privately.
  • Functions:
    • createTask(...)
    • getMyTasks()
    • getTasksByWorker(address)
    • updateTask(...)
    • deleteTask(...)
  • Events:
    • TaskCreated
    • TaskUpdated
    • TaskDeleted

πŸ› οΈ Getting Started

Prerequisites

  • Foundry
  • Node.js (for frontend integration, optional)
  • MetaMask / Ethereum wallet for deployment

Compile Contract

forge build

Run Tests
forge test

πŸ“ Project Structure
MedTasks/
β”œβ”€β”€ src/
β”‚   └── MedTasks.sol       # Solidity smart contract
β”œβ”€β”€ test/
β”‚   └── MedTasks.t.sol     # Foundry unit tests
β”œβ”€β”€ script/                # Optional deployment scripts
└── README.md              # Project documentation

🌐 Use Cases
-Hospital systems wanting decentralized task tracking
-Medical teams managing patient care collaboratively
-Auditable patient workflows for clinical follow-ups
-Web3 health dApps needing backend task infrastructure

πŸ§ͺ Testing
All core functions are covered using Foundry's fast and gas-efficient test framework. See test/MedTasks.t.sol.

πŸ“„ License
This project is licensed under the MIT License.

🀝 Contributing
Have ideas to improve MedTasks? Open an issue or submit a PR!
Let's build decentralized healthcare solutions together. πŸ’™

πŸ“ Author
Emmanuel Otsima Ogbu  (https://github.com/otsimaofficial)
For collaboration or frontend integration, feel free to reach out!
Blockchain Developer Cohort – 2025

About

A Solidity smart contract designed for healthcare sector to manage and track patient-related tasks securely on the blockchain. It allows individual health workers to create, view, update, and delete medical tasks linked to patient IDs, ensuring accountability and data integrity. Developed as part of my blockchain developer cohort Assignment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published