class PatientAllergiesVidaPlus {
  int? allergyID;
  String? allergyName;
  int? allergyTypeID;
  String? allergyTypeName;
  int? hospitalGroupID;
  int? hospitalID;
  bool? isActivePatientsAllergy;
  int? patientID;
  List<PatientsAllergyReactionsDTOs>? patientsAllergyReactionsDTOs;
  int? patientsAllergyRevisionID;
  int? pomrID;
  String? remark;

  PatientAllergiesVidaPlus(
      {this.allergyID,
        this.allergyName,
        this.allergyTypeID,
        this.allergyTypeName,
        this.hospitalGroupID,
        this.hospitalID,
        this.isActivePatientsAllergy,
        this.patientID,
        this.patientsAllergyReactionsDTOs,
        this.patientsAllergyRevisionID,
        this.pomrID,
        this.remark});

  PatientAllergiesVidaPlus.fromJson(Map<String, dynamic> json) {
    allergyID = json['allergyID'];
    allergyName = json['allergyName'];
    allergyTypeID = json['allergyTypeID'];
    allergyTypeName = json['allergyTypeName'];
    hospitalGroupID = json['hospitalGroupID'];
    hospitalID = json['hospitalID'];
    isActivePatientsAllergy = json['isActivePatientsAllergy'];
    patientID = json['patientID'];
    if (json['patientsAllergyReactionsDTOs'] != null) {
      patientsAllergyReactionsDTOs = <PatientsAllergyReactionsDTOs>[];
      json['patientsAllergyReactionsDTOs'].forEach((v) {
        patientsAllergyReactionsDTOs!
            .add(new PatientsAllergyReactionsDTOs.fromJson(v));
      });
    }
    patientsAllergyRevisionID = json['patientsAllergyRevisionID'];
    pomrID = json['pomrID'];
    remark = json['remark'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['allergyID'] = this.allergyID;
    data['allergyName'] = this.allergyName;
    data['allergyTypeID'] = this.allergyTypeID;
    data['allergyTypeName'] = this.allergyTypeName;
    data['hospitalGroupID'] = this.hospitalGroupID;
    data['hospitalID'] = this.hospitalID;
    data['isActivePatientsAllergy'] = this.isActivePatientsAllergy;
    data['patientID'] = this.patientID;
    if (this.patientsAllergyReactionsDTOs != null) {
      data['patientsAllergyReactionsDTOs'] =
          this.patientsAllergyReactionsDTOs!.map((v) => v.toJson()).toList();
    }
    data['patientsAllergyRevisionID'] = this.patientsAllergyRevisionID;
    data['pomrID'] = this.pomrID;
    data['remark'] = this.remark;
    return data;
  }
}

class PatientsAllergyReactionsDTOs {
  int? allergyReactionID;
  int? allergyReactionMappingID;
  String? allergyReactionName;
  int? hospitalGroupID;
  int? hospitalID;
  bool? isActive;
  int? patientID;
  int? patientsAllergyReactionRevisionID;
  int? pomrId;
  int? severity =1;
  bool? isSelected =true;
  String? reactionSelection ="";
  PatientsAllergyReactionsDTOs(
      {this.allergyReactionID,
        this.allergyReactionMappingID,
        this.allergyReactionName,
        this.hospitalGroupID,
        this.hospitalID,
        this.isActive,
        this.patientID,
        this.patientsAllergyReactionRevisionID,
        this.pomrId,
        this.severity =1,
      this.isSelected,
        this.reactionSelection
      });

  PatientsAllergyReactionsDTOs.fromJson(Map<String, dynamic> json) {
    allergyReactionID = json['allergyReactionID'];
    allergyReactionMappingID = json['allergyReactionMappingID'];
    allergyReactionName = json['allergyReactionName'];
    hospitalGroupID = json['hospitalGroupID'];
    hospitalID = json['hospitalID'];
    isActive = json['isActive'];
    patientID = json['patientID'];
    patientsAllergyReactionRevisionID =
    json['patientsAllergyReactionRevisionID'];
    pomrId = json['pomrId'];
    severity = json['severity'];
  }

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