/// 血压测量数据模型 class BpReading { final int systolic; final int diastolic; final int? pulse; final DateTime timestamp; final String? userId; final bool isKpa; final bool hasBodyMovement; final bool hasIrregularPulse; final bool hasDeviceTimestamp; const BpReading({ required this.systolic, required this.diastolic, this.pulse, required this.timestamp, this.userId, this.isKpa = false, this.hasBodyMovement = false, this.hasIrregularPulse = false, this.hasDeviceTimestamp = false, }); String get display => '$systolic/$diastolic'; Map toHealthRecord() => { 'type': 'BloodPressure', 'systolic': systolic, 'diastolic': diastolic, 'source': 'DeviceSync', 'unit': 'mmHg', 'recordedAt': timestamp.toUtc().toIso8601String(), }; Map? toHeartRateRecord() { final value = pulse; if (value == null || value <= 0) return null; return { 'type': 'HeartRate', 'value': value, 'source': 'DeviceSync', 'unit': 'bpm', 'recordedAt': timestamp.toUtc().toIso8601String(), }; } }