class PatientPreviousDiagnosis {
  bool? active;
  int? admissionId;
  int? admissionRequestId;
  int? appointmentId;
  String? approvedBy;
  String? approvedOn;
  int? assessmentId;
  int? chiefComplainId;
  int? clinicGroupId;
  int? clinicId;
  String? condition;
  String? createdBy;
  String? createdOn;
  String? deletedBy;
  String? deletedByDoctorName;
  String? deletedOn;
  String? deletedRemarks;
  String? diagnosisType;
  int? doctorId;
  int? episodeId;
  int? hospitalGroupId;
  int? hospitalId;
  dynamic icdCodeDetailsDto;
  String? icdSubVersion;
  String? icdType;
  dynamic icdVersion;
  String? location;
  String? loginUserId;
  String? modifiedBy;
  String? modifiedOn;
  String? module;
  String? parentLocation;
  int? patientId;
  dynamic patientProblemChangeHistories;
  int? patientProblemId;
  int? patientProblemRevisionId;
  int? pomrId;
  bool? previousProblem;
  int? problemId;
  String? problemName;
  String? remarks;
  bool? resolved;
  String? selectedCategoryCode;
  String? selectedChapterCode;
  String? selectedDisease;
  String? selectedIcdCode;
  String? selectedSectionCode;
  String? status;
  List<VisitWisePatientDiagnosis>? visitWisePatientDiagnoses;
  bool? visitWiseSelected;

