import 'dart:convert';

import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart';

class CheckActivationCode {
  dynamic date;
  int? languageId;
  int? serviceName;
  dynamic time;
  dynamic androidLink;
  String? authenticationTokenId;
  dynamic data;
  bool? dataw;
  int? dietType;
  int? dietTypeId;
  dynamic errorCode;
  dynamic errorEndUserMessage;
  dynamic errorEndUserMessageN;
  dynamic errorMessage;
  int? errorStatusCode;
  int? errorType;
  int? foodCategory;
  dynamic iosLink;
  bool? isAuthenticated;
  int? mealOrderStatus;
  int? mealType;
  int? messageStatus;
  int? numberOfResultRecords;
  dynamic patientBlodType;
  dynamic successMsg;
  dynamic successMsgN;
  dynamic vidaUpdatedResponse;
  dynamic doctorInformationList;
  dynamic getAllPendingRecordsList;
  dynamic getAllSharedRecordsByStatusList;
  dynamic getMaritalstatusLst;
  dynamic getOccupationLst;
  dynamic getResponseFileList;
  dynamic hisPatientModelVpPortal;
  bool? isHmgPatient;
  bool? isLoginSuccessfully;
  bool? isNeedUpdateIdintificationNo;
  bool? isPatientAuthorized;
  bool? isVidaPlus;
  bool? kioskSendSms;
  List<AuthenticatedUser>? list;
  dynamic listAskHabibMobileLoginInfo;
  dynamic listAskHabibPatientFile;
  dynamic listFamilyRelationships;
  dynamic listMergeFiles;
  dynamic listMobileLoginInfo;
  dynamic listPatientCount;
  dynamic logInTokenId;
  dynamic mohemmPrivilegeList;
  int? pateintId;
  dynamic patientBloodType;
  dynamic patientErAdminDriverFileList;
  dynamic patientErAdminFile;
  dynamic patientErDriverFile;
  dynamic patientErDriverFileList;
  bool? patientHasFile;
  dynamic patientMergedIDs;
  bool? patientOutSa;
  int? patientShareRequestId;
  int? patientType;
  int? projectIdOut;
  dynamic returnMessage;
  bool? smsLoginRequired;
  dynamic servicePrivilegeList;
  dynamic sharePatientName;
  bool? userAccountIsActivated;
  dynamic verificationCode;
  dynamic email;
  dynamic errorList;
  bool? hasFile;
  bool? isActiveCode;
  bool? isMerged;
  bool? isNeedUserAgreement;
  bool? isSmsSent;
  dynamic memberList;
  dynamic message;
  int? statusCode;

  CheckActivationCode({
    this.date,
    this.languageId,
    this.serviceName,
    this.time,
    this.androidLink,
    this.authenticationTokenId,
    this.data,
    this.dataw,
    this.dietType,
    this.dietTypeId,
    this.errorCode,
    this.errorEndUserMessage,
    this.errorEndUserMessageN,
    this.errorMessage,
    this.errorStatusCode,
    this.errorType,
    this.foodCategory,
    this.iosLink,
    this.isAuthenticated,
    this.mealOrderStatus,
    this.mealType,
    this.messageStatus,
    this.numberOfResultRecords,
    this.patientBlodType,
    this.successMsg,
    this.successMsgN,
    this.vidaUpdatedResponse,
    this.doctorInformationList,
    this.getAllPendingRecordsList,
    this.getAllSharedRecordsByStatusList,
    this.getMaritalstatusLst,
    this.getOccupationLst,
    this.getResponseFileList,
    this.hisPatientModelVpPortal,
    this.isHmgPatient,
    this.isLoginSuccessfully,
    this.isNeedUpdateIdintificationNo,
    this.isPatientAuthorized,
    this.isVidaPlus,
    this.kioskSendSms,
    this.list,
    this.listAskHabibMobileLoginInfo,
    this.listAskHabibPatientFile,
    this.listFamilyRelationships,
    this.listMergeFiles,
    this.listMobileLoginInfo,
    this.listPatientCount,
    this.logInTokenId,
    this.mohemmPrivilegeList,
    this.pateintId,
    this.patientBloodType,
    this.patientErAdminDriverFileList,
    this.patientErAdminFile,
    this.patientErDriverFile,
    this.patientErDriverFileList,
    this.patientHasFile,
    this.patientMergedIDs,
    this.patientOutSa,
    this.patientShareRequestId,
    this.patientType,
    this.projectIdOut,
    this.returnMessage,
    this.smsLoginRequired,
    this.servicePrivilegeList,
    this.sharePatientName,
    this.userAccountIsActivated,
    this.verificationCode,
    this.email,
    this.errorList,
    this.hasFile,
    this.isActiveCode,
    this.isMerged,
    this.isNeedUserAgreement,
    this.isSmsSent,
    this.memberList,
    this.message,
    this.statusCode,
  });

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

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

