/// 血压测量数据模型
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;

  const BpReading({
    required this.systolic,
    required this.diastolic,
    this.pulse,
    required this.timestamp,
    this.userId,
    this.isKpa = false,
    this.hasBodyMovement = false,
    this.hasIrregularPulse = false,
  });

  String get display => '$systolic/$diastolic';

  Map<String, dynamic> toHealthRecord() => {
    'type': 'BloodPressure',
    'systolic': systolic,
    'diastolic': diastolic,
    'source': 'DeviceSync',
    'unit': 'mmHg',
    'recordedAt': timestamp.toUtc().toIso8601String(),
  };
}
