class GetSearchCurrentMedicationDetails {
  List<GenericItemFrequencyDetailsEntity>? genericItemFrequencyDetailsEntity;
  List<GenericItemRouteDetailsEntity>? genericItemRouteDetailsEntity;
  List<ItemStrengthDetailsDto>? itemStrengthDetailsDto;
  int? patientTypeId;

  GetSearchCurrentMedicationDetails({this.genericItemFrequencyDetailsEntity, this.genericItemRouteDetailsEntity, this.itemStrengthDetailsDto, this.patientTypeId});

  GetSearchCurrentMedicationDetails.fromJson(Map<String, dynamic> json) {
    if (json['listItemByMedicineCode']['frequencies'] != null) {
      genericItemFrequencyDetailsEntity = <GenericItemFrequencyDetailsEntity>[];
      json['listItemByMedicineCode']['frequencies'].forEach((v) { genericItemFrequencyDetailsEntity!.add(new GenericItemFrequencyDetailsEntity.fromJsonForMedicationDetails(v)); });
    }
    if (json['listItemByMedicineCode']['routes'] != null) {
      genericItemRouteDetailsEntity = <GenericItemRouteDetailsEntity>[];
      json['listItemByMedicineCode']['routes'].forEach((v) { genericItemRouteDetailsEntity!.add(new GenericItemRouteDetailsEntity.fromJsonForMedicationDetails(v)); });
    }
    if (json['listItemByMedicineCode']['strengths'] != null) {
      itemStrengthDetailsDto = <ItemStrengthDetailsDto>[];
      json['listItemByMedicineCode']['strengths'].forEach((v) { itemStrengthDetailsDto!.add(new ItemStrengthDetailsDto.fromJsonForMedicationDetails(v)); });
    }
    patientTypeId = json['patientTypeId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.genericItemFrequencyDetailsEntity != null) {
      data['genericItemFrequencyDetailsEntity'] = this.genericItemFrequencyDetailsEntity!.map((v) => v.toJson()).toList();
    }
    if (this.genericItemRouteDetailsEntity != null) {
      data['genericItemRouteDetailsEntity'] = this.genericItemRouteDetailsEntity!.map((v) => v.toJson()).toList();
    }
    if (this.itemStrengthDetailsDto != null) {
      data['itemStrengthDetailsDto'] = this.itemStrengthDetailsDto!.map((v) => v.toJson()).toList();
    }
    data['patientTypeId'] = this.patientTypeId;
    return data;
  }
}

class GenericItemFrequencyDetailsEntity {
  bool? Default;
  String? frequency;
  int? frequencyId;
  int? interval;

  GenericItemFrequencyDetailsEntity({this.Default, this.frequency, this.frequencyId, this.interval});

GenericItemFrequencyDetailsEntity.fromJson(Map<String, dynamic> json) {
Default = json['Default'];
frequency = json['Frequency'];
frequencyId = json['FrequencyId'];
interval = json['Interval'];
}

GenericItemFrequencyDetailsEntity.fromJsonForMedicationDetails(Map<String, dynamic> json) {
Default = json['Default'];
frequency = json['description'];
frequencyId = json['parameterCode'];
interval = json['Interval'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Default'] = this.Default;
data['Frequency'] = this.frequency;
data['FrequencyId'] = this.frequencyId;
data['Interval'] = this.interval;
return data;
}
}

class GenericItemRouteDetailsEntity {
bool? Default;
String? route;
int? routeId;

GenericItemRouteDetailsEntity({this.Default, this.route, this.routeId});

GenericItemRouteDetailsEntity.fromJson(Map<String, dynamic> json) {
Default = json['default'];
route = json['route'];
routeId = json['routeId'];
}

GenericItemRouteDetailsEntity.fromJsonForMedicationDetails(Map<String, dynamic> json) {
  Default = json['Default'];
  route = json['description'];
  routeId = json['parameterCode'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['default'] = this.Default;
data['route'] = this.route;
data['routeId'] = this.routeId;
return data;
}
}

class ItemStrengthDetailsDto {
bool? Default;
String? strength;
int? strengthId;

ItemStrengthDetailsDto({this.Default, this.strength, this.strengthId});

ItemStrengthDetailsDto.fromJson(Map<String, dynamic> json) {
Default = json['default'];
strength = json['strength'];
strengthId = json['strengthId'];
}
ItemStrengthDetailsDto.fromJsonForMedicationDetails(Map<String, dynamic> json) {
  Default = json['Default'];
  strength = json['description'];
  strengthId = json['parameterCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['default'] = this.Default;
data['strength'] = this.strength;
data['strengthId'] = this.strengthId;
return data;
}
}
