/// 血压检查数据
class NibpExamData extends NibpExamValue {
  /// 实时压力值
  ///
  /// 单位 `mmHg`
  final int pressure;

  /// 是否检测到脉率
  ///
  /// `0` / `1`
  final int pulseStatus;

  NibpExamData({
    required this.pressure,
    required this.pulseStatus,
    required super.systolicPressure,
    required super.diastolicPressure,
    required super.pulse,
  });

  factory NibpExamData.fromEventData(Map<String, dynamic> jsonMap) {
    return NibpExamData(
      pressure: jsonMap["PRESSURE"],
      systolicPressure: jsonMap["SSY"],
      diastolicPressure: jsonMap["SZY"],
      pulse: jsonMap["PULSE"],
      pulseStatus: jsonMap["PULSE_STATUS"],
    );
  }
}

/// 血压检查值
class NibpExamValue {
  /// 收缩压
  ///
  /// 单位 `mmHg`
  final int systolicPressure;

  /// 舒张压
  ///
  /// 单位 `mmHg`
  final int diastolicPressure;

  /// 脉率
  ///
  /// 单位 `bpm`
  final int pulse;

  NibpExamValue({
    required this.systolicPressure,
    required this.diastolicPressure,
    required this.pulse,
  });

  factory NibpExamValue.fromEventData(Map<String, dynamic> jsonMap) {
    return NibpExamValue(
      systolicPressure: jsonMap["SSY"],
      diastolicPressure: jsonMap["SZY"],
      pulse: jsonMap["PULSE"],
    );
  }
}
