package technicise.com.doctorimageflipstabilization;

import android.content.Context;
import android.content.SharedPreferences;

import java.util.HashMap;


public class SharedPreferenceClass
{

    // Shared Preferences
    SharedPreferences pref;
    // Editor for Shared preferences
    SharedPreferences.Editor editor;
    // Context
    Context _context;
    // Shared pref mode
    int PRIVATE_MODE = 0;
    // Sharedpref file name
    private static final String PREF_NAME = "AndroidHivePref";
    // All Shared Preferences Keys
    private static final String IS_LOGIN = "IsLoggedIn";
    private static final String IS_Edit = "IS_Edit";
    private static final String IS_USER_DECLINED_PERMISSION = "IS_USER_DECLINED_PERMISSION";
    private static final String KEY_SOCIAL_DATA_AVAILABLE = "KEY_SOCIAL_DATA_AVAILABLE";
    private static final String KEY_SHARED_CHART = "KEY_SHARED_CHART";
    // User name (make variable public to access from outside)
    public static final String KEY_PASSCODE_GLOBAL = "passCodeGlobal";
    public static final String KEY_PASSCODE_LOCAL = "passCodeLocal";
    public static final String KEY_MOBILE_GLOBAL = "MOBILE";
    public static final String KEY_NAME_GLOBAL = "USERNAME";
    public static final String KEY_setCurrentSessionUserFullName = "setCurrentSessionUserFullName";
    public static final String KEY_setCurrentSessionPhone = "setCurrentSessionPhone";
    public static final String SET_CURRENT_SESSION_USER_ID = "USERID";
    public static final String SET_setCurrentRecordPictureData = "setCurrentRecordPictureData";
    public static final String SET_setCurrentSessionFullNameAddedStatus = "setCurrentSessionFullNameAddedStatus";
    public static final String SET_setCurrentSessionRecordId = "setCurrentSessionRecordId";
    public static final String SET_USER_LOGIN_TYPE = "SET_USER_LOGIN_TYPE";
    public static final String KEY_VERIFICATION_CODE = "VERIFICATIONCODE";
    public static final String KEY_PATIENT_AGE = "KEY_PATIENT_AGE";
    public static final String KEY_FORGOT_PASSWORD_FLAG = "KEY_FORGOT_PASSWORD_FLAG";
    public static final String KEY_DATE_TIME_FLAG = "KEY_DATE_TIME_FLAG";
    public static final String KEY_HELP_GUIDE_FLAG = "KEY_HELP_GUIDE_FLAG";
    public static final String KEY_SET_LOGIN_TYPE = "LOGIN_TYPE";

////////////////////////////////////////////////////////////////////////////////////////////////////

