import 'package:hmg_patient_app_new/core/utils/date_util.dart';

class YearBloodPressureResultAverage {
  int? monthSystolicePressureAverageResult;
  int? monthDiastolicPressureAverageResult;
  dynamic monthNumber;
  String? monthName;
  String? yearName;
  DateTime? date;

  YearBloodPressureResultAverage({
    this.monthSystolicePressureAverageResult,
    this.monthDiastolicPressureAverageResult,
    this.monthNumber,
    this.monthName,
    this.yearName,
  });

  YearBloodPressureResultAverage.fromJson(Map<String, dynamic> json) {
    monthSystolicePressureAverageResult = json['monthSystolicePressureAverageResult'];
    monthDiastolicPressureAverageResult = json['monthDiastolicPressureAverageResult'];
    monthNumber = json['monthNumber'];
    monthName = json['monthName'];
    yearName = json['yearName'];
    date = DateUtil.getMonthDateTime(monthName!, yearName);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['monthSystolicePressureAverageResult'] = monthSystolicePressureAverageResult;
    data['monthDiastolicPressureAverageResult'] = monthDiastolicPressureAverageResult;
    data['monthNumber'] = monthNumber;
    data['monthName'] = monthName;
    data['yearName'] = yearName;
    return data;
  }
}
