import 'package:hmg_patient_app/uitl/date_uitl.dart';

class WeightMeasurementResult {
  int? patientID;
  int? lineItemNo;
  int? weightMeasured;
  DateTime? weightDate;
  dynamic remark;
  bool? isActive;
  int? measured;
  dynamic unit;
  int? chartYear;
  dynamic chartMonth;
  double? yearAverageResult;
  dynamic monthAverageResult;
  dynamic weekAverageResult;
  dynamic weekDesc;

  WeightMeasurementResult(
      {this.patientID,
        this.lineItemNo,
        this.weightMeasured,
        this.weightDate,
        this.remark,
        this.isActive,
        this.measured,
        this.unit,
        this.chartYear,
        this.chartMonth,
        this.yearAverageResult,
        this.monthAverageResult,
        this.weekAverageResult,
        this.weekDesc});

  WeightMeasurementResult.fromJson(Map<String, dynamic> json) {
    try {
      patientID = json['PatientID'];
      lineItemNo = json['LineItemNo'];
      weightMeasured = json['WeightMeasured'];
      weightDate = DateUtil.convertStringToDate(json['WeightDate']);
      remark = json['Remark'];
      isActive = json['IsActive'];
      measured = json['Measured'];
      unit = json['Unit'];
      chartYear = json['ChartYear'];
      chartMonth = json['ChartMonth'];
      yearAverageResult = json['YearAverageResult'];
      monthAverageResult = json['MonthAverageResult'];
      weekAverageResult = json['WeekAverageResult'];
      weekDesc = json['WeekDesc'];
    } catch (e) {
      print(e);
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['PatientID'] = this.patientID;
    data['LineItemNo'] = this.lineItemNo;
    data['WeightMeasured'] = this.weightMeasured;
    data['WeightDate'] = this.weightDate;
    data['Remark'] = this.remark;
    data['IsActive'] = this.isActive;
    data['Measured'] = this.measured;
    data['Unit'] = this.unit;
    data['ChartYear'] = this.chartYear;
    data['ChartMonth'] = this.chartMonth;
    data['YearAverageResult'] = this.yearAverageResult;
    data['MonthAverageResult'] = this.monthAverageResult;
    data['WeekAverageResult'] = this.weekAverageResult;
    data['WeekDesc'] = this.weekDesc;
    return data;
  }
}