    public static final String KEY_SET_LOGIN_ID = "LOGIN_ID";
    public static final String KEY_SET_SIGNUP_ID = "KEY_SET_SIGNUP_ID";
    public static final String KEY_setRecordFullName_LOGIN = "setRecordFullName_LOGIN";
    public static final String KEY_setRecordFirstName_LOGIN = "KEY_setRecordFirstName_LOGIN";
    public static final String KEY_setRecordLastName_LOGIN = "KEY_setRecordLastName_LOGIN";
    public static final String KEY_setRecordFullName_SIGNUP = "setRecordFullName_SIGNUP";
    public static final String KEY_PASSWORD_LOGIN = "PASSWORD_LOGIN";
    public static final String KEY_PASSWORD_SIGNUP = "PASSWORD_SIGNUP";
    public static final String KEY_setCurrentSessionGender_LOGIN = "setCurrentSessionGender_LOGIN";
    public static final String KEY_setCurrentSessionGender_SIGNUP = "setCurrentSessionGender_SIGNUP";
    public static final String KEY_EMAIL_LOGIN = "EMAIL_LOGIN";
    public static final String KEY_EMAIL_SIGNUP = "EMAIL_SIGNUP";
    public static final String KEY_PHONE_NO_LOGIN = "PHONE_NO_LOGIN";
    public static final String KEY_PHONE_NO_SIGNUP = "PHONE_NO_SIGNUP";
    public static final String KEY_PATIENT_ADDRESS_LOGIN = "KEY_PATIENT_ADDRESS_LOGIN";
    public static final String KEY_PATIENT_ADDRESS_SIGNUP = "KEY_PATIENT_ADDRESS_SIGNUP";
    public static final String KEY_PATIENT_ADDRESS_STATE_LOGIN = "KEY_PATIENT_ADDRESS_STATE_LOGIN";
    public static final String KEY_PATIENT_ADDRESS_STATE_SIGNUP = "KEY_PATIENT_ADDRESS_STATE_SIGNUP";
    public static final String KEY_setCurrentSessionZip_LOGIN = "setCurrentSessionZip_LOGIN";
    public static final String KEY_setCurrentSessionZip_SIGNUP = "setCurrentSessionZip_SIGNUP";
    public static final String KEY_setCurrentSessionDOB_LOGIN = "setCurrentSessionDOB_LOGIN";
    public static final String KEY_setCurrentSessionDOB_SIGNUP = "setCurrentSessionDOB_SIGNUP";
    public static final String KEY_BLOOD_GROUP_LOGIN  = "KEY_BLOOD_GROUP_LOGIN ";
    public static final String KEY_BLOOD_GROUP_SIGNUP  = "KEY_BLOOD_GROUP_SIGNUP ";
    public static final String KEY_DEPERTMENT_WISE_DOCTOR  = "KEY_DEPERTMENT_WISE_DOCTOR";
    public static final String KEY_NAME_WISE_DOCTOR  = "KEY_NAME_WISE_DOCTOR";
    public static final String KEY_EDIT_EMERGENCY_CONTACT  = "KEY_EDIT_EMERGENCY_CONTACT";
    public static final String KEY_setRecordFirstName_SIGNUP  = "KEY_setRecordFirstName_SIGNUP";
    public static final String KEY_setRecordLastName_SIGNUP  = "KEY_setRecordLastName_SIGNUP";
    public static final String KEY_PATIENT_ADDRESS_LINE1_SIGNUP  = "KEY_PATIENT_ADDRESS_LINE1_SIGNUP";
    public static final String KEY_PATIENT_ADDRESS_LINE2_SIGNUP  = "KEY_PATIENT_ADDRESS_LINE2_SIGNUP";
    public static final String KEY_SET_LOGIN_USER_NAME  = "KEY_SET_LOGIN_USER_NAME";
    public static final String KEY_IMAGE_LOCATION  = "KEY_IMAGE_LOCATION";
    public static final String KEY_IMAGE_NAME  = "KEY_IMAGE_NAME";
    public static final String KEY_IMAGE_FILE_ID  = "KEY_IMAGE_FILE_ID";
    public static final String KEY_IMAGE_BIT_MAP  = "KEY_IMAGE_BIT_MAP";
    public static final String KEY_INSURANCE_IMAGE_BIT_MAP  = "KEY_INSURANCE_IMAGE_BIT_MAP";
    public static final String KEY_DOC_IMAGE_BIT_MAP  = "KEY_DOC_IMAGE_BIT_MAP";
    public static final String KEY_INSURANCE_IMAGE_LOCATION  = "KEY_INSURANCE_IMAGE_LOCATION";
    public static final String KEY_SET_CURRENT_LATITUDE  = "KEY_SET_CURRENT_LATITUDE";
    public static final String KEY_SET_CURRENT_LONGITUDE  = "KEY_SET_CURRENT_LONGITUDE";
    public static final String KEY_SET_Medication_Coded_Value  = "KEY_SET_Medication_Coded_Value";
    public static final String KEY_SET_Medication_Frequency_Value  = "KEY_SET_Medication_Frequency_Value";
    public static final String KEY_SET_Medication_Frequency_Unit  = "KEY_SET_Medication_Frequency_Unit";
    public static final String KEY_SET_Medication_Start_date  = "KEY_SET_Medication_Start_date";
    public static final String KEY_SET_Medication_End_date  = "KEY_SET_Medication_End_date";
    public static final String KEY_SET_Medication_Active_Inactive  = "KEY_SET_Medication_Active_Inactive";
    public static final String KEY_SET_MEDICATIONS_DOSES_FORM  = "KEY_SET_MEDICATIONS_DOSES_FORM";
    public static final String KEY_SET_MEDICATIONS_LIST_DOSES_VALUE  = "KEY_SET_MEDICATIONS_LIST_DOSES_VALUE";
    public static final String KEY_SET_MEDICATIONS_DOSES_VALUE  = "KEY_SET_MEDICATIONS_DOSES_VALUE";
    public static final String KEY_SET_MEDICATIONS_NAME  = "KEY_SET_MEDICATIONS_NAME";
//    public static final String KEY_MEDICATION_REMINDER_FLAG  = "KEY_MEDICATION_REMINDER_FLAG";
    public static final String KEY_DOCTOR_LIST_LOCAL_FLAG  = "KEY_DOCTOR_LIST_LOCAL_FLAG";
    public static final String KEY_HEALTH_PACKAGE_LOCAL_FLAG  = "KEY_HEALTH_PACKAGE_LOCAL_FLAG";
    public static final String KEY_USER_IMAGE_FLAG  = "KEY_USER_IMAGE_FLAG";
    public static final String KEY_DEPARTMENT_LOCAL_FLAG  = "KEY_DEPARTMENT_LOCAL_FLAG";
    public static final String KEY_HOSPITAL_LOCAL_FLAG  = "KEY_HOSPITAL_LOCAL_FLAG";
    public static final String KEY_MEDICATION_Time  = "KEY_MEDICATION_Time";
    public static final String KEY_PATIENT_DETAILS_FLAG  = "KEY_PATIENT_DETAILS_FLAG";
    public static final String KEY_EDIT_INSURANCE_DETAILS  = "KEY_EDIT_INSURANCE_DETAILS";
    public static final String KEY_SKIP_INSURANCE_DETAILS  = "KEY_SKIP_INSURANCE_DETAILS";
    public static final String KEY_PROVIDER_NAME  = "KEY_PROVIDER_NAME";
    public static final String KEY_TPA_NAME  = "KEY_TPA_NAME";
    public static final String KEY_INSURANCE_NUMBER  = "KEY_INSURANCE_NUMBER";
    public static final String KEY_INSURANCE_START_DATE  = "KEY_INSURANCE_START_DATE";
    public static final String KEY_INSURANCE_VALIDITY  = "KEY_INSURANCE_VALIDITY";
    public static final String KEY_INSURANCE_ImageFid  = "KEY_INSURANCE_ImageFid";


    ////////////////////////////////////////////////////////////////////////////////////////////////

    public static boolean IS_PASSCODE_SET = false;

    public SharedPreferenceClass(Context context)
    {
        this._context = context;
        pref = _context.getSharedPreferences(PREF_NAME, 0);
        editor = pref.edit();
    }

    /**
     * Create PASSCODE SESSION FOR THE FIRST TIME
     * */
    public void createPasscodeSession(String passCodeGlobal, String passCodeLocal)
    {
        editor.putString(KEY_PASSCODE_GLOBAL, passCodeGlobal);
        editor.putString(KEY_PASSCODE_LOCAL, passCodeLocal);
        editor.putBoolean(IS_LOGIN, true);
        // commit changes
        editor.commit();
    }

    public void setSocialDataAvailable(boolean yesOrNo)
    {
        editor.remove(KEY_SOCIAL_DATA_AVAILABLE);
        editor.putBoolean(KEY_SOCIAL_DATA_AVAILABLE, yesOrNo);
        // commit changes
        editor.commit();
    }
    public boolean getSocialDataAvailable()
    {
        return   pref.getBoolean(KEY_SOCIAL_DATA_AVAILABLE, false);
    }

    public void setDidUSerEdit(boolean yesOrNo)
    {
        editor.remove(IS_Edit);
        editor.putBoolean(IS_Edit, yesOrNo);
        // commit changes
        editor.commit();
    }

    public boolean getDidUSerEdit()
    {
        return   pref.getBoolean(IS_Edit, false);
    }

    public void setUserStoragePermissionRequestCount(int count)
    {
        editor.putInt(IS_USER_DECLINED_PERMISSION, count);
        // commit changes
        editor.commit();
    }