  PatientPreviousDiagnosis.fromJson(Map<String, dynamic> json) {
    active = json['active'];
    admissionId = json['admissionId'];
    admissionRequestId = json['admissionRequestId'];
    appointmentId = json['appointmentId'];
    approvedBy = json['approvedBy'];
    approvedOn = json['approvedOn'];
    assessmentId = json['assessmentId'];
    chiefComplainId = json['chiefComplainId'];
    clinicGroupId = json['clinicGroupId'];
    clinicId = json['clinicId'];
    condition = json['condition'];
    createdBy = json['createdBy'];
    createdOn = json['createdOn'];
    deletedBy = json['deletedBy'];
    deletedByDoctorName = json['deletedByDoctorName'];
    deletedOn = json['deletedOn'];
    deletedRemarks = json['deletedRemarks'];
    diagnosisType = json['diagnosisType'];
    doctorId = json['doctorId'];
    episodeId = json['episodeId'];
    hospitalGroupId = json['hospitalGroupId'];
    hospitalId = json['hospitalId'];
    icdCodeDetailsDto = json['icdCodeDetailsDto'];
    icdSubVersion = json['icdSubVersion'];
    icdType = json['icdType'];
    icdVersion = json['icdVersion'];
    location = json['location'];
    loginUserId = json['loginUserId'];
    modifiedBy = json['modifiedBy'];
    modifiedOn = json['modifiedOn'];
    module = json['module'];
    parentLocation = json['parentLocation'];
    patientId = json['patientId'];
    patientProblemChangeHistories = json['patientProblemChangeHistories'];
    patientProblemId = json['patientProblemId'];
    patientProblemRevisionId = json['patientProblemRevisionId'];
    pomrId = json['pomrId'];
    previousProblem = json['previousProblem'];
    problemId = json['problemId'];
    problemName = json['problemName'];
    remarks = json['remarks'];
    resolved = json['resolved'];
    selectedCategoryCode = json['selectedCategoryCode'];
    selectedChapterCode = json['selectedChapterCode'];
    selectedDisease = json['selectedDisease'];
    selectedIcdCode = json['selectedIcdCode'];
    selectedSectionCode = json['selectedSectionCode'];
    status = json['status'];
    visitWiseSelected = json['visitWiseSelected'];
    if (json['visitWisePatientDiagnoses'] != null) {
      visitWisePatientDiagnoses = [];
      json['visitWisePatientDiagnoses'].forEach((v) {
        visitWisePatientDiagnoses!.add(VisitWisePatientDiagnosis.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    return {
      'active': active,
      'admissionId': admissionId ?? 0,
      'admissionRequestId': admissionRequestId ?? 0,
      'appointmentId': appointmentId ?? 0,
      'approvedBy': approvedBy,
      'approvedOn': approvedOn,
      'assessmentId': assessmentId ?? 0,
      'chiefComplainId': chiefComplainId ?? 0,
      'clinicGroupId': clinicGroupId ?? 0,
      'clinicId': clinicId,
      'condition': condition,
      'createdBy': createdBy,
      'createdOn': createdOn,
      'deletedBy': deletedBy,
      'deletedByDoctorName': deletedByDoctorName,
      'deletedOn': deletedOn,
      'deletedRemarks': deletedRemarks,
      'diagnosisType': diagnosisType,
      'doctorId': doctorId,
      'episodeId': episodeId ?? 0,
      'hospitalGroupId': hospitalGroupId,
      'hospitalId': hospitalId,
      'icdCodeDetailsDto': icdCodeDetailsDto,
      'icdSubVersion': icdSubVersion,
      'icdType': icdType,
      'icdVersion': icdVersion,
      'location': location,
      'loginUserId': loginUserId,
      'modifiedBy': modifiedBy,
      'modifiedOn': modifiedOn,
      'module': module,
      'parentLocation': parentLocation,
      'patientId': patientId,
      'patientProblemChangeHistories': patientProblemChangeHistories,
      'patientProblemId': patientProblemId,
      'patientProblemRevisionId': patientProblemRevisionId,
      'pomrId': pomrId,
      'previousProblem': previousProblem,
      'problemId': problemId,
      'problemName': problemName,
      'remarks': remarks,
      'resolved': resolved,
      'selectedCategoryCode': selectedCategoryCode,
      'selectedChapterCode': selectedChapterCode,
      'selectedDisease': selectedDisease,
      'selectedIcdCode': selectedIcdCode,
      'selectedSectionCode': selectedSectionCode,
      'status': status,
      'visitWiseSelected': visitWiseSelected,
      'visitWisePatientDiagnoses': visitWisePatientDiagnoses?.map((v) => v.toJson()).toList(),
    };
  }
}

class VisitWisePatientDiagnosis {
  bool? active;
  int? admissionId;
  int? appointmentId;
  String? approvedBy;
  String? approvedOn;
  int? assessmentId;
  int? clinicId;
  String? condition;
  String? createdBy;
  String? createdOn;
  String? deletedBy;
  String? deletedOn;
  String? deletedRemarks;
  String? diagnosisType;
  int? doctorId;
  int? episodeId;
  int? hospitalGroupId;
  int? hospitalId;
  String? icdSubVersion;
  String? icdType;
  dynamic icdVersion;
  bool? isPreviousProblem;
  String? location;
  String? loginUserId;
  String? modifiedBy;
  String? modifiedOn;
  int? patientDiagnosisId;
  int? patientId;
  int? patientProblemRevisionId;
  int? pomrId;
  String? problemName;
  String? remarks;
  bool? resolved;
  bool? selected;
  String? selectedDisease;
  int? selectedDoctorId;
  String? selectedIcdCode;

  VisitWisePatientDiagnosis.fromJson(Map<String, dynamic> json) {
    active = json['active'];
    admissionId = json['admissionId'];
    appointmentId = json['appointmentId'];
    approvedBy = json['approvedBy'];
    approvedOn = json['approvedOn'];
    assessmentId = json['assessmentId'];
    clinicId = json['clinicId'];
    condition = json['condition'];
    createdBy = json['createdBy'];
    createdOn = json['createdOn'];
    deletedBy = json['deletedBy'];
    deletedOn = json['deletedOn'];
    deletedRemarks = json['deletedRemarks'];
    diagnosisType = json['diagnosisType'];
    doctorId = json['doctorId'];
    episodeId = json['episodeId'];
    hospitalGroupId = json['hospitalGroupId'];
    hospitalId = json['hospitalId'];
    icdSubVersion = json['icdSubVersion'];
    icdType = json['icdType'];
    icdVersion = json['icdVersion'];
    isPreviousProblem = json['isPreviousProblem'];
    location = json['location'];
    loginUserId = json['loginUserId'];
    modifiedBy = json['modifiedBy'];
    modifiedOn = json['modifiedOn'];
    patientDiagnosisId = json['patientDiagnosisId'];
    patientId = json['patientId'];
    patientProblemRevisionId = json['patientProblemRevisionId'];
    pomrId = json['pomrId'];
    problemName = json['problemName'];
    remarks = json['remarks'];
    resolved = json['resolved'];
    selected = json['selected'];
    selectedDisease = json['selectedDisease'];
    selectedDoctorId = json['selectedDoctorId'];
    selectedIcdCode = json['selectedIcdCode'];
  }

  Map<String, dynamic> toJson() {
    return {
      'active': active,
      'admissionId': admissionId,
      'appointmentId': appointmentId,
      'approvedBy': approvedBy,
      'approvedOn': approvedOn,
      'assessmentId': assessmentId,
      'clinicId': clinicId,
      'condition': condition,
      'createdBy': createdBy,
      'createdOn': createdOn,
      'deletedBy': deletedBy,
      'deletedOn': deletedOn,
      'deletedRemarks': deletedRemarks,
      'diagnosisType': diagnosisType,
      'doctorId': doctorId,
      'episodeId': episodeId,
      'hospitalGroupId': hospitalGroupId,
      'hospitalId': hospitalId,
      'icdSubVersion': icdSubVersion,
      'icdType': icdType,
      'icdVersion': icdVersion,
      'isPreviousProblem': isPreviousProblem,
      'location': location,
      'loginUserId': loginUserId,
      'modifiedBy': modifiedBy,
      'modifiedOn': modifiedOn,
      'patientDiagnosisId': patientDiagnosisId,
      'patientId': patientId,
      'patientProblemRevisionId': patientProblemRevisionId,
      'pomrId': pomrId,
      'problemName': problemName,
      'remarks': remarks,
      'resolved': resolved,
      'selected': selected,
      'selectedDisease': selectedDisease,
      'selectedDoctorId': selectedDoctorId,
      'selectedIcdCode': selectedIcdCode,
    };
  }
}
