import 'package:mitra_corporate/model/patient_Model.dart';

class SearchPatientModel {
  List<PatientModel>? patients;
  String? total;
  int? totalPage;

  SearchPatientModel({this.patients, this.total, this.totalPage});

  SearchPatientModel.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      patients = <PatientModel>[];
      json['data'].forEach((v) {
        patients!.add(PatientModel.fromJson(v));
      });
    }
    total = json['total'];
    totalPage = json['total_page'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (patients != null) {
      data['data'] = patients!.map((v) => v.toJson()).toList();
    }
    data['total'] = total;
    data['total_page'] = totalPage;
    return data;
  }
}
