import 'package:hmg_patient_app/uitl/date_uitl.dart';

class PatientDoctorAppointment {
  String? setupID;
  int? projectID;
  int? appointmentNo;
  DateTime? appointmentDate;
  String? appointmentDateN;
  bool? appointmentType;
  DateTime? bookDate;
  bool? patientType;
  int? patientID;
  int? clinicID;
  int? doctorID;
  DateTime? endDate;
  String? startTime;
  String? endTime;
  bool? status;
  bool? visitType;
  String? visitFor;
  String? patientStatusType;
  String? actualVisitStartTime;
  String? actualVisitEndTime;
  bool? isReminderActivated;
  String? reminderDisplayInterval;
  String? reminderDisplayIntervalUnit;
  String? mainAppointmentNo;
  String? notes;
  int? companyID;
  String? dHCCPatApptRef;
  String? bookedBy;
  DateTime? bookedOn;
  String? confirmedBy;
  DateTime? confirmedOn;
  String? arrivalChangedBy;
  DateTime? arrivedOn;
  String? rescheduledBy;
  String? rescheduledOn;
  String? mRStatus;
  String? mRSentBy;
  String? mRSentOn;
  String? mRReceiptBy;
  String? mRReceiptOn;
  String? isDocumentScanned;
  String? documentScanDateTime;
  String? documentScannedUser;
  String? editedBy;
  String? editedOn;
  String? isRecordedByNurse;
  String? isCheckedByDoctor;
  String? isVisitClosed;
  String? isRecurring;
  String? isPersonallyConfirmed;
  String? confirmationBy;
  String? relationId;
  int? appointmentDays;
  int? isActive;
  int? actualDoctorRate;
  String? clinicName;
  String? doctorCases;
  String? doctorImageURL;
  String? doctorInfo;
  String? doctorName;
  int? doctorRate;
  String? doctorTitle;
  int? gender;
  String? genderDescription;
  bool? isActiveDoctorProfile;
  bool? isAppointmentAllowed;
  bool? isDoctorAllowVedioCall;
  String? nationalityFlagURL;
  String? nationalityID;
  String? nationalityName;
  int? noOfPatientsRate;
  String? projectName;
  String? qR;
  List<String?>? speciality;

  PatientDoctorAppointment(
      {this.setupID,
      this.projectID,
      this.appointmentNo,
      this.appointmentDate,
      this.appointmentDateN,
      this.appointmentType,
      this.bookDate,
      this.patientType,
      this.patientID,
      this.clinicID,
      this.doctorID,
      this.endDate,
      this.startTime,
      this.endTime,
      this.status,
      this.visitType,
      this.visitFor,
      this.patientStatusType,
      this.actualVisitStartTime,
      this.actualVisitEndTime,
      this.isReminderActivated,
      this.reminderDisplayInterval,
      this.reminderDisplayIntervalUnit,
      this.mainAppointmentNo,
      this.notes,
      this.companyID,
      this.dHCCPatApptRef,
      this.bookedBy,
      this.bookedOn,
      this.confirmedBy,
      this.confirmedOn,
      this.arrivalChangedBy,
      this.arrivedOn,
      this.rescheduledBy,
      this.rescheduledOn,
      this.mRStatus,
      this.mRSentBy,
      this.mRSentOn,
      this.mRReceiptBy,
      this.mRReceiptOn,
      this.isDocumentScanned,
      this.documentScanDateTime,
      this.documentScannedUser,
      this.editedBy,
      this.editedOn,
      this.isRecordedByNurse,
      this.isCheckedByDoctor,
      this.isVisitClosed,
      this.isRecurring,
      this.isPersonallyConfirmed,
      this.confirmationBy,
      this.relationId,
      this.appointmentDays,
      this.isActive,
      this.actualDoctorRate,
      this.clinicName,
      this.doctorCases,
      this.doctorImageURL,
      this.doctorInfo,
      this.doctorName,
      this.doctorRate,
      this.doctorTitle,
      this.gender,
      this.genderDescription,
      this.isActiveDoctorProfile,
      this.isAppointmentAllowed,
      this.isDoctorAllowVedioCall,
      this.nationalityFlagURL,
      this.nationalityID,
      this.nationalityName,
      this.noOfPatientsRate,
      this.projectName,
      this.qR,
      this.speciality});

