import 'package:hmg_patient_app/uitl/date_uitl.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 = new Map<String, dynamic>();
    data['PatientID'] = this.patientID;
    data['LineItemNo'] = this.lineItemNo;
    data['BloodPressureDate'] = this.bloodPressureDate;
    data['MeasuredArm'] = this.measuredArm;
    data['SystolicePressure'] = this.systolicePressure;
    data['DiastolicPressure'] = this.diastolicPressure;
    data['Remark'] = this.remark;
    data['IsActive'] = this.isActive;
    data['ChartYear'] = this.chartYear;
    data['ChartMonth'] = this.chartMonth;
    data['YearSystolicePressureAverageResult'] =
        this.yearSystolicePressureAverageResult;
    data['MonthSystolicePressureResult'] = this.monthSystolicePressureResult;
    data['WeekSystolicePressureResult'] = this.weekSystolicePressureResult;
    data['YearDiastolicPressureAverageResult'] =
        this.yearDiastolicPressureAverageResult;
    data['MonthDiastolicPressureResult'] = this.monthDiastolicPressureResult;
    data['WeekDiastolicPressureResult'] = this.weekDiastolicPressureResult;
    data['MeasuredArmDesc'] = this.measuredArmDesc;
    data['WeekDesc'] = this.weekDesc;
    return data;
  }
}
