File size: 2,558 Bytes
793e953
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
 * Mock 数据专用类型
 *
 * 这些类型仅用于模拟数据和 UI 组件内部的临时状态,
 * 与后端 API 的类型(api/index.ts)是独立的体系。
 */

// ===== 基础类型 =====

/** 动物种类 */
export type Species = '犬' | '猫' | '其他'

/** 性别 */
export type Gender = '公' | '母' | '未知'

/** 处理步骤 */
export type ProcessStep = 'transcribing' | 'extracting' | 'generating'

// ===== 动物基本信息 =====

export interface PatientInfo {
  species: Species
  breed: string
  age: string
  gender: Gender
  weight: string
  ownerName: string
}

// ===== 对话行 =====

export type SpeakerRole = '兽医' | '宠主'

export interface DialogueLine {
  id: string
  speaker: SpeakerRole
  text: string
  timestamp: string // 格式: HH:MM:SS
}

// ===== SOAP 病历(模拟数据结构) =====

export interface ObjectiveData {
  temperature: string   // 体温 °C
  heartRate: string     // 心率 次/分
  respiration: string   // 呼吸 次/分
  weight: string        // 体重 kg
  crt: string           // 毛细血管再充盈时间 秒
  mucousMembrane: string // 黏膜颜色
  hydration: string     // 水合状态
}

export interface PlanData {
  examinations: string[]  // 检查项目
  medication: string      // 用药方案
  notes: string           // 备注
}

export interface SOAPData {
  subjective: string      // S - 主观资料
  objective: ObjectiveData // O - 客观资料
  assessment: string      // A - 评估
  plan: PlanData          // P - 计划
}

// ===== 置信度标记 =====

export interface ConfidenceMark {
  text: string
  confidence: 'high' | 'medium' | 'low'
}

// ===== 完整病历 =====

export interface MedicalRecord {
  id: string
  patientInfo: PatientInfo
  dialogue: DialogueLine[]
  soap: SOAPData
  confidenceMarks: ConfidenceMark[]  // 低置信度标记
  status: string                     // 使用 string 兼容 mock 数据
  diagnosisSummary: string           // 诊断摘要
  createdAt: string                  // ISO date
  updatedAt: string
  recordingDuration: number          // 秒
}

// ===== 仪表盘统计 =====

export interface DashboardStats {
  todayRecords: number
  todayRecordingDuration: number     // 秒
}

// ===== 问诊录音页内部状态 =====

export interface ConsultationState {
  phase: string           // ConsultationPhase
  patientInfo: PatientInfo
  dialogue: DialogueLine[]
  elapsedSeconds: number
  isPaused: boolean
  processStep: ProcessStep | null
  processProgress: number            // 0-100
}