/// 血氧检查数据
class SpO2ExamData extends SpO2ExamValue {
  /// 血氧波点集合
  final List<int> points;

  SpO2ExamData({
    required this.points,
    required super.spO2,
    required super.pulse,
  });

  factory SpO2ExamData.fromEventData(Map<String, dynamic> jsonMap) {
    final pointList = (jsonMap["POINT"] as List).map((e) => e as int).toList();
    return SpO2ExamData(
      spO2: jsonMap["SPO2"],
      pulse: jsonMap["PULSE"],
      points: pointList,
    );
  }
}

/// 血氧检查值
class SpO2ExamValue {
  /// 血氧饱和度
  ///
  /// 单位 `%`
  final int spO2;

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

  SpO2ExamValue({
    required this.spO2,
    required this.pulse,
  });

  factory SpO2ExamValue.fromEventData(Map<String, dynamic> jsonMap) {
    return SpO2ExamValue(
      spO2: jsonMap["SPO2"],
      pulse: jsonMap["PULSE"],
    );
  }
}
