class AllergiesListVidaPlus {
  int? allergyID;
  String? allergyName;
  List<AllergyReactionDTOs>? allergyReactionDTOs;
  int? allergyRevisionID;
  String? allergyTypeCode;
  int? allergyTypeID;
  String? allergyTypeName;
  int? hospitalGroupID;
  int? hospitalID;
  bool? isActive;
  bool? isSnowMedAllergy;
  String? snowMedCode;
  String? remark;
  AllergiesListVidaPlus(
      {this.allergyID,
        this.allergyName,
        this.allergyReactionDTOs,
        this.allergyRevisionID,
        this.allergyTypeCode,
        this.allergyTypeID,
        this.allergyTypeName,
        this.hospitalGroupID,
        this.hospitalID,
        this.isActive,
        this.isSnowMedAllergy,
        this.snowMedCode,
        this.remark
      });

  AllergiesListVidaPlus.fromJson(Map<String, dynamic> json) {
    allergyID = json['allergyID'];
    allergyName = json['allergyName'];
    if (json['allergyReactionDTOs'] != null) {
      allergyReactionDTOs = <AllergyReactionDTOs>[];
      json['allergyReactionDTOs'].forEach((v) {
        allergyReactionDTOs!.add(new AllergyReactionDTOs.fromJson(v));
      });
    }
    allergyRevisionID = json['allergyRevisionID'];
    allergyTypeCode = json['allergyTypeCode'];
    allergyTypeID = json['allergyTypeID'];
    allergyTypeName = json['allergyTypeName'];
    hospitalGroupID = json['hospitalGroupID'];
    hospitalID = json['hospitalID'];
    isActive = json['isActive'];
    isSnowMedAllergy = json['isSnowMedAllergy'];
    snowMedCode = json['snowMedCode'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['allergyID'] = this.allergyID;
    data['allergyName'] = this.allergyName;
    if (this.allergyReactionDTOs != null) {
      data['allergyReactionDTOs'] =
          this.allergyReactionDTOs!.map((v) => v.toJson()).toList();
    }
    data['allergyRevisionID'] = this.allergyRevisionID;
    data['allergyTypeCode'] = this.allergyTypeCode;
    data['allergyTypeID'] = this.allergyTypeID;
    data['allergyTypeName'] = this.allergyTypeName;
    data['hospitalGroupID'] = this.hospitalGroupID;
    data['hospitalID'] = this.hospitalID;
    data['isActive'] = this.isActive;
    data['isSnowMedAllergy'] = this.isSnowMedAllergy;
    data['snowMedCode'] = this.snowMedCode;
    return data;
  }
}

class AllergyReactionDTOs {
  int? allergyReactionID;
  String? allergyReactionName;
  int? allergyReactionRevisionID;
  dynamic? hospitalGroupID;
  int? hospitalID;
  bool? isActive;
  bool? isSelected =false;
  int? dbCRUDOperation =1;
  int? pomrid;
  int? patientID;
  int? allergyReactionMappingID = 0;
  int? severity =1;
  AllergyReactionDTOs(
      {this.allergyReactionID,
        this.allergyReactionName,
        this.allergyReactionRevisionID,
        this.hospitalGroupID,
        this.hospitalID,
        this.isActive,
        this.isSelected,
        this.dbCRUDOperation,
        this.pomrid,
        this.patientID,
        this.allergyReactionMappingID,
        this.severity =1
      });

  AllergyReactionDTOs.fromJson(Map<String, dynamic> json) {
    allergyReactionID = json['allergyReactionID'];
    allergyReactionName = json['allergyReactionName'];
    allergyReactionRevisionID = json['allergyReactionRevisionID'];
    hospitalGroupID = json['hospitalGroupID'];
    hospitalID = json['hospitalID'];
    isActive = json['isActive'];
   dbCRUDOperation = json["DbCRUDOperation"];
    pomrid = json['pomrid'];
    patientID =  json['patientID'];
    allergyReactionMappingID = json['allergyReactionMappingID'];
    severity = json['severity'];

  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['allergyReactionID'] = this.allergyReactionID;
    data['allergyReactionName'] = this.allergyReactionName;
    data['allergyReactionRevisionID'] = this.allergyReactionRevisionID;
    data['hospitalGroupID'] = this.hospitalGroupID;
    data['hospitalID'] = this.hospitalID;
    data['isActive'] = this.isActive;
    data["DbCRUDOperation"] = this.dbCRUDOperation;
    data['pomrid'] = this.pomrid;
    data['patientID'] = patientID;
    data['allergyReactionMappingID'] = this.allergyReactionMappingID;
    data['severity'] = this.severity;
    return data;
  }
}
