Files
CA/backend/routers
Akiba So f58f2f612c feat: add demographics & seasonality endpoints
Context: Cases API lacked demographic breakdowns and per-diagnosis
monthly seasonality data for epidemiological analysis.

Approach:
- Two new GET endpoints with typed Pydantic response models
- Demographics uses get_inpatient_data() (outpatient lacks gender/age)
- Disease-seasonality uses get_combined_data() grouped by diagnosis+month
- pandas groupby/value_counts for vectorized aggregation

Changes:
- Models: AgeBin, GenderSplit, GenderSplitData,
  AgeDiagnosisMatrixItem, DemographicsResponse
- Models: DiseaseSeasonalityPoint, DiseaseSeasonalityResponse
- GET /api/cases/demographics: age distribution (0-17), gender split,
  age-diagnosis matrix (5 age groups)
- GET /api/cases/disease-seasonality: top 10 diagnoses by month
  (120 entries with 1月-12月 labels)

Impact: Enables frontend demographic charts and disease seasonality
heatmaps. All 42 existing API tests continue passing.
2026-06-15 04:30:28 +08:00
..