    public int getUserStoragePermissionRequestCount()
    {
        try
        {
            return pref.getInt(IS_USER_DECLINED_PERMISSION,0);
        }
        catch (NullPointerException e)
        {
            return 0;
        }

    }

    public HashMap<String, String> getPassCodeDetails()
    {
        HashMap<String, String> user = new HashMap<String, String>();

        user.put(KEY_PASSCODE_GLOBAL, pref.getString(KEY_PASSCODE_GLOBAL, null));

        user.put(KEY_PASSCODE_LOCAL, pref.getString(KEY_PASSCODE_LOCAL, null));

        // return user
        return user;
    }

    public void reCreatePasscodeSession( String passCodeLocal){
        // Storing email in pref
        editor.putString(KEY_PASSCODE_LOCAL, passCodeLocal);
        // commit changes
        editor.commit();
    }

    public void clearPasscodeSession() {
        editor.remove(KEY_PASSCODE_LOCAL);
        // commit changes
        editor.commit();
    }


    public void clearEntirePasscodeSession()
    {
        editor.remove(KEY_PASSCODE_LOCAL);
        editor.remove(KEY_PASSCODE_GLOBAL);
        editor.commit();
    }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public void setLoginUserId(String setLoginUserId)
    {
        editor.remove(KEY_SET_LOGIN_ID);
        editor.putString(KEY_SET_LOGIN_ID, setLoginUserId);
        editor.commit();
    }

    public String getLoginUserId()
    {
        String getLoginUserId= pref.getString(KEY_SET_LOGIN_ID, null);
        return getLoginUserId;
    }

    public void setLoginUsername(String setLoginUsername)
    {
        editor.remove(KEY_SET_LOGIN_USER_NAME);
        editor.putString(KEY_SET_LOGIN_USER_NAME, setLoginUsername);
        editor.commit();
    }

    public String getLoginUsername()
    {
        String getLoginUsername= pref.getString(KEY_SET_LOGIN_USER_NAME, null);
        return getLoginUsername;
    }



    public void setSignUpUserId(String setSignUpUserId)
    {
        editor.remove(KEY_SET_SIGNUP_ID);
        editor.putString(KEY_SET_SIGNUP_ID, setSignUpUserId);
        editor.commit();
    }

    public String getSignUpUserId()
    {
        String getSignUpUserId= pref.getString(KEY_SET_SIGNUP_ID, null);
        return getSignUpUserId;
    }


    public void setLoginRecordFullName(String setLoginRecordFullName)
    {
        editor.remove(KEY_setRecordFullName_LOGIN);
        editor.putString(KEY_setRecordFullName_LOGIN, setLoginRecordFullName);
        editor.commit();
    }

    public String getLoginRecordFullName()
    {
        String getLoginRecordFullName = pref.getString(KEY_setRecordFullName_LOGIN, null);
        return getLoginRecordFullName;
    }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public void setLoginfirstName(String setLoginfirstName)
    {
        editor.remove(KEY_setRecordFirstName_LOGIN);
        editor.putString(KEY_setRecordFirstName_LOGIN, setLoginfirstName);
        editor.commit();
    }

    public String getLoginfirstName()
    {
        String getLoginfirstName = pref.getString(KEY_setRecordFirstName_LOGIN, null);
        return getLoginfirstName;
    }


    public void setLoginLastName(String setLoginLastName)
    {
        editor.remove(KEY_setRecordLastName_LOGIN);
        editor.putString(KEY_setRecordLastName_LOGIN, setLoginLastName);
        editor.commit();
    }

    public String getLoginLastName()
    {
        String getLoginLastName = pref.getString(KEY_setRecordLastName_LOGIN, null);
        return getLoginLastName;
    }

    //--------------
    public void setImageLocation(String setImageLocation)
    {
        editor.remove(KEY_IMAGE_LOCATION);
        editor.putString(KEY_IMAGE_LOCATION, setImageLocation);
        editor.commit();
    }

    public String getImageLocation()
    {
        String getImageLocation = pref.getString(KEY_IMAGE_LOCATION, null);
        return getImageLocation;
    }
    public void setImageName(String setImageName)
    {
        editor.remove(KEY_IMAGE_NAME);
        editor.putString(KEY_IMAGE_NAME, setImageName);
        editor.commit();
    }

    public String getImageName()
    {
        String getImageName = pref.getString(KEY_IMAGE_NAME, null);
        return getImageName;
    }
    public void setImageFid(String setImageFid)
    {
        editor.remove(KEY_IMAGE_FILE_ID);
        editor.putString(KEY_IMAGE_FILE_ID, setImageFid);
        editor.commit();
    }

    public String getImageFid()
    {
        String getImageFid = pref.getString(KEY_IMAGE_FILE_ID, null);
        return getImageFid;
    }
    public void setImageBitMap(String setImageBitMap)
    {
        editor.remove(KEY_IMAGE_BIT_MAP);
        editor.putString(KEY_IMAGE_BIT_MAP, setImageBitMap);
        editor.commit();
    }

    public String getImageBitMap()
    {
        String getImageBitMap = pref.getString(KEY_IMAGE_BIT_MAP, null);
        return getImageBitMap;
    }

    public void setInsuranceImageBitMap(String setInsuranceImageBitMap)
    {
        editor.remove(KEY_INSURANCE_IMAGE_BIT_MAP);
        editor.putString(KEY_INSURANCE_IMAGE_BIT_MAP, setInsuranceImageBitMap);
        editor.commit();
    }

    public String getInsuranceImageBitMap()
    {
        String getInsuranceImageBitMap = pref.getString(KEY_INSURANCE_IMAGE_BIT_MAP, null);
        return getInsuranceImageBitMap;
    }

    public void setDocImageBitMap(String setDocImageBitMap)
    {
        editor.remove(KEY_DOC_IMAGE_BIT_MAP);
        editor.putString(KEY_DOC_IMAGE_BIT_MAP, setDocImageBitMap);
        editor.commit();
    }

