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, orCompleted. - π 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:
Statusdefines task state:Pending,Ongoing,Completed. - Struct:
TaskincludespatientId,description,status, andcreatedAt. - Mapping:
tasks[address]stores each user's tasks privately. - Functions:
createTask(...)getMyTasks()getTasksByWorker(address)updateTask(...)deleteTask(...)
- Events:
TaskCreatedTaskUpdatedTaskDeleted
π οΈ 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