49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
"""Overview Schema定义"""
|
|
import uuid
|
|
from datetime import date
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CenterOverview(BaseModel):
|
|
"""单个中心的概览数据"""
|
|
center_id: str
|
|
center_name: str
|
|
|
|
# 各阶段状态
|
|
institution_initiation_status: str = "NOT_STARTED"
|
|
ethics_status: str = "NOT_STARTED"
|
|
contract_sign_status: str = "NOT_STARTED"
|
|
startup_status: str = "NOT_STARTED"
|
|
enrollment_status: str = "NOT_STARTED"
|
|
inspection_status: str = "NOT_STARTED"
|
|
closeout_status: str = "NOT_STARTED"
|
|
|
|
# 各阶段完成日期
|
|
institution_initiation_completed_at: Optional[str] = None
|
|
ethics_completed_at: Optional[str] = None
|
|
contract_sign_completed_at: Optional[str] = None
|
|
startup_completed_at: Optional[str] = None
|
|
enrollment_completed_at: Optional[str] = None
|
|
inspection_completed_at: Optional[str] = None
|
|
closeout_completed_at: Optional[str] = None
|
|
|
|
# 入组数据
|
|
enrollment_target: int = 0
|
|
enrollment_actual: int = 0
|
|
|
|
|
|
class EnrollmentByMonth(BaseModel):
|
|
"""月度入组统计"""
|
|
month: str
|
|
count: int
|
|
|
|
|
|
class ProjectOverviewResponse(BaseModel):
|
|
"""项目概览响应"""
|
|
study_id: str
|
|
updated_at: str
|
|
centers: List[CenterOverview]
|
|
enrollment_by_month: List[EnrollmentByMonth]
|