import 'dart:convert';

class AuthenticatedUser {
  String? setupId;
  int? patientType;
  int? patientId;
  String? firstName;
  String? middleName;
  String? lastName;
  String? firstNameN;
  String? middleNameN;
  String? lastNameN;
  int? relationshipId;
  int? gender;
  String? dateofBirth;
  dynamic dateofBirthN;
  String? nationalityId;
  String? phoneResi;
  String? phoneOffice;
  String? mobileNumber;
  String? faxNumber;
  String? emailAddress;
  dynamic bloodGroup;
  dynamic rhFactor;
  bool? isEmailAlertRequired;
  bool? isSmsAlertRequired;
  String? preferredLanguage;
  bool? isPrivilegedMember;
  dynamic memberId;
  dynamic expiryDate;
  dynamic isHmgEmployee;
  dynamic employeeId;
  String? emergencyContactName;
  String? emergencyContactNo;
  int? patientPayType;
  dynamic dhccPatientRefId;
  bool? isPatientDummy;
  int? status;
  dynamic isStatusCleared;
  int? patientIdentificationType;
  String? patientIdentificationNo;
  int? projectId;
  int? infoSourceId;
  dynamic address;
  int? age;
  String? ageDesc;
  int? areaId;
  int? crsVerificationStatus;
  String? crsVerificationStatusDesc;
  String? crsVerificationStatusDescN;
  int? createdBy;
  String? genderDescription;
  String? healthIdFromNhicViaVida;
  dynamic ir;
  dynamic isoCityId;
  dynamic isoCountryId;
  bool? isVerfiedFromNhic;
  List<ListPrivilege>? listPrivilege;
  dynamic marital;
  dynamic occupationId;
  int? outSa;
  dynamic poBox;
  bool? receiveHealthSummaryReport;
  int? sourceType;
  dynamic strDateofBirth;
  dynamic tempAddress;
  dynamic zipCode;
  dynamic eHealthIdField;
  dynamic authenticatedUserPatientPayType;
  dynamic authenticatedUserPatientType;
  dynamic authenticatedUserStatus;
  int? superUser;
  bool? isParentUser;

  AuthenticatedUser({
    this.setupId,
    this.patientType,
    this.patientId,
    this.firstName,
    this.middleName,
    this.lastName,
    this.firstNameN,
    this.middleNameN,
    this.lastNameN,
    this.relationshipId,
    this.gender,
    this.dateofBirth,
    this.dateofBirthN,
    this.nationalityId,
    this.phoneResi,
    this.phoneOffice,
    this.mobileNumber,
    this.faxNumber,
    this.emailAddress,
    this.bloodGroup,
    this.rhFactor,
    this.isEmailAlertRequired,
    this.isSmsAlertRequired,
    this.preferredLanguage,
    this.isPrivilegedMember,
    this.memberId,
    this.expiryDate,
    this.isHmgEmployee,
    this.employeeId,
    this.emergencyContactName,
    this.emergencyContactNo,
    this.patientPayType,
    this.dhccPatientRefId,
    this.isPatientDummy,
    this.status,
    this.isStatusCleared,
    this.patientIdentificationType,
    this.patientIdentificationNo,
    this.projectId,
    this.infoSourceId,
    this.address,
    this.age,
    this.ageDesc,
    this.areaId,
    this.crsVerificationStatus,
    this.crsVerificationStatusDesc,
    this.crsVerificationStatusDescN,
    this.createdBy,
    this.genderDescription,
    this.healthIdFromNhicViaVida,
    this.ir,
    this.isoCityId,
    this.isoCountryId,
    this.isVerfiedFromNhic,
    this.listPrivilege,
    this.marital,
    this.occupationId,
    this.outSa,
    this.poBox,
    this.receiveHealthSummaryReport,
    this.sourceType,
    this.strDateofBirth,
    this.tempAddress,
    this.zipCode,
    this.eHealthIdField,
    this.authenticatedUserPatientPayType,
    this.authenticatedUserPatientType,
    this.authenticatedUserStatus,
    this.superUser,
    this.isParentUser,
  });