    public String getDocImageBitMap()
    {
        String getDocImageBitMap = pref.getString(KEY_DOC_IMAGE_BIT_MAP, null);
        return getDocImageBitMap;
    }

    public void setInsuranceImageLocation(String setInsuranceImageLocation)
    {
        editor.remove(KEY_INSURANCE_IMAGE_LOCATION);
        editor.putString(KEY_INSURANCE_IMAGE_LOCATION, setInsuranceImageLocation);
        editor.commit();
    }

    public String getInsuranceImageLocation()
    {
        String getInsuranceImageLocation = pref.getString(KEY_INSURANCE_IMAGE_LOCATION, null);
        return getInsuranceImageLocation;
    }

    //FOR SEARCHING BY LAT/LONG
    public void setCurrentLatitude(String setCurrentLatitude)
    {
        editor.putString(KEY_SET_CURRENT_LATITUDE, setCurrentLatitude);
        editor.commit();
    }
    //FOR SEARCHING BY LAT/LONG
    public String getCurrentLatitude()
    {
        return pref.getString(KEY_SET_CURRENT_LATITUDE, null);
    }

    //FOR SEARCHING BY LAT/LONG
    public void setCurrentLongitude(String setCurrentLongitude)
    {
        editor.putString(KEY_SET_CURRENT_LONGITUDE, setCurrentLongitude);
        editor.commit();
    }
    //FOR SEARCHING BY LAT/LONG
    public String getCurrentLongitude()
    {
        return pref.getString(KEY_SET_CURRENT_LONGITUDE, null);
    }



    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////


    public void setSignupRecordFullName(String setSignupRecordFullName)
    {
        editor.remove(KEY_setRecordFullName_SIGNUP);
        editor.putString(KEY_setRecordFullName_SIGNUP, setSignupRecordFullName);
        editor.commit();
    }

    public String getSignupRecordFullName()
    {
        String getSignupRecordFullName = pref.getString(KEY_setRecordFullName_SIGNUP, null);
        return getSignupRecordFullName;
    }

   public void setSignupRecordFirstName(String setSignupRecordFirstName)
    {
        editor.remove(KEY_setRecordFirstName_SIGNUP);
        editor.putString(KEY_setRecordFirstName_SIGNUP, setSignupRecordFirstName);
        editor.commit();
    }

    public String getSignupRecordFirstName()
    {
        String getSignupRecordFirstName = pref.getString(KEY_setRecordFirstName_SIGNUP, null);
        return getSignupRecordFirstName;
    }


    public void setSignupRecordLastName(String setSignupRecordLastName)
    {
        editor.remove(KEY_setRecordLastName_SIGNUP);
        editor.putString(KEY_setRecordLastName_SIGNUP, setSignupRecordLastName);
        editor.commit();
    }

    public String getSignupRecordLastName()
    {
        String getSignupRecordLastName = pref.getString(KEY_setRecordLastName_SIGNUP, null);//
        return getSignupRecordLastName;
    }




    public void setLoginPassword(String setLoginPassword)

    {
        editor.remove(KEY_PASSWORD_LOGIN);
        editor.putString(KEY_PASSWORD_LOGIN, setLoginPassword);
        editor.commit();

    }
    public String getLoginPassword()
    {
        String getLoginPassword= pref.getString(KEY_PASSWORD_LOGIN, null);
        return getLoginPassword;
    }

    public void setSignupPassword(String setSignupPassword)

    {
        editor.remove(KEY_PASSWORD_SIGNUP);
        editor.putString(KEY_PASSWORD_SIGNUP, setSignupPassword);
        editor.commit();

    }
    public String getSignupPassword()
    {
        String getSignupPassword= pref.getString(KEY_PASSWORD_SIGNUP, null);
        return getSignupPassword;
    }

    public void setLoginCurrentSessionGender(String setLoginCurrentSessionGender)//current user gender..................
    {
        editor.remove(KEY_setCurrentSessionGender_LOGIN );
        editor.putString(KEY_setCurrentSessionGender_LOGIN , setLoginCurrentSessionGender);
        editor.commit();
    }

    public String getLoginCurrentSessionGender()
    {
        String getLoginCurrentSessionGender= pref.getString(KEY_setCurrentSessionGender_LOGIN , null);
        return getLoginCurrentSessionGender;
    }

    public void setSignupCurrentSessionGender(String setSignupCurrentSessionGender)//current user gender..................
    {
        editor.remove(KEY_setCurrentSessionGender_SIGNUP);
        editor.putString(KEY_setCurrentSessionGender_SIGNUP, setSignupCurrentSessionGender);
        editor.commit();
    }

    public String getSignupCurrentSessionGender()
    {
        String getSignupCurrentSessionGender= pref.getString(KEY_setCurrentSessionGender_SIGNUP, null);
        return getSignupCurrentSessionGender;
    }

    public void setLoginUserEmail(String setLoginUserEmail)
    {
        editor.remove(KEY_EMAIL_LOGIN);
        editor.putString(KEY_EMAIL_LOGIN, setLoginUserEmail);
        editor.commit();
    }

    public String getLoginUserEmail()
    {
        String getLoginUserEmail= pref.getString(KEY_EMAIL_LOGIN, null);
        return getLoginUserEmail;
    }

    public void setSignupUserEmail(String setSignupUserEmail)
    {
        editor.remove(KEY_EMAIL_SIGNUP);
        editor.putString(KEY_EMAIL_SIGNUP, setSignupUserEmail);
        editor.commit();
    }

    public String getSignupUserEmail()
    {
        String getSignupUserEmail= pref.getString(KEY_EMAIL_SIGNUP, null);
        return getSignupUserEmail;
    }

    public void setLoginUserPhoneNo(String setLoginUserPhoneNo)
    {
        editor.remove(KEY_PHONE_NO_LOGIN);
        editor.putString(KEY_PHONE_NO_LOGIN, setLoginUserPhoneNo);
        editor.commit();
    }

    public String getLoginUserPhoneNo()
    {
        String getLoginUserPhoneNo= pref.getString(KEY_PHONE_NO_LOGIN, null);
        return getLoginUserPhoneNo;
    }

