class CreateEReferralRequestModel {
  bool? isInsuredPatient;
  String? cityCode;
  String? cityName;
  String? requesterName;
  String? requesterContactNo;
  int? requesterRelationship;
  String? otherRelationship;
  String? fullName;
  int? identificationNo;
  String? patientMobileNumber;
  int? preferredBranchCode;
  String? preferredBranchName;
  List<EReferralAttachment>? medicalReportAttachment;
  dynamic insuranceCardAttachment;
  double? versionID;
  int? channel;
  int? languageID;
  String? iPAdress;
  String? generalid;
  int? patientOutSA;
  String? sessionID;
  bool? isDentalAllowedBackend;
  int? deviceTypeID;
  int? patientID;
  String? tokenID;
  int? patientTypeID;
  int? patientType;

  CreateEReferralRequestModel(
      {this.isInsuredPatient,
      this.cityCode,
      this.cityName,
      this.requesterName,
      this.requesterContactNo,
      this.requesterRelationship,
      this.otherRelationship,
      this.fullName,
      this.identificationNo,
      this.patientMobileNumber,
      this.preferredBranchCode,
      this.preferredBranchName,
      this.medicalReportAttachment,
      this.insuranceCardAttachment,
      this.versionID,
      this.channel,
      this.languageID,
      this.iPAdress,
      this.generalid,
      this.patientOutSA,
      this.sessionID,
      this.isDentalAllowedBackend,
      this.deviceTypeID,
      this.patientID,
      this.tokenID,
      this.patientTypeID,
      this.patientType});

  CreateEReferralRequestModel.fromJson(Map<String, dynamic> json) {
    isInsuredPatient = json['IsInsuredPatient'];
    cityCode = json['CityCode'];
    cityName = json['CityName'];
    requesterName = json['RequesterName'];
    requesterContactNo = json['RequesterContactNo'];
    requesterRelationship = json['RequesterRelationship'];
    otherRelationship = json['OtherRelationship'];
    fullName = json['FullName'];
    identificationNo = json['IdentificationNo'];
    patientMobileNumber = json['PatientMobileNumber'];
    preferredBranchCode = json['PreferredBranchCode'];
    preferredBranchName = json['PreferredBranchName'];
    if (json['MedicalReportAttachment'] != null) {
      medicalReportAttachment = <EReferralAttachment>[];
      json['MedicalReportAttachment'].forEach((v) {
        medicalReportAttachment!.add(EReferralAttachment.fromJson(v));
      });
    }
    insuranceCardAttachment = json['InsuranceCardAttachment'] != null ? EReferralAttachment.fromJson(json['InsuranceCardAttachment']) : null;
    versionID = json['VersionID'];
    channel = json['Channel'];
    languageID = json['LanguageID'];
    iPAdress = json['IPAdress'];
    generalid = json['generalid'];
    patientOutSA = json['PatientOutSA'];
    sessionID = json['SessionID'];
    isDentalAllowedBackend = json['isDentalAllowedBackend'];
    deviceTypeID = json['DeviceTypeID'];
    patientID = json['PatientID'];
    tokenID = json['TokenID'];
    patientTypeID = json['PatientTypeID'];
    patientType = json['PatientType'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['IsInsuredPatient'] = this.isInsuredPatient;
    data['CityCode'] = this.cityCode;
    data['CityName'] = this.cityName;
    data['RequesterName'] = this.requesterName;
    data['RequesterContactNo'] = this.requesterContactNo;
    data['RequesterRelationship'] = this.requesterRelationship;
    data['OtherRelationship'] = this.otherRelationship;
    data['FullName'] = this.fullName;
    data['IdentificationNo'] = this.identificationNo;
    data['PatientMobileNumber'] = this.patientMobileNumber;
    data['PreferredBranchCode'] = this.preferredBranchCode;
    data['PreferredBranchName'] = this.preferredBranchName;
    if (this.medicalReportAttachment != null) {
      data['MedicalReportAttachment'] = this.medicalReportAttachment!.map((v) => v.toJson()).toList();
    }
    if (this.insuranceCardAttachment == null) {
      data['InsuranceCardAttachment'] = {};
    } else
      data['InsuranceCardAttachment'] = this.insuranceCardAttachment.toJson();

    data['VersionID'] = this.versionID;
    data['Channel'] = this.channel;
    data['LanguageID'] = this.languageID;
    data['IPAdress'] = this.iPAdress;
    data['generalid'] = this.generalid;
    data['PatientOutSA'] = this.patientOutSA;
    data['SessionID'] = this.sessionID;
    data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
    data['DeviceTypeID'] = this.deviceTypeID;
    data['PatientID'] = this.patientID;
    data['TokenID'] = this.tokenID;
    data['PatientTypeID'] = this.patientTypeID;
    data['PatientType'] = this.patientType;
    return data;
  }
}

class EReferralAttachment {
  String? fileName;
  String? base64String;

  EReferralAttachment({this.fileName, this.base64String});

  EReferralAttachment.fromJson(Map<String, dynamic> json) {
    fileName = json['FileName'];
    base64String = json['Base64String'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['FileName'] = this.fileName;
    data['Base64String'] = this.base64String;
    return data;
  }
}
