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

class BloodPressureResult {
  int? patientID;
  int? lineItemNo;
  DateTime? bloodPressureDate;
  int? measuredArm;
  int? systolicePressure;
  int? diastolicPressure;
  dynamic remark;
  bool? isActive;
  int? chartYear;
  String? chartMonth;
  dynamic yearSystolicePressureAverageResult;
  dynamic monthSystolicePressureResult;
  dynamic weekSystolicePressureResult;
  int? yearDiastolicPressureAverageResult;
  dynamic monthDiastolicPressureResult;
  dynamic weekDiastolicPressureResult;
  String? measuredArmDesc;
  dynamic weekDesc;

  BloodPressureResult(
      {this.patientID,
      this.lineItemNo,
      this.bloodPressureDate,
      this.measuredArm,
      this.systolicePressure,
      this.diastolicPressure,
      this.remark,
      this.isActive,
      this.chartYear,
      this.chartMonth,
      this.yearSystolicePressureAverageResult,
      this.monthSystolicePressureResult,
      this.weekSystolicePressureResult,
      this.yearDiastolicPressureAverageResult,
      this.monthDiastolicPressureResult,
      this.weekDiastolicPressureResult,
      this.measuredArmDesc,
      this.weekDesc});

  BloodPressureResult.fromJson(Map<String, dynamic> json) {
    patientID = json['PatientID'];
    lineItemNo = json['LineItemNo'];
    bloodPressureDate = DateUtil.convertStringToDate(json['BloodPressureDate']);
    measuredArm = json['MeasuredArm'];
    systolicePressure = json['SystolicePressure'];
    diastolicPressure = json['DiastolicPressure'];
    remark = json['Remark'];
    isActive = json['IsActive'];
    chartYear = json['ChartYear'];
    chartMonth = json['ChartMonth'];
    yearSystolicePressureAverageResult = json['YearSystolicePressureAverageResult'];
    monthSystolicePressureResult = json['MonthSystolicePressureResult'];
    weekSystolicePressureResult = json['WeekSystolicePressureResult'];
    yearDiastolicPressureAverageResult = json['YearDiastolicPressureAverageResult'];
    monthDiastolicPressureResult = json['MonthDiastolicPressureResult'];
    weekDiastolicPressureResult = json['WeekDiastolicPressureResult'];
    measuredArmDesc = json['MeasuredArmDesc'];
    weekDesc = json['WeekDesc'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['PatientID'] = patientID;
    data['LineItemNo'] = lineItemNo;
    data['BloodPressureDate'] = bloodPressureDate;
    data['MeasuredArm'] = measuredArm;
    data['SystolicePressure'] = systolicePressure;
    data['DiastolicPressure'] = diastolicPressure;
    data['Remark'] = remark;
    data['IsActive'] = isActive;
    data['ChartYear'] = chartYear;
    data['ChartMonth'] = chartMonth;
    data['YearSystolicePressureAverageResult'] = yearSystolicePressureAverageResult;
    data['MonthSystolicePressureResult'] = monthSystolicePressureResult;
    data['WeekSystolicePressureResult'] = weekSystolicePressureResult;
    data['YearDiastolicPressureAverageResult'] = yearDiastolicPressureAverageResult;
    data['MonthDiastolicPressureResult'] = monthDiastolicPressureResult;
    data['WeekDiastolicPressureResult'] = weekDiastolicPressureResult;
    data['MeasuredArmDesc'] = measuredArmDesc;
    data['WeekDesc'] = weekDesc;
    return data;
  }
}