    public void setSignupUserPhoneNo(String setSignupUserPhoneNo)
    {
        editor.remove(KEY_PHONE_NO_SIGNUP);
        editor.putString(KEY_PHONE_NO_SIGNUP, setSignupUserPhoneNo);
        editor.commit();
    }

    public String getSignupUserPhoneNo()
    {
        String getSignupUserPhoneNo= pref.getString(KEY_PHONE_NO_SIGNUP, null);
        return getSignupUserPhoneNo;
    }

    public void setLoginPatientAddress(String setLoginPatientAddress)

    {
        editor.remove(KEY_PATIENT_ADDRESS_LOGIN );
        editor.putString(KEY_PATIENT_ADDRESS_LOGIN , setLoginPatientAddress);
        editor.commit();

    }
    public String getLoginPatientAddress()
    {
        String getLoginPatientAddress= pref.getString(KEY_PATIENT_ADDRESS_LOGIN , null);
        return getLoginPatientAddress;
    }

    public void setSignupPatientAddress(String setSignupPatientAddress)

    {
        editor.remove(KEY_PATIENT_ADDRESS_SIGNUP);
        editor.putString(KEY_PATIENT_ADDRESS_SIGNUP, setSignupPatientAddress);
        editor.commit();

    }
    public String getSignupPatientAddress()
    {
        String getSignupPatientAddress= pref.getString(KEY_PATIENT_ADDRESS_SIGNUP, null);
        return getSignupPatientAddress;
    }

    public void setSignupPatientAddressLine1(String setSignupPatientAddressLine1)

    {
        editor.remove(KEY_PATIENT_ADDRESS_LINE1_SIGNUP);
        editor.putString(KEY_PATIENT_ADDRESS_LINE1_SIGNUP, setSignupPatientAddressLine1);
        editor.commit();

    }
    public String getSignupPatientAddressLine1()
    {
        String getSignupPatientAddressLine1= pref.getString(KEY_PATIENT_ADDRESS_LINE1_SIGNUP, null);
        return getSignupPatientAddressLine1;
    }


    public void setSignupPatientAddressLine2(String setSignupPatientAddressLine2)

    {
        editor.remove(KEY_PATIENT_ADDRESS_LINE2_SIGNUP);
        editor.putString(KEY_PATIENT_ADDRESS_LINE2_SIGNUP, setSignupPatientAddressLine2);
        editor.commit();

    }
    public String getSignupPatientAddressLine2()
    {
        String getSignupPatientAddressLine2= pref.getString(KEY_PATIENT_ADDRESS_LINE2_SIGNUP, null);
        return getSignupPatientAddressLine2;
    }



    public void setLoginPatientAddressState(String setLoginPatientAddressState)

    {
        editor.remove(KEY_PATIENT_ADDRESS_STATE_LOGIN);
        editor.putString(KEY_PATIENT_ADDRESS_STATE_LOGIN, setLoginPatientAddressState);
        editor.commit();

    }
    public String getLoginPatientAddressState()
    {
        String getLoginPatientAddressState= pref.getString(KEY_PATIENT_ADDRESS_STATE_LOGIN, null);
        return getLoginPatientAddressState;
    }

    public void setSignupPatientAddressState(String setSignupPatientAddressState)

    {
        editor.remove(KEY_PATIENT_ADDRESS_STATE_SIGNUP);
        editor.putString(KEY_PATIENT_ADDRESS_STATE_SIGNUP, setSignupPatientAddressState);
        editor.commit();

    }
    public String getSignupPatientAddressState()
    {
        String getSignupPatientAddressState= pref.getString(KEY_PATIENT_ADDRESS_STATE_SIGNUP, null);
        return getSignupPatientAddressState;
    }

    public void setLoginCurrentSessionZip(String setLoginCurrentSessionZip)//current user zip..................
    {
        editor.remove(KEY_setCurrentSessionZip_LOGIN);
        editor.putString(KEY_setCurrentSessionZip_LOGIN, setLoginCurrentSessionZip);
        editor.commit();
    }

    public String getLoginCurrentSessionZip()
    {
        String getLoginCurrentSessionZip= pref.getString(KEY_setCurrentSessionZip_LOGIN, null);
        return getLoginCurrentSessionZip;
    }

    public void setSignupCurrentSessionZip(String setSignupCurrentSessionZip)//current user zip..................
    {
        editor.remove(KEY_setCurrentSessionZip_SIGNUP);
        editor.putString(KEY_setCurrentSessionZip_SIGNUP, setSignupCurrentSessionZip);
        editor.commit();
    }

    public String getSignupCurrentSessionZip()
    {
        String getSignupCurrentSessionZip= pref.getString(KEY_setCurrentSessionZip_SIGNUP, null);
        return getSignupCurrentSessionZip;
    }

    public void set_LoginCurrentSessionDOB(String set_LoginCurrentSessionDOB)//current user dob..................
    {
        editor.remove(KEY_setCurrentSessionDOB_LOGIN );
        editor.putString(KEY_setCurrentSessionDOB_LOGIN , set_LoginCurrentSessionDOB);
        editor.commit();
    }

    public String get_LoginCurrentSessionDOB()
    {
        String get_LoginCurrentSessionDOB= pref.getString(KEY_setCurrentSessionDOB_LOGIN , null);
        return get_LoginCurrentSessionDOB;
    }

    public void set_SignupCurrentSessionDOB(String set_SignupCurrentSessionDOB)//current user dob..................
    {
        editor.remove(KEY_setCurrentSessionDOB_SIGNUP);
        editor.putString(KEY_setCurrentSessionDOB_SIGNUP, set_SignupCurrentSessionDOB);
        editor.commit();
    }

    public String get_SignupCurrentSessionDOB()
    {
        String get_SignupCurrentSessionDOB= pref.getString(KEY_setCurrentSessionDOB_SIGNUP, null);
        return get_SignupCurrentSessionDOB;
    }

    public void setLoginBloodgrp(String setLoginBloodgrp)

    {
        editor.remove(KEY_BLOOD_GROUP_LOGIN);
        editor.putString(KEY_BLOOD_GROUP_LOGIN, setLoginBloodgrp);
        editor.commit();

    }
    public String getLoginBloodgrp()
    {
        String getLoginBloodgrp= pref.getString(KEY_BLOOD_GROUP_LOGIN, null);
        return getLoginBloodgrp;
    }

