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

class DiabeticPatientResult {
  String? chartMonth;
  var chartYear;
  DateTime? dateChart;
  var description;
  var descriptionN;
  int? diabtecAvarage;
  bool? isActive;
  int? lineItemNo;
  var listMonth;
  var listWeek;
  int? measured;
  String? measuredDesc;
  var monthAverageResult;
  int? patientID;
  var remark;
  var resultDesc;
  dynamic resultValue;
  String? unit;
  var weekAverageResult;
  String? weekDesc;
  var yearAverageResult;

  DiabeticPatientResult(
      {this.chartMonth,
      this.chartYear,
      this.dateChart,
      this.description,
      this.descriptionN,
      this.diabtecAvarage,
      this.isActive,
      this.lineItemNo,
      this.listMonth,
      this.listWeek,
      this.measured,
      this.measuredDesc,
      this.monthAverageResult,
      this.patientID,
      this.remark,
      this.resultDesc,
      this.resultValue,
      this.unit,
      this.weekAverageResult,
      this.weekDesc,
      this.yearAverageResult});

  DiabeticPatientResult.fromJson(Map<String, dynamic> json) {
    chartMonth = json['ChartMonth'];
    chartYear = json['ChartYear'];
    dateChart = DateUtil.convertStringToDate(json['DateChart']);
    description = json['Description'];
    descriptionN = json['DescriptionN'];
    diabtecAvarage = json['DiabtecAvarage'];
    isActive = json['IsActive'];
    lineItemNo = json['LineItemNo'];
    listMonth = json['List_Month'];
    listWeek = json['List_Week'];
    measured = json['Measured'];
    measuredDesc = json['MeasuredDesc'];
    monthAverageResult = json['MonthAverageResult'];
    patientID = json['PatientID'];
    remark = json['Remark'];
    resultDesc = json['ResultDesc'];
    resultValue = json['ResultValue'];
    unit = json['Unit'];
    weekAverageResult = json['WeekAverageResult'];
    weekDesc = json['WeekDesc'];
    yearAverageResult = json['YearAverageResult'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['ChartMonth'] = chartMonth;
    data['ChartYear'] = chartYear;
    data['DateChart'] = DateUtil.convertDateToString(dateChart!);
    data['Description'] = description;
    data['DescriptionN'] = descriptionN;
    data['DiabtecAvarage'] = diabtecAvarage;
    data['IsActive'] = isActive;
    data['LineItemNo'] = lineItemNo;
    data['List_Month'] = listMonth;
    data['List_Week'] = listWeek;
    data['Measured'] = measured;
    data['MeasuredDesc'] = measuredDesc;
    data['MonthAverageResult'] = monthAverageResult;
    data['PatientID'] = patientID;
    data['Remark'] = remark;
    data['ResultDesc'] = resultDesc;
    data['ResultValue'] = resultValue;
    data['Unit'] = unit;
    data['WeekAverageResult'] = weekAverageResult;
    data['WeekDesc'] = weekDesc;
    data['YearAverageResult'] = yearAverageResult;
    return data;
  }
}

