📋 Overview
This API provides endpoints for managing thalassemia patient records, appointments, blood transfusions, and medical reports. All endpoints return JSON responses.
👤 Patient Management
Get All Patients
GET/api/patients
Retrieve a list of all registered patients
Query Parameters:
- page (number) - Page number for pagination
- limit (number) - Number of records per page
Get Patient by ID
GET/api/patients/:id
Retrieve detailed information about a specific patient
Create New Patient
POST/api/patients
Register a new patient in the system
Body Parameters:
- name (string) - Patient full name
- age (number) - Patient age
- gender (string) - Male/Female/Other
- bloodType (string) - Blood type (A+, B+, O-, etc.)
- thalassemiaType (string) - Major/Minor/Intermedia
- contact (string) - Phone number
- email (string) - Email address
Update Patient
PUT/api/patients/:id
Update patient information
Delete Patient
DELETE/api/patients/:id
Remove a patient from the system
💉 Blood Transfusion Records
Get Transfusion History
GET/api/transfusions/:patientId
Get all transfusion records for a patient
Add Transfusion Record
POST/api/transfusions
Record a new blood transfusion
Body Parameters:
- patientId (string) - Patient ID
- date (date) - Transfusion date
- bloodUnits (number) - Number of units
- hemoglobinBefore (number) - Hb level before
- hemoglobinAfter (number) - Hb level after
- reactions (string) - Any adverse reactions
📅 Appointments
Get Appointments
GET/api/appointments
Get all upcoming appointments
Schedule Appointment
POST/api/appointments
Schedule a new appointment
Body Parameters:
- patientId (string) - Patient ID
- date (date) - Appointment date
- time (string) - Appointment time
- type (string) - Transfusion/Checkup/Consultation
- doctor (string) - Doctor name
📊 Medical Reports
Get Patient Reports
GET/api/reports/:patientId
Get all medical reports for a patient
Upload Report
POST/api/reports
Upload a new medical report
Body Parameters:
- patientId (string) - Patient ID
- reportType (string) - CBC/Ferritin/Echo/MRI
- date (date) - Report date
- results (object) - Test results
- file (file) - Report document
🔐 Authentication
User Login
POST/api/auth/login
Authenticate user and get token
Body Parameters:
- email (string) - User email
- password (string) - User password
User Registration
POST/api/auth/register
Register a new user account