    public void setSignupBloodgrp(String setSignupBloodgrp)

    {
        editor.remove(KEY_BLOOD_GROUP_SIGNUP);
        editor.putString(KEY_BLOOD_GROUP_SIGNUP, setSignupBloodgrp);
        editor.commit();

    }
    public String getSignupBloodgrp()
    {
        String getSignupBloodgrp= pref.getString(KEY_BLOOD_GROUP_SIGNUP, null);
        return getSignupBloodgrp;
    }


    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




    public void setUserLoginType(String setUserLoginType)
    {
        editor.remove(SET_USER_LOGIN_TYPE);
        editor.putString(SET_USER_LOGIN_TYPE, setUserLoginType);
        editor.commit();

    }

    public String getUserLoginType()
    {
        String getUserLoginType= pref.getString(SET_USER_LOGIN_TYPE, null);
        return getUserLoginType;
    }



    public void setCurrentSessionFullNameAddedStatus(String setCurrentSessionFullNameAddedStatus)
    {
        editor.remove(SET_setCurrentSessionFullNameAddedStatus);
        editor.putString(SET_setCurrentSessionFullNameAddedStatus, setCurrentSessionFullNameAddedStatus);
        editor.commit();

    }
    public String getCurrentSessionFullNameAddedStatus()
    {
        String setCurrentSessionFullNameAddedStatus= pref.getString(SET_setCurrentSessionFullNameAddedStatus, null);
        return setCurrentSessionFullNameAddedStatus;
    }



    public void setCurrentSessionRecordId(String setCurrentSessionRecordId)
    {
        editor.remove(SET_setCurrentSessionRecordId);
        editor.putString(SET_setCurrentSessionRecordId, setCurrentSessionRecordId);
        editor.commit();

    }
    public String getCurrentSessionRecordId()
    {
        String setCurrentSessionRecordId= pref.getString(SET_setCurrentSessionRecordId, null);
        return setCurrentSessionRecordId;
    }

    public void setCurrentSessionFullName(String setCurrentSessionUserFullName)//current user full name..................
    {
        editor.remove(KEY_setCurrentSessionUserFullName);
        editor.putString(KEY_setCurrentSessionUserFullName, setCurrentSessionUserFullName);
        editor.commit();
    }

    public String getCurrentSessionFullName()
    {
        String setCurrentSessionGender= pref.getString(KEY_setCurrentSessionUserFullName, null);
        return setCurrentSessionGender;
    }

    public void setCurrentSessionPhone(String setCurrentSessionPhone)//current user phone..................
    {
        editor.remove(KEY_setCurrentSessionPhone);
        editor.putString(KEY_setCurrentSessionPhone, setCurrentSessionPhone);
        editor.commit();
    }

    public String getCurrentSessionPhone()
    {
        String setCurrentSessionPhone= pref.getString(KEY_setCurrentSessionPhone, null);
        return setCurrentSessionPhone;
    }

    public void setCurrentSessionUserId(String id)
    {
        editor.remove(SET_CURRENT_SESSION_USER_ID);
        editor.putString(SET_CURRENT_SESSION_USER_ID, id);
        editor.commit();

    }

    public String getCurrentSessionUserId()
    {
        String id= pref.getString(SET_CURRENT_SESSION_USER_ID, null);
        return id;
    }


    public void setUserPhone(String phone)
    {
        editor.remove(KEY_MOBILE_GLOBAL);
        editor.putString(KEY_MOBILE_GLOBAL, phone);
        editor.commit();
    }

    public String getUserPhone()
    {
        String phone= pref.getString(KEY_MOBILE_GLOBAL, null);
        return phone;
    }

    public void setUserName(String username)
    {
        editor.remove(KEY_NAME_GLOBAL);
        editor.putString(KEY_NAME_GLOBAL, username);
        editor.commit();
    }

    public String getUserName()
    {
        String username= pref.getString(KEY_NAME_GLOBAL, null);
        return username;
    }




    public void setVerificationCode(String verificationCode)

    {
        editor.remove(KEY_VERIFICATION_CODE);
        editor.putString(KEY_VERIFICATION_CODE, verificationCode);
        editor.commit();

    }
    public String getVerificationCode()
    {
        String verificationCode= pref.getString(KEY_VERIFICATION_CODE, null);
        return verificationCode;
    }

    public void setPatientAge(String patientAge)

    {
        editor.remove(KEY_PATIENT_AGE);
        editor.putString(KEY_PATIENT_AGE, patientAge);
        editor.commit();

    }
    public String getPatientAge()
    {
        String PatientAge= pref.getString(KEY_PATIENT_AGE, null);
        return PatientAge;
    }


//////////////////////////////////////////////////////////////////
    public void setDepartmentWiseDoctor(String DepartmentWiseDoctorFlag)

    {
        editor.remove(KEY_DEPERTMENT_WISE_DOCTOR);
        editor.putString(KEY_DEPERTMENT_WISE_DOCTOR, DepartmentWiseDoctorFlag);
        editor.commit();

    }

    public String getDepartmentWiseDoctor()
    {
        String DepartmentWiseDoctorFlag= pref.getString(KEY_DEPERTMENT_WISE_DOCTOR, null);
        return DepartmentWiseDoctorFlag;
    }

    public void setNameWiseDoctor(String NameWiseDoctor)

    {
        editor.remove(KEY_NAME_WISE_DOCTOR);
        editor.putString(KEY_NAME_WISE_DOCTOR, NameWiseDoctor);
        editor.commit();

    }

    public String getNameWiseDoctor()
    {
        String NameWiseDoctorFlag= pref.getString(KEY_NAME_WISE_DOCTOR, null);
        return NameWiseDoctorFlag;
    }




    public void setEditEmergencyContact(String EditEmergencyContact)

    {
        editor.remove(KEY_EDIT_EMERGENCY_CONTACT);
        editor.putString(KEY_EDIT_EMERGENCY_CONTACT, EditEmergencyContact);
        editor.commit();

    }