  factory CheckActivationCode.fromJson(Map<String, dynamic> json) => CheckActivationCode(
    date: json["Date"],
    languageId: json["LanguageID"],
    serviceName: json["ServiceName"],
    time: json["Time"],
    androidLink: json["AndroidLink"],
    authenticationTokenId: json["AuthenticationTokenID"],
    data: json["Data"],
    dataw: json["Dataw"],
    dietType: json["DietType"],
    dietTypeId: json["DietTypeID"],
    errorCode: json["ErrorCode"],
    errorEndUserMessage: json["ErrorEndUserMessage"],
    errorEndUserMessageN: json["ErrorEndUserMessageN"],
    errorMessage: json["ErrorMessage"],
    errorStatusCode: json["ErrorStatusCode"],
    errorType: json["ErrorType"],
    foodCategory: json["FoodCategory"],
    iosLink: json["IOSLink"],
    isAuthenticated: json["IsAuthenticated"],
    mealOrderStatus: json["MealOrderStatus"],
    mealType: json["MealType"],
    messageStatus: json["MessageStatus"],
    numberOfResultRecords: json["NumberOfResultRecords"],
    patientBlodType: json["PatientBlodType"],
    successMsg: json["SuccessMsg"],
    successMsgN: json["SuccessMsgN"],
    vidaUpdatedResponse: json["VidaUpdatedResponse"],
    doctorInformationList: json["DoctorInformation_List"],
    getAllPendingRecordsList: json["GetAllPendingRecordsList"],
    getAllSharedRecordsByStatusList: json["GetAllSharedRecordsByStatusList"],
    getMaritalstatusLst: json["GetMaritalstatusLst"],
    getOccupationLst: json["GetOccupationLst"],
    getResponseFileList: json["GetResponseFileList"],
    hisPatientModelVpPortal: json["HIS_PatientModel_VPPortal"],
    isHmgPatient: json["IsHMGPatient"],
    isLoginSuccessfully: json["IsLoginSuccessfully"],
    isNeedUpdateIdintificationNo: json["IsNeedUpdateIdintificationNo"],
    isPatientAuthorized: json["IsPatientAuthorized"],
    isVidaPlus: json["IsVidaPlus"],
    kioskSendSms: json["KioskSendSMS"],
    list: json["List"] == null ? [] : List<AuthenticatedUser>.from(json["List"]!.map((x) => AuthenticatedUser.fromJson(x))),
    listAskHabibMobileLoginInfo: json["List_AskHabibMobileLoginInfo"],
    listAskHabibPatientFile: json["List_AskHabibPatientFile"],
    listFamilyRelationships: json["List_FamilyRelationships"],
    listMergeFiles: json["List_MergeFiles"],
    listMobileLoginInfo: json["List_MobileLoginInfo"],
    listPatientCount: json["List_PatientCount"],
    logInTokenId: json["LogInTokenID"],
    mohemmPrivilegeList: json["MohemmPrivilege_List"],
    pateintId: json["PateintID"],
    patientBloodType: json["PatientBloodType"],
    patientErAdminDriverFileList: json["PatientER_AdminDriverFileList"],
    patientErAdminFile: json["PatientER_AdminFile"],
    patientErDriverFile: json["PatientER_DriverFile"],
    patientErDriverFileList: json["PatientER_DriverFileList"],
    patientHasFile: json["PatientHasFile"],
    patientMergedIDs: json["PatientMergedIDs"],
    patientOutSa: json["PatientOutSA"],
    patientShareRequestId: json["PatientShareRequestID"],
    patientType: json["PatientType"],
    projectIdOut: json["ProjectIDOut"],
    returnMessage: json["ReturnMessage"],
    smsLoginRequired: json["SMSLoginRequired"],
    servicePrivilegeList: json["ServicePrivilege_List"],
    sharePatientName: json["SharePatientName"],
    userAccountIsActivated: json["UserAccountIsActivated"],
    verificationCode: json["VerificationCode"],
    email: json["email"],
    errorList: json["errorList"],
    hasFile: json["hasFile"],
    isActiveCode: json["isActiveCode"],
    isMerged: json["isMerged"],
    isNeedUserAgreement: json["isNeedUserAgreement"],
    isSmsSent: json["isSMSSent"],
    memberList: json["memberList"],
    message: json["message"],
    statusCode: json["statusCode"],
  );