  factory AuthenticatedUser.fromRawJson(String str) => AuthenticatedUser.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory AuthenticatedUser.fromJson(Map<String, dynamic> json) => AuthenticatedUser(
        setupId: json["SetupID"],
        patientType: json["PatientType"],
        patientId: json["PatientID"],
        firstName: json["FirstName"],
        middleName: json["MiddleName"],
        lastName: json["LastName"],
        firstNameN: json["FirstNameN"],
        middleNameN: json["MiddleNameN"],
        lastNameN: json["LastNameN"],
        relationshipId: json["RelationshipID"],
        gender: json["Gender"],
        dateofBirth: json["DateofBirth"],
        dateofBirthN: json["DateofBirthN"],
        nationalityId: json["NationalityID"],
        phoneResi: json["PhoneResi"],
        phoneOffice: json["PhoneOffice"],
        mobileNumber: json["MobileNumber"],
        faxNumber: json["FaxNumber"],
        emailAddress: json["EmailAddress"],
        bloodGroup: json["BloodGroup"],
        rhFactor: json["RHFactor"],
        isEmailAlertRequired: json["IsEmailAlertRequired"],
        isSmsAlertRequired: json["IsSMSAlertRequired"],
        preferredLanguage: json["PreferredLanguage"],
        isPrivilegedMember: json["IsPrivilegedMember"],
        memberId: json["MemberID"],
        expiryDate: json["ExpiryDate"],
        isHmgEmployee: json["IsHmgEmployee"],
        employeeId: json["EmployeeID"],
        emergencyContactName: json["EmergencyContactName"],
        emergencyContactNo: json["EmergencyContactNo"],
        patientPayType: json["PatientPayType"],
        dhccPatientRefId: json["DHCCPatientRefID"],
        isPatientDummy: json["IsPatientDummy"],
        status: json["Status"],
        isStatusCleared: json["IsStatusCleared"],
        patientIdentificationType: json["PatientIdentificationType"],
        patientIdentificationNo: json["PatientIdentificationNo"],
        projectId: json["ProjectID"],
        infoSourceId: json["InfoSourceID"],
        address: json["Address"],
        age: json["Age"],
        ageDesc: json["AgeDesc"],
        areaId: json["AreaID"],
        crsVerificationStatus: json["CRSVerificationStatus"],
        crsVerificationStatusDesc: json["CRSVerificationStatusDesc"],
        crsVerificationStatusDescN: json["CRSVerificationStatusDescN"],
        createdBy: json["CreatedBy"],
        genderDescription: json["GenderDescription"],
        healthIdFromNhicViaVida: json["HealthIDFromNHICViaVida"],
        ir: json["IR"],
        isoCityId: json["ISOCityID"],
        isoCountryId: json["ISOCountryID"],
        isVerfiedFromNhic: json["IsVerfiedFromNHIC"],
        listPrivilege: json["ListPrivilege"] == null ? [] : List<ListPrivilege>.from(json["ListPrivilege"]!.map((x) => ListPrivilege.fromJson(x))),
        marital: json["Marital"],
        occupationId: json["OccupationID"],
        outSa: json["OutSA"],
        poBox: json["POBox"],
        receiveHealthSummaryReport: json["ReceiveHealthSummaryReport"],
        sourceType: json["SourceType"],
        strDateofBirth: json["StrDateofBirth"],
        tempAddress: json["TempAddress"],
        zipCode: json["ZipCode"],
        eHealthIdField: json["eHealthIDField"],
        authenticatedUserPatientPayType: json["patientPayType"],
        authenticatedUserPatientType: json["patientType"],
        authenticatedUserStatus: json["status"],
        superUser: json["superUser"],
        isParentUser: json["isParentUser"] ?? false,
      );