    public String getEditEmergencyContact()
    {
        String EditEmergencyContactFlag= pref.getString(KEY_EDIT_EMERGENCY_CONTACT, null);
        return EditEmergencyContactFlag;
    }

    public void setEditInsuranceDetails(String EditInsuranceDetails)

    {
        editor.remove(KEY_EDIT_INSURANCE_DETAILS);
        editor.putString(KEY_EDIT_INSURANCE_DETAILS, EditInsuranceDetails);
        editor.commit();

    }

    public String getEditInsuranceDetails()
    {
        String EditInsuranceDetailsFlag= pref.getString(KEY_EDIT_INSURANCE_DETAILS, null);
        return EditInsuranceDetailsFlag;
    }

    public void setSkipInsuranceDetails(String SkipInsuranceDetails)

    {
        editor.remove(KEY_SKIP_INSURANCE_DETAILS);
        editor.putString(KEY_SKIP_INSURANCE_DETAILS, SkipInsuranceDetails);
        editor.commit();

    }

    public String getSkipInsuranceDetails()
    {
        String SkipInsuranceDetailsFlag= pref.getString(KEY_SKIP_INSURANCE_DETAILS, null);
        return SkipInsuranceDetailsFlag;
    }




//////////////////////////////////////////////////
    public void setKeyForgotPasswordFlag(String ForgotPasswordFlag)

    {
        editor.remove(KEY_FORGOT_PASSWORD_FLAG);
        editor.putString(KEY_FORGOT_PASSWORD_FLAG, ForgotPasswordFlag);
        editor.commit();

    }
    public String getForgotPasswordFlag()
    {
        String ForgotPasswordFlag= pref.getString(KEY_FORGOT_PASSWORD_FLAG, null);
        return ForgotPasswordFlag;
    }//

    public void setKeyDateTimeFlag(String KeyDateTimeFlag)
    {
        editor.remove(KEY_DATE_TIME_FLAG);
        editor.putString(KEY_DATE_TIME_FLAG, KeyDateTimeFlag);
        editor.commit();

    }
    public String getKeyDateTimeFlag()
    {
        String KeyDateTimeFlag= pref.getString(KEY_DATE_TIME_FLAG, null);
        return KeyDateTimeFlag;
    }



    public void sethelpguideFlag(String helpguideFlag)
    {
        editor.remove(KEY_HELP_GUIDE_FLAG);
        editor.putString(KEY_HELP_GUIDE_FLAG, helpguideFlag);
        editor.commit();

    }
    public String gethelpguideFlag()
    {
        String helpguideFlag= pref.getString(KEY_HELP_GUIDE_FLAG, null);
        return helpguideFlag;
    }


    public void setCurrentRecordPictureData(String id)
    {
        editor.remove(SET_setCurrentRecordPictureData);
        editor.putString(SET_setCurrentRecordPictureData, id);
        editor.commit();

    }
    public String getCurrentRecordPictureData()
    {
        String id= pref.getString(SET_setCurrentRecordPictureData, null);
        return id;
    }

    public void setLoginType(String ProviderLoginType)
    {
        editor.putString(KEY_SET_LOGIN_TYPE, ProviderLoginType);
        editor.commit();

    }
    public String getLoginType()
    {
        String  getLoginType = pref.getString(KEY_SET_LOGIN_TYPE, null);
        return  getLoginType;
    }

    public void setSeletedMedicatonCodedValue(String setSeletedMedicatonCodedValue)
    {
        editor.putString(KEY_SET_Medication_Coded_Value, setSeletedMedicatonCodedValue);
        editor.commit();
    }
    public String getSeletedMedicatonCodedValue()
    {
        return pref.getString(KEY_SET_Medication_Coded_Value, null);
    }


    public void setMedicatonFrequencyValue(String setMedicatonFrequencyValue)
    {
        editor.putString(KEY_SET_Medication_Frequency_Value, setMedicatonFrequencyValue);
        editor.commit();
    }
    public String getMedicatonFrequencyValue()
    {
        return pref.getString(KEY_SET_Medication_Frequency_Value, null);
    }

    public void setMedicatonFrequencyUnit(String setMedicatonFrequencyUnit)
    {
        editor.putString(KEY_SET_Medication_Frequency_Unit, setMedicatonFrequencyUnit);
        editor.commit();
    }
    public String getMedicatonFrequencyUnit()
    {
        return pref.getString(KEY_SET_Medication_Frequency_Unit, null);
    }

    public void setMedicatonStartDate(String setMedicatonStartDate)
    {
        editor.putString(KEY_SET_Medication_Start_date, setMedicatonStartDate);
        editor.commit();
    }
    public String getMedicatonStartDate()
    {
        return pref.getString(KEY_SET_Medication_Start_date, null);
    }

    public void setMedicatonEndDate(String setMedicatonEndDate)
    {
        editor.putString(KEY_SET_Medication_End_date, setMedicatonEndDate);
        editor.commit();
    }
    public String getMedicatonEndDate()
    {
        return pref.getString(KEY_SET_Medication_End_date, null);
    }

    public void setMedicatonActiveInactive(String setMedicatonActiveInactive)
    {
        editor.putString(KEY_SET_Medication_Active_Inactive, setMedicatonActiveInactive);
        editor.commit();
    }
    public String getMedicatonActiveInactive()
    {
        return pref.getString(KEY_SET_Medication_Active_Inactive, null);
    }


    public void setMedicationDoesFrom(String MedicationDoesFrom)
    {

        editor.putString(KEY_SET_MEDICATIONS_DOSES_FORM, MedicationDoesFrom);
        editor.commit();
    }
    public String getMedicationDoesFrom()
    {
        return pref.getString(KEY_SET_MEDICATIONS_DOSES_FORM, null);
    }

    public void setMedicationlistDoesValue(String MedicationDoesValue)
    {

        editor.putString(KEY_SET_MEDICATIONS_LIST_DOSES_VALUE, MedicationDoesValue);
        editor.commit();
    }
    public String getMedicationlistDoesValue()
    {
        return pref.getString(KEY_SET_MEDICATIONS_LIST_DOSES_VALUE, null);
    }

