class SearchEReferralResponseModel {
  dynamic acceptedBrachCode;
  dynamic acceptedBranchName;
  dynamic acceptedBranchNameAr;
  dynamic channel;
  dynamic identityCardAttachment;
  String identityNumber;
  dynamic insuranceCardAttachment;
  bool isInsuredPatient;
  List<dynamic> medicalReportAttachment;
  String otherRelationship;
  String patientContactNo;
  int patientId;
  String patientName;
  int preferredBranchCode;
  String preferredBranchName;
  String referralDate;
  int referralNumber;
  RelationshipType relationshipType;
  String requesterContactNo;
  String requesterName;
  String status;
  String statusAr;

  SearchEReferralResponseModel(
      {this.acceptedBrachCode,
      this.acceptedBranchName,
      this.acceptedBranchNameAr,
      this.channel,
      this.identityCardAttachment,
      this.identityNumber,
      this.insuranceCardAttachment,
      this.isInsuredPatient,
      this.medicalReportAttachment,
      this.otherRelationship,
      this.patientContactNo,
      this.patientId,
      this.patientName,
      this.preferredBranchCode,
      this.preferredBranchName,
      this.referralDate,
      this.referralNumber,
      this.relationshipType,
      this.requesterContactNo,
      this.requesterName,
      this.status,
      this.statusAr});

  SearchEReferralResponseModel.fromJson(Map<String, dynamic> json) {
    acceptedBrachCode = json['AcceptedBrachCode'];
    acceptedBranchName = json['AcceptedBranchName'];
    acceptedBranchNameAr = json['AcceptedBranchNameAr'];
    channel = json['Channel'];
    identityCardAttachment = json['IdentityCardAttachment'];
    identityNumber = json['IdentityNumber'];
    insuranceCardAttachment = json['InsuranceCardAttachment'];
    isInsuredPatient = json['IsInsuredPatient'];
    otherRelationship = json['OtherRelationship'];
    patientContactNo = json['PatientContactNo'];
    patientId = json['PatientId'];
    patientName = json['PatientName'];
    preferredBranchCode = json['PreferredBranchCode'];
    preferredBranchName = json['PreferredBranchName'];
    referralDate = json['ReferralDate'];
    referralNumber = json['ReferralNumber'];
    relationshipType = json['RelationshipType'] != null
        ? new RelationshipType.fromJson(json['RelationshipType'])
        : null;
    requesterContactNo = json['RequesterContactNo'];
    requesterName = json['RequesterName'];
    status = json['Status'];
    statusAr = json['StatusAr'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['AcceptedBrachCode'] = this.acceptedBrachCode;
    data['AcceptedBranchName'] = this.acceptedBranchName;
    data['AcceptedBranchNameAr'] = this.acceptedBranchNameAr;
    data['Channel'] = this.channel;
    data['IdentityCardAttachment'] = this.identityCardAttachment;
    data['IdentityNumber'] = this.identityNumber;
    data['InsuranceCardAttachment'] = this.insuranceCardAttachment;
    data['IsInsuredPatient'] = this.isInsuredPatient;
    if (this.medicalReportAttachment != null) {
      data['MedicalReportAttachment'] =
          this.medicalReportAttachment.map((v) => v.toJson()).toList();
    }
    data['OtherRelationship'] = this.otherRelationship;
    data['PatientContactNo'] = this.patientContactNo;
    data['PatientId'] = this.patientId;
    data['PatientName'] = this.patientName;
    data['PreferredBranchCode'] = this.preferredBranchCode;
    data['PreferredBranchName'] = this.preferredBranchName;
    data['ReferralDate'] = this.referralDate;
    data['ReferralNumber'] = this.referralNumber;
    if (this.relationshipType != dynamic) {
      data['RelationshipType'] = this.relationshipType.toJson();
    }
    data['RequesterContactNo'] = this.requesterContactNo;
    data['RequesterName'] = this.requesterName;
    data['Status'] = this.status;
    data['StatusAr'] = this.statusAr;
    return data;
  }
}

class RelationshipType {
  int iD;
  String text;
  String textAr;
  String textEn;

  RelationshipType({this.iD, this.text, this.textAr, this.textEn});

  RelationshipType.fromJson(Map<String, dynamic> json) {
    iD = json['ID'];
    text = json['Text'];
    textAr = json['Text_Ar'];
    textEn = json['Text_En'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ID'] = this.iD;
    data['Text'] = this.text;
    data['Text_Ar'] = this.textAr;
    data['Text_En'] = this.textEn;
    return data;
  }
}
