import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';

class MySelectedAllergy {
  MasterKeyModel selectedAllergySeverity;
  MasterKeyModel selectedAllergy;
  String remark;
  bool isChecked;
  bool isExpanded;
  int createdBy;

  MySelectedAllergy(
      {this.selectedAllergySeverity,
      this.selectedAllergy,
      this.remark,
      this.isChecked,
        this.isExpanded = true,
      this.createdBy});

  MySelectedAllergy.fromJson(Map<String, dynamic> json) {
    selectedAllergySeverity = json['selectedAllergySeverity'] != null
        ? new MasterKeyModel.fromJson(json['selectedAllergySeverity'])
        : null;
    selectedAllergy = json['selectedAllergy'] != null
        ? new MasterKeyModel.fromJson(json['selectedAllergy'])
        : null;
    remark = json['remark'];
    isChecked = json['isChecked'];
    isExpanded = json['isExpanded'];
    createdBy = json['createdBy'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.selectedAllergySeverity != null) {
      data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson();
    }
    if (this.selectedAllergy != null) {
      data['selectedAllergy'] = this.selectedAllergy.toJson();
    }
    data['remark'] = this.remark;
    data['isChecked'] = this.isChecked;
    data['isExpanded'] = this.isExpanded;
    data['createdBy'] = this.createdBy;
    return data;
  }
}