    public void setMedicationDoesValue(String MedicationDoesValue)
    {

        editor.putString(KEY_SET_MEDICATIONS_DOSES_VALUE, MedicationDoesValue);
        editor.commit();
    }
    public String getMedicationDoesValue()
    {
        return pref.getString(KEY_SET_MEDICATIONS_DOSES_VALUE, null);
    }

    public void setMedicationName(String MedicationName)
    {

        editor.putString(KEY_SET_MEDICATIONS_NAME, MedicationName);
        editor.commit();
    }
    public String getMedicationName()
    {
        return pref.getString(KEY_SET_MEDICATIONS_NAME, null);
    }


/*    public void setMedicationReminderFlag(String MedicationReminderFlag)
    {
        editor.remove(KEY_MEDICATION_REMINDER_FLAG);
        editor.putString(KEY_MEDICATION_REMINDER_FLAG, MedicationReminderFlag);
        editor.commit();

    }
    public String getMedicationReminderFlag()
    {
        String MedicationReminderFlag= pref.getString(KEY_MEDICATION_REMINDER_FLAG, null);
        return MedicationReminderFlag;
    }*/

    public void setDoctorListLocalFlag(String DoctorListLocalFlag)
    {
        editor.remove(KEY_DOCTOR_LIST_LOCAL_FLAG);
        editor.putString(KEY_DOCTOR_LIST_LOCAL_FLAG, DoctorListLocalFlag);
        editor.commit();

    }
    public String getDoctorListLocalFlag()
    {
        String DoctorListLocalFlag= pref.getString(KEY_DOCTOR_LIST_LOCAL_FLAG, null);
        return DoctorListLocalFlag;
    }

    public void setHealthPackageLocalFlag(String HealthPackageLocalFlag)
    {
        editor.remove(KEY_HEALTH_PACKAGE_LOCAL_FLAG);
        editor.putString(KEY_HEALTH_PACKAGE_LOCAL_FLAG, HealthPackageLocalFlag);
        editor.commit();

    }
    public String getHealthPackageLocalFlag()
    {
        String HealthPackageLocalFlag= pref.getString(KEY_HEALTH_PACKAGE_LOCAL_FLAG, null);
        return HealthPackageLocalFlag;
    }



    public void setUserImageFlag(String UserImageFlag)
    {
        editor.remove(KEY_USER_IMAGE_FLAG);
        editor.putString(KEY_USER_IMAGE_FLAG, UserImageFlag);
        editor.commit();

    }
    public String getUserImageFlag()
    {
        String UserImageFlag= pref.getString(KEY_USER_IMAGE_FLAG, null);
        return UserImageFlag;
    }




    public void setDepartmentLocalFlag(String DepartmentLocalFlag)
    {
        editor.remove(KEY_DEPARTMENT_LOCAL_FLAG);
        editor.putString(KEY_DEPARTMENT_LOCAL_FLAG, DepartmentLocalFlag);
        editor.commit();

    }
    public String getDepartmentLocalFlag()
    {
        String DepartmentLocalFlag= pref.getString(KEY_DEPARTMENT_LOCAL_FLAG, null);
        return DepartmentLocalFlag;
    }

    public void setHospitalLocalFlag(String HospitalLocalFlag)
    {
        editor.remove(KEY_HOSPITAL_LOCAL_FLAG);
        editor.putString(KEY_HOSPITAL_LOCAL_FLAG, HospitalLocalFlag);
        editor.commit();

    }
    public String getHospitalLocalFlag()
    {
        String HospitalLocalFlag= pref.getString(KEY_HOSPITAL_LOCAL_FLAG, null);
        return HospitalLocalFlag;
    }

    public void setMedicatonTime(String setMedicatonTime)
    {
        editor.putString(KEY_MEDICATION_Time, setMedicatonTime);
        editor.commit();
    }
    public String getMedicatonTime()
    {
        return pref.getString(KEY_MEDICATION_Time, null);
    }

//    =========================================================================================

   /* public void setPatientDetailsFlag(String PatientDetailsFlag)
    {
        editor.remove(KEY_PATIENT_DETAILS_FLAG);
        editor.putString(KEY_PATIENT_DETAILS_FLAG, PatientDetailsFlag);
        editor.commit();

    }
    public String getPatientDetailsFlag()
    {
        String PatientDetailsFlag= pref.getString(KEY_PATIENT_DETAILS_FLAG, null);
        return PatientDetailsFlag;
    }*/

    public void setProviderName(String setProviderName)
    {
        editor.putString(KEY_PROVIDER_NAME, setProviderName);
        editor.commit();
    }
    public String getProviderName()
    {
        return pref.getString(KEY_PROVIDER_NAME, null);
    }

    public void setTpaName(String setTpaName)
    {
        editor.putString(KEY_TPA_NAME, setTpaName);
        editor.commit();
    }
    public String getTpaName()
    {
        return pref.getString(KEY_TPA_NAME, null);
    }

    public void setInsuranceNumber(String setInsuranceNumber)
    {
        editor.putString(KEY_INSURANCE_NUMBER, setInsuranceNumber);
        editor.commit();
    }
    public String getInsuranceNumber()
    {
        return pref.getString(KEY_INSURANCE_NUMBER, null);
    }

    public void setInsuranceStartDate(String setInsuranceStartDate)
    {
        editor.putString(KEY_INSURANCE_START_DATE, setInsuranceStartDate);
        editor.commit();
    }
    public String getInsuranceStartDate()
    {
        return pref.getString(KEY_INSURANCE_START_DATE, null);
    }

    public void setInsuranceValidity(String setInsuranceValidity)
    {
        editor.putString(KEY_INSURANCE_VALIDITY, setInsuranceValidity);
        editor.commit();
    }
    public String getInsuranceValidity()
    {
        return pref.getString(KEY_INSURANCE_VALIDITY, null);
    }


public void setinsuranceImageFid(String setinsuranceImageFid)
    {
        editor.putString(KEY_INSURANCE_ImageFid, setinsuranceImageFid);
        editor.commit();
    }
    public String getinsuranceImageFid()
    {
        return pref.getString(KEY_INSURANCE_ImageFid, null);
    }

}
