A FastAPI application to manage patient data. Supports viewing, creating, updating, and sorting patients, with automatic BMI calculation and health verdict. Data is stored in a JSON file (patients.json).
- View all patients
- View a specific patient by ID
- Create a new patient
- Update existing patient information
- Sort patients by height, weight, or BMI
- Automatic BMI and health verdict calculation
# Clone the repository
git clone https://github.com/your-username/patient-management-api.git
cd patient-management-api
# Create a virtual environment
python -m venv venv
# Activate the environment
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate
# Install dependencies
pip install fastapi uvicorn pydantic
#Running the API
uvicorn main:app --reload
#API Endpoints
GET / - Home message
GET /about - About message
GET /view - View all patients
GET /patient/{patient_id} - View a specific patient
POST /create - Create a new patient
PUT /edit/{patient_id} - Update patient details
GET /sort?sort_by=height|weight|bmi&order=asc|desc - Sort patients