http://localhost:8000/api/v1
Currently using development mode. In production, implement JWT tokens.
GET /beds?department={dept}Query Parameters:
department(optional): Filter by department (ER, ICU, General, Pediatric)
Response:
{
"ER": {
"total": 50,
"available": 12,
"occupied": 38
},
"ICU": {
"total": 40,
"available": 5,
"occupied": 35
}
}GET /staff?shift={shift}Query Parameters:
shift(optional): Filter by shift (morning, evening, night)
Response:
{
"total": 120,
"available": 45,
"on_duty": 75,
"avg_fatigue": 42.5
}GET /inventory?critical_only={bool}Query Parameters:
critical_only(optional): Show only items below threshold (default: false)
Response:
[
{
"item": "Oxygen Cylinders",
"current": 45,
"threshold": 50,
"status": "critical"
}
]GET /predictions/latestResponse:
{
"id": "uuid",
"prediction_time": "2024-11-26T10:30:00",
"surge_likelihood": "high",
"confidence_score": 85,
"departments_affected": ["ER", "Respiratory"],
"time_horizon": "24h",
"contributing_factors": {
"aqi": 380,
"weather": "extreme_heat",
"events": ["Diwali"]
}
}GET /predictions/history?limit={n}Query Parameters:
limit(optional): Number of predictions to return (default: 10)
Response:
[
{
"id": "uuid",
"prediction_time": "2024-11-26T10:30:00",
"surge_likelihood": "high",
"confidence_score": 85
}
]GET /recommendations?status={status}Query Parameters:
status(optional): Filter by status (pending, approved, rejected)
Response:
[
{
"id": "uuid",
"type": "staff_reallocation",
"title": "Reallocate 5 nurses to ER",
"description": "Move nurses from General ward to handle surge",
"priority": "high",
"estimated_cost": -15000,
"status": "pending",
"reasoning": "ER at 24% capacity, predicted 45% surge in 24h",
"created_at": "2024-11-26T10:30:00"
}
]POST /recommendations/{id}/approveResponse:
{
"message": "Recommendation approved",
"recommendation": {
"id": "uuid",
"status": "approved",
"executed_at": "2024-11-26T10:35:00"
}
}POST /recommendations/{id}/rejectRequest Body:
{
"reason": "Manual override - insufficient staff available"
}Response:
{
"message": "Recommendation rejected"
}GET /analytics/cost-savingsResponse:
{
"total_savings": 65000,
"total_costs": 20000,
"net_savings": 45000,
"roi_percentage": 225,
"recommendations_count": 12
}POST /simulation/trigger-crisisRequest Body:
{
"crisis_type": "pollution"
}Available Crisis Types:
pollution- Diwali pollution surgedengue- Monsoon dengue outbreaktrauma- Weekend trauma surgeheatwave- Heat wave emergency
Response:
{
"message": "Crisis simulation 'pollution' triggered",
"scenario": {
"name": "Diwali Pollution Surge",
"duration": "48 hours",
"severity": "high"
}
}POST /agent/runResponse:
{
"message": "Agent workflow started",
"status": "processing"
}ws://localhost:8000/ws
Message Format:
{
"type": "agent_update",
"surge_prediction": {...},
"recommendations": [...],
"messages": ["[Sentinel] Surge detected"],
"timestamp": "2024-11-26T10:30:00"
}{
"detail": "Resource not found"
}{
"detail": "Internal server error message"
}- Development: No rate limits
- Production: 100 requests/minute per IP
Interactive documentation available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc