from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List, Optional
from pydantic import BaseModel, Field
from app.services.patients_service import PatientService
router = APIRouter(prefix="/patients", tags=["Patients"])
class PatientCreate(BaseModel):
name: str = Field(..., example="John Doe")
age: int = Field(..., example=35)
medical_history: Optional[str] = Field("None")
class PatientResponse(BaseModel):
id: int
name: str
age: int
status: str
@router.post("/", response_model=PatientResponse, status_code=status.HTTP_201_CREATED)
def create_patient(item_in: PatientCreate):
return PatientService.create(item_in)
@router.get("/", response_model=List[PatientResponse])
def list_patients():
return PatientService.list_all() Multi-Agent Pipeline (Phase 1)
Presets:
Planner Agent
Decomposed prompt into 5 modules: Auth, Patients, Doctors, Billing, Reports.
Context Agent (Mocked)
Loaded static JSON metadata: 4 tables, 2 PII fields.
Impact Analysis Agent
Risk Score: MEDIUM. 2 APIs & 1 Dashboard affected.
Backend Generator Agent
Wrote FastAPI models, routers, alembic & Dockerfile to disk.
Frontend Generator Agent
Wrote Next.js TSX list & form page stubs to disk.