class SearchDiagnosis {
  String? category;
  String? categoryId;
  String? codeRange;
  String? diseaseType;
  String? diseases;
  String? diseasesBCode;
  String? diseasesCode;
  String? diseasesDataId;
  String? diseasesId;
  String? diseasesName;
  int? hospitalGroupId;
  int? hospitalId;
  String? icdSubVersion;
  String? icdType;
  List<String>? icdVersion;
  String? icdVersionDisplay;
  bool? isDeleted;
  String? layerID;
  String? parentDiseasesCode;
  String? specification;
  int? specificationId;
  String? specificationNo;
  String? selectedIcdCode;
  String? selectedCategoryCode;
  String? selectedSectionCode;
  String? selectedChapterCode;
  String? selectedNandaCode;
  bool isFavorite = false;

  // Default constructor
  SearchDiagnosis();

  // fromJson constructor
  SearchDiagnosis.fromJson(Map<String, dynamic> json) {
    category = json['category'];
    categoryId = json['categoryId'];
    codeRange = json['codeRange'];
    diseaseType = json['diseaseType'];
    diseases = json['diseases'];
    diseasesBCode = json['diseasesBCode'];
    diseasesCode = json['diseasesCode'];
    diseasesDataId = json['diseasesDataId'];
    diseasesId = json['diseasesId'];
    diseasesName = json['diseasesName'];
    hospitalGroupId = json['hospitalGroupId'];
    hospitalId = json['hospitalId'];
    icdSubVersion = json['icdSubVersion'];
    icdType = json['icdType'];
    icdVersion = json['icdVersion'] != null
        ? List<String>.from(json['icdVersion'])
        : null;
    icdVersionDisplay = json['icdVersionDisplay'];
    isDeleted = json['isDeleted'] == "True";
    layerID = json['layerID'];
    parentDiseasesCode = json['parentDiseasesCode'];
    specification = json['specification'];
    specificationId = json['specificationId'];
    specificationNo = json['specificationNo'];
    selectedIcdCode = json['selectedIcdCode'];
    selectedCategoryCode = json['selectedCategoryCode'];
    selectedSectionCode = json['selectedSectionCode'];
    selectedChapterCode = json['selectedChapterCode'];
    selectedNandaCode = json['selectedNandaCode'];
  }

  // toJson method
  Map<String, dynamic> toJson() {
    return {
      'category': category,
      'categoryId': categoryId,
      'codeRange': codeRange,
      'diseaseType': diseaseType,
      'diseases': diseases,
      'diseasesBCode': diseasesBCode,
      'diseasesCode': diseasesCode,
      'diseasesDataId': diseasesDataId,
      'diseasesId': diseasesId,
      'diseasesName': diseasesName,
      'hospitalGroupId': hospitalGroupId,
      'hospitalId': hospitalId,
      'icdSubVersion': icdSubVersion,
      'icdType': icdType,
      'icdVersion': icdVersion,
      'icdVersionDisplay': icdVersionDisplay,
      'isDeleted': isDeleted.toString(),
      'layerID': layerID,
      'parentDiseasesCode': parentDiseasesCode,
      'specification': specification,
      'specificationId': specificationId,
      'specificationNo': specificationNo,
      'selectedIcdCode': selectedIcdCode,
      'selectedCategoryCode': selectedCategoryCode,
      'selectedSectionCode': selectedSectionCode,
      'selectedChapterCode': selectedChapterCode,
      'selectedNandaCode': selectedNandaCode,
    };
  }
}