  Map<String, dynamic> toJson() => {
    "Date": date,
    "LanguageID": languageId,
    "ServiceName": serviceName,
    "Time": time,
    "AndroidLink": androidLink,
    "AuthenticationTokenID": authenticationTokenId,
    "Data": data,
    "Dataw": dataw,
    "DietType": dietType,
    "DietTypeID": dietTypeId,
    "ErrorCode": errorCode,
    "ErrorEndUserMessage": errorEndUserMessage,
    "ErrorEndUserMessageN": errorEndUserMessageN,
    "ErrorMessage": errorMessage,
    "ErrorStatusCode": errorStatusCode,
    "ErrorType": errorType,
    "FoodCategory": foodCategory,
    "IOSLink": iosLink,
    "IsAuthenticated": isAuthenticated,
    "MealOrderStatus": mealOrderStatus,
    "MealType": mealType,
    "MessageStatus": messageStatus,
    "NumberOfResultRecords": numberOfResultRecords,
    "PatientBlodType": patientBlodType,
    "SuccessMsg": successMsg,
    "SuccessMsgN": successMsgN,
    "VidaUpdatedResponse": vidaUpdatedResponse,
    "DoctorInformation_List": doctorInformationList,
    "GetAllPendingRecordsList": getAllPendingRecordsList,
    "GetAllSharedRecordsByStatusList": getAllSharedRecordsByStatusList,
    "GetMaritalstatusLst": getMaritalstatusLst,
    "GetOccupationLst": getOccupationLst,
    "GetResponseFileList": getResponseFileList,
    "HIS_PatientModel_VPPortal": hisPatientModelVpPortal,
    "IsHMGPatient": isHmgPatient,
    "IsLoginSuccessfully": isLoginSuccessfully,
    "IsNeedUpdateIdintificationNo": isNeedUpdateIdintificationNo,
    "IsPatientAuthorized": isPatientAuthorized,
    "IsVidaPlus": isVidaPlus,
    "KioskSendSMS": kioskSendSms,
    "List": list == null ? [] : List<AuthenticatedUser>.from(list!.map((x) => x.toJson())),
    "List_AskHabibMobileLoginInfo": listAskHabibMobileLoginInfo,
    "List_AskHabibPatientFile": listAskHabibPatientFile,
    "List_FamilyRelationships": listFamilyRelationships,
    "List_MergeFiles": listMergeFiles,
    "List_MobileLoginInfo": listMobileLoginInfo,
    "List_PatientCount": listPatientCount,
    "LogInTokenID": logInTokenId,
    "MohemmPrivilege_List": mohemmPrivilegeList,
    "PateintID": pateintId,
    "PatientBloodType": patientBloodType,
    "PatientER_AdminDriverFileList": patientErAdminDriverFileList,
    "PatientER_AdminFile": patientErAdminFile,
    "PatientER_DriverFile": patientErDriverFile,
    "PatientER_DriverFileList": patientErDriverFileList,
    "PatientHasFile": patientHasFile,
    "PatientMergedIDs": patientMergedIDs,
    "PatientOutSA": patientOutSa,
    "PatientShareRequestID": patientShareRequestId,
    "PatientType": patientType,
    "ProjectIDOut": projectIdOut,
    "ReturnMessage": returnMessage,
    "SMSLoginRequired": smsLoginRequired,
    "ServicePrivilege_List": servicePrivilegeList,
    "SharePatientName": sharePatientName,
    "UserAccountIsActivated": userAccountIsActivated,
    "VerificationCode": verificationCode,
    "email": email,
    "errorList": errorList,
    "hasFile": hasFile,
    "isActiveCode": isActiveCode,
    "isMerged": isMerged,
    "isNeedUserAgreement": isNeedUserAgreement,
    "isSMSSent": isSmsSent,
    "memberList": memberList,
    "message": message,
    "statusCode": statusCode,
  };
}

class ListElement {
  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 listPatientPayType;
  dynamic listPatientType;
  dynamic listStatus;

  ListElement({
    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.listPatientPayType,
    this.listPatientType,
    this.listStatus,
  });

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

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

  factory ListElement.fromJson(Map<String, dynamic> json) => ListElement(
    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"],
    listPatientPayType: json["patientPayType"],
    listPatientType: json["patientType"],
    listStatus: json["status"],
  );

  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": listPatientPayType,
    "patientType": listPatientType,
    "status": listStatus,
  };
}