  Map<String, dynamic> toJson() => {
        "SetupID": setupId,
        "PatientType": patientType,
        "PatientID": patientId,
        "FirstName": firstName,
        "MiddleName": middleName,
        "LastName": lastName,
        "FirstNameN": firstNameN,
        "MiddleNameN": middleNameN,
        "LastNameN": lastNameN,
        "RelationshipID": relationshipId,
        "Gender": gender,
        "DateofBirth": dateofBirth,
        "DateofBirthN": dateofBirthN,
        "NationalityID": nationalityId,
        "PhoneResi": phoneResi,
        "PhoneOffice": phoneOffice,
        "MobileNumber": mobileNumber,
        "FaxNumber": faxNumber,
        "EmailAddress": emailAddress,
        "BloodGroup": bloodGroup,
        "RHFactor": rhFactor,
        "IsEmailAlertRequired": isEmailAlertRequired,
        "IsSMSAlertRequired": isSmsAlertRequired,
        "PreferredLanguage": preferredLanguage,
        "IsPrivilegedMember": isPrivilegedMember,
        "MemberID": memberId,
        "ExpiryDate": expiryDate,
        "IsHmgEmployee": isHmgEmployee,
        "EmployeeID": employeeId,
        "EmergencyContactName": emergencyContactName,
        "EmergencyContactNo": emergencyContactNo,
        "PatientPayType": patientPayType,
        "DHCCPatientRefID": dhccPatientRefId,
        "IsPatientDummy": isPatientDummy,
        "Status": status,
        "IsStatusCleared": isStatusCleared,
        "PatientIdentificationType": patientIdentificationType,
        "PatientIdentificationNo": patientIdentificationNo,
        "ProjectID": projectId,
        "InfoSourceID": infoSourceId,
        "Address": address,
        "Age": age,
        "AgeDesc": ageDesc,
        "AreaID": areaId,
        "CRSVerificationStatus": crsVerificationStatus,
        "CRSVerificationStatusDesc": crsVerificationStatusDesc,
        "CRSVerificationStatusDescN": crsVerificationStatusDescN,
        "CreatedBy": createdBy,
        "GenderDescription": genderDescription,
        "HealthIDFromNHICViaVida": healthIdFromNhicViaVida,
        "IR": ir,
        "ISOCityID": isoCityId,
        "ISOCountryID": isoCountryId,
        "IsVerfiedFromNHIC": isVerfiedFromNhic,
        "ListPrivilege": listPrivilege == null ? [] : List<dynamic>.from(listPrivilege!.map((x) => x.toJson())),
        "Marital": marital,
        "OccupationID": occupationId,
        "OutSA": outSa,
        "POBox": poBox,
        "ReceiveHealthSummaryReport": receiveHealthSummaryReport,
        "SourceType": sourceType,
        "StrDateofBirth": strDateofBirth,
        "TempAddress": tempAddress,
        "ZipCode": zipCode,
        "eHealthIDField": eHealthIdField,
        "patientPayType": authenticatedUserPatientPayType,
        "patientType": authenticatedUserPatientType,
        "status": authenticatedUserStatus,
        "superUser": superUser,
        "isParentUser": isParentUser,
      };
}

class ListPrivilege {
  int? id;
  String? serviceName;
  bool? previlege;
  dynamic region;

  ListPrivilege({
    this.id,
    this.serviceName,
    this.previlege,
    this.region,
  });

  factory ListPrivilege.fromRawJson(String str) => ListPrivilege.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory ListPrivilege.fromJson(Map<String, dynamic> json) => ListPrivilege(
        id: json["ID"],
        serviceName: json["ServiceName"],
        previlege: json["Previlege"],
        region: json["Region"],
      );

  Map<String, dynamic> toJson() => {
        "ID": id,
        "ServiceName": serviceName,
        "Previlege": previlege,
        "Region": region,
      };
}
