This repository contains the source code for an ON CHAIN HEALTH canister on the Internet Computer Protocol (ICP). The canister allows users to manage and query patient details, providing functionality such as adding, updating, deleting, and querying patient records based on various criteria.
The hospital management canister is designed to be a decentralized solution for managing patient information. Each patient is represented by the PatientDetails
struct, which includes fields such as id
, patient_name
, patient_history
, doctor_name
, created_at
, updated_at
, next_appointment
, and in_clinic
. The canister uses a BTreeMap
for efficient storage and retrieval.
Key Features:
- Querying: Retrieve information about specific patients, all patients, patients in the clinic, or perform a search based on a query string.
Before you begin, ensure that you have the following installed:
Clone the repository to your local machine:
git clone https://github.com/RealYash27/ONCHAIN_HealthREC.git
cd ONCHAIN_HealthREC
To automatically set up the project (including canister creation and environment configuration):
chmod +x setup.sh
./setup.sh
This script will handle:
- Installing frontend dependencies
- Creating and deploying the backend canister
- Syncing the environment variables
- Starting the local replica
- Launching the frontend development server
To use the hospital management canister, you can explore the provided query and update functions via the frontend or dfx
commands.
To run backend tests, use the following command:
cargo test
To deploy the canister locally manually:
-
Start the local Internet Computer replica:
dfx start --clean --background
-
Deploy the backend canister:
dfx deploy
-
Use the generated canister ID to interact with the deployed backend.
For advanced deployment (e.g., production or remote), see the DFINITY SDK Documentation.
Feel free to contribute by opening issues or submitting pull requests. Follow the standard GitHub flow for contributing.
This project is licensed under the MIT License – see the LICENSE file for details.