  PatientDoctorAppointment.fromJson(Map<String, dynamic> json) {
    try {
      setupID = json['SetupID'];
      projectID = json['ProjectID'];
      appointmentNo = json['AppointmentNo'];
      appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']);
      appointmentDateN = json['AppointmentDateN'];
      appointmentType = json['AppointmentType'];
      bookDate = DateUtil.convertStringToDate(json['BookDate']);
      patientType = json['PatientType'];
      patientID = json['PatientID'];
      clinicID = json['ClinicID'];
      doctorID = json['DoctorID'];
      endDate = DateUtil.convertStringToDate(json['EndDate']);
      startTime = json['StartTime'];
      endTime = json['EndTime'];
      status = json['Status'];
      visitType = json['VisitType'];
      visitFor = json['VisitFor'];
      patientStatusType = json['PatientStatusType'];
      actualVisitStartTime = json['ActualVisitStartTime'];
      actualVisitEndTime = json['ActualVisitEndTime'];
      isReminderActivated = json['IsReminderActivated'];
      reminderDisplayInterval = json['ReminderDisplayInterval'];
      reminderDisplayIntervalUnit = json['ReminderDisplayIntervalUnit'];
      mainAppointmentNo = json['MainAppointmentNo'];
      notes = json['Notes'];
      companyID = json['CompanyID'];
      dHCCPatApptRef = json['DHCCPatApptRef'];
      bookedBy = json['BookedBy'];
      //  bookedOn =  DateUtil.convertStringToDate(json['BookedOn']);
      confirmedBy = json['ConfirmedBy'];
      //   confirmedOn =  DateUtil.convertStringToDate(json['ConfirmedOn']);
      arrivalChangedBy = json['ArrivalChangedBy'];
      //   arrivedOn =  DateUtil.convertStringToDate(json['ArrivedOn']);
      rescheduledBy = json['RescheduledBy'];
      rescheduledOn = json['RescheduledOn'];
      mRStatus = json['MRStatus'];
      mRSentBy = json['MRSentBy'];
      mRSentOn = json['MRSentOn'];
      mRReceiptBy = json['MRReceiptBy'];
      mRReceiptOn = json['MRReceiptOn'];
      isDocumentScanned = json['IsDocumentScanned'];
      documentScanDateTime = json['DocumentScanDateTime'];
      documentScannedUser = json['DocumentScannedUser'];
      editedBy = json['EditedBy'];
      editedOn = json['EditedOn'];
      isRecordedByNurse = json['IsRecordedByNurse'];
      isCheckedByDoctor = json['IsCheckedByDoctor'];
      isVisitClosed = json['IsVisitClosed'];
      isRecurring = json['IsRecurring'];
      isPersonallyConfirmed = json['IsPersonallyConfirmed'];
      confirmationBy = json['ConfirmationBy'];
      relationId = json['RelationId'];
      appointmentDays = json['AppointmentDays'];
      isActive = json['IsActive'];
      actualDoctorRate = json['ActualDoctorRate'];
      clinicName = json['ClinicName'];
      doctorCases = json['DoctorCases'];
      doctorImageURL = json['DoctorImageURL'];
      doctorInfo = json['DoctorInfo'];
      doctorName = json['DoctorName'];
      doctorRate = json['DoctorRate'];
      doctorTitle = json['DoctorTitle'];
      gender = json['Gender'];
      genderDescription = json['GenderDescription'];
      isActiveDoctorProfile = json['IsActiveDoctorProfile'];
      isAppointmentAllowed = json['IsAppointmentAllowed'];
      isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
      nationalityFlagURL = json['NationalityFlagURL'];
      nationalityID = json['NationalityID'];
      nationalityName = json['NationalityName'];
      noOfPatientsRate = json['NoOfPatientsRate'];
      projectName = json['ProjectName'];
      qR = json['QR'];
      //    speciality = json['Speciality'].cast<String?>();
    } catch (e) {
      print(e);
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['SetupID'] = this.setupID;
    data['ProjectID'] = this.projectID;
    data['AppointmentNo'] = this.appointmentNo;
    data['AppointmentDate'] = this.appointmentDate;
    data['AppointmentDateN'] = this.appointmentDateN;
    data['AppointmentType'] = this.appointmentType;
    data['BookDate'] = this.bookDate;
    data['PatientType'] = this.patientType;
    data['PatientID'] = this.patientID;
    data['ClinicID'] = this.clinicID;
    data['DoctorID'] = this.doctorID;
    data['EndDate'] = this.endDate;
    data['StartTime'] = this.startTime;
    data['EndTime'] = this.endTime;
    data['Status'] = this.status;
    data['VisitType'] = this.visitType;
    data['VisitFor'] = this.visitFor;
    data['PatientStatusType'] = this.patientStatusType;
    data['ActualVisitStartTime'] = this.actualVisitStartTime;
    data['ActualVisitEndTime'] = this.actualVisitEndTime;
    data['IsReminderActivated'] = this.isReminderActivated;
    data['ReminderDisplayInterval'] = this.reminderDisplayInterval;
    data['ReminderDisplayIntervalUnit'] = this.reminderDisplayIntervalUnit;
    data['MainAppointmentNo'] = this.mainAppointmentNo;
    data['Notes'] = this.notes;
    data['CompanyID'] = this.companyID;
    data['DHCCPatApptRef'] = this.dHCCPatApptRef;
    data['BookedBy'] = this.bookedBy;
    data['BookedOn'] = this.bookedOn;
    data['ConfirmedBy'] = this.confirmedBy;
    data['ConfirmedOn'] = this.confirmedOn;
    data['ArrivalChangedBy'] = this.arrivalChangedBy;
    data['ArrivedOn'] = this.arrivedOn;
    data['RescheduledBy'] = this.rescheduledBy;
    data['RescheduledOn'] = this.rescheduledOn;
    data['MRStatus'] = this.mRStatus;
    data['MRSentBy'] = this.mRSentBy;
    data['MRSentOn'] = this.mRSentOn;
    data['MRReceiptBy'] = this.mRReceiptBy;
    data['MRReceiptOn'] = this.mRReceiptOn;
    data['IsDocumentScanned'] = this.isDocumentScanned;
    data['DocumentScanDateTime'] = this.documentScanDateTime;
    data['DocumentScannedUser'] = this.documentScannedUser;
    data['EditedBy'] = this.editedBy;
    data['EditedOn'] = this.editedOn;
    data['IsRecordedByNurse'] = this.isRecordedByNurse;
    data['IsCheckedByDoctor'] = this.isCheckedByDoctor;
    data['IsVisitClosed'] = this.isVisitClosed;
    data['IsRecurring'] = this.isRecurring;
    data['IsPersonallyConfirmed'] = this.isPersonallyConfirmed;
    data['ConfirmationBy'] = this.confirmationBy;
    data['RelationId'] = this.relationId;
    data['AppointmentDays'] = this.appointmentDays;
    data['IsActive'] = this.isActive;
    data['ActualDoctorRate'] = this.actualDoctorRate;
    data['ClinicName'] = this.clinicName;
    data['DoctorCases'] = this.doctorCases;
    data['DoctorImageURL'] = this.doctorImageURL;
    data['DoctorInfo'] = this.doctorInfo;
    data['DoctorName'] = this.doctorName;
    data['DoctorRate'] = this.doctorRate;
    data['DoctorTitle'] = this.doctorTitle;
    data['Gender'] = this.gender;
    data['GenderDescription'] = this.genderDescription;
    data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
    data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
    data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
    data['NationalityFlagURL'] = this.nationalityFlagURL;
    data['NationalityID'] = this.nationalityID;
    data['NationalityName'] = this.nationalityName;
    data['NoOfPatientsRate'] = this.noOfPatientsRate;
    data['ProjectName'] = this.projectName;
    data['QR'] = this.qR;
    data['Speciality'] = this.speciality;
    return data;
  }
}

class PatientDoctorAppointmentList {
  String? filterName = "";
  List<PatientDoctorAppointment> patientDoctorAppointmentList = <PatientDoctorAppointment>[];

  PatientDoctorAppointmentList({this.filterName, PatientDoctorAppointment? patientDoctorAppointment}) {
    patientDoctorAppointmentList.add(patientDoctorAppointment!);
  }
}
