var referring_provider_schedule_form = {
    settings: {
        medical_facility_autocomplete_url: '',
        marketing_staff_autocomplete_url: '',
        patient_referring_provider_autocompleteUrl: '',
        patient_referring_health_facility_autocompleteUrl: '',
        patient_insurance_autocompleteUrl: '',
        chartType_autocompleteUrl: '',
        referringProviderId: '',
        scheduleId: '',
        axn: '',
        appointmentNoticeFax_ajaxUrl: ''
    },
    init: function() {
        this.initAutocomplete();
        this.initDataTable();
    },
    initAutocomplete: function() {
        global.autocomplete.bind(this.settings.medical_facility_autocomplete_url, '#referringProvider_schedule_health_facility_desc', '#referringProvider_schedule_health_facility');
        global.autocomplete.bind(this.settings.marketing_staff_autocomplete_url, '#referringProvider_schedule_marketingStaff_fullName', '#referringProvider_schedule_marketingStaff');
        global.autocomplete.bind(this.settings.chartType_autocompleteUrl, '#referringProvider_schedule_chartType_desc', '#referringProvider_schedule_chartType');
        var
            params = {
                referringProvider_id : this.settings.referringProviderId,
                schedule_id: this.settings.scheduleId
            };
        // global.autocomplete.bind(this.settings.patient_referring_provider_autocompleteUrl, '#appointment_notice_fax_referringProvider_referring_provider_desc', '#appointment_notice_fax_referringProvider_referring_provider', {});
        // global.autocomplete.bind(this.settings.referringProvider_referring_health_facility_autocompleteUrl, '#appointment_notice_fax_referringProvider_referring_health_facility_desc', '#appointment_notice_fax_referringProvider_referring_health_facility');
        // global.autocomplete.bind(this.settings.referringProvider_insurance_autocompleteUrl, '#appointment_notice_fax_referringProvider_insurance_desc', '#appointment_notice_fax_referringProvider_insurance');
        // jQ('#appointment_notice_fax_referringProvider_referring_provider_desc').devbridgeAutocomplete('setOptions', {params: params});
        // jQ('#appointment_notice_fax_referringProvider_referring_health_facility_desc').devbridgeAutocomplete('setOptions', {params: params});
        // jQ('#appointment_notice_fax_referringProvider_insurance_desc').devbridgeAutocomplete('setOptions', {params: params});

        // jQ("#appointment_notice_fax_affiliate_type").unbind('change').bind('change',function () {
        //     if(jQ(this).val() === 'Insurance'){
        //         jQ('#affiliate-Insurance').removeClass('hide');
        //         jQ('#create-new-appointment-notice-save').removeClass('hide');
        //         jQ('#affiliate-Referring-HealthFacility, #affiliate-Referring-Provider').addClass('hide');
        //         jQ('#appointment_notice_fax_referringProvider_referring_health_facility_desc, #appointment_notice_fax_referringProvider_referring_health_facility, #appointment_notice_fax_referringProvider_referring_provider_desc, #appointment_notice_fax_referringProvider_referring_provider').val(null);
        //     }else if(jQ(this).val() === 'Referring Affiliate'){
        //         jQ('#affiliate-Referring-HealthFacility').removeClass('hide');
        //         jQ('#create-new-appointment-notice-save').removeClass('hide');
        //         jQ('#affiliate-Referring-Provider, #affiliate-Insurance').addClass('hide');
        //         jQ('#referringProvider_letter_referringProvider_insurance_desc, #referringProvider_letter_referringProvider_insurance, #appointment_notice_fax_referringProvider_referring_provider_desc, #appointment_notice_fax_referringProvider_referring_provider').val(null);
        //     }else if(jQ(this).val() === 'Referring Physician'){
        //         jQ('#affiliate-Referring-Provider').removeClass('hide');
        //         jQ('#create-new-appointment-notice-save').removeClass('hide');
        //         jQ('#affiliate-Referring-HealthFacility, #affiliate-Insurance').addClass('hide');
        //         jQ('#appointment_notice_fax_referringProvider_insurance_desc, #appointment_notice_fax_referringProvider_insurance, #appointment_notice_fax_patient_referring_health_facility_desc, #appointment_notice_fax_patient_referring_health_facility').val(null);
        //     }else{
        //         jQ('#affiliate-Referring-HealthFacility, #affiliate-Referring-Provider').addClass('hide');
        //         jQ('#affiliate-Referring-Provider, #affiliate-Insurance').addClass('hide');
        //         jQ('#affiliate-Referring-HealthFacility, #affiliate-Insurance').addClass('hide');
        //         jQ('#create-new-appointment-notice-save').addClass('hide');
        //         jQ('#appointment_notice_fax_patient_insurance_desc, #appointment_notice_fax_patient_insurance, #appointment_notice_fax_patient_referring_health_facility_desc, #appointment_notice_fax_patient_referring_health_facility').val(null);
        //     }
        // });
    },
    initDataTable: function() {
        // var callBack = function() {
        // };
        //
        // var dataList = jQ('#appointmentNoticeFax-datalist').DataTable({
        //     'processing': true,
        //     'serverSide': true,
        //     'ajax': {
        //         'url': this.settings.appointmentNoticeFax_ajaxUrl,
        //         'data': function(d) {
        //             d.url = global.settings.url;
        //             d.patient_id = patient_schedule_form.settings.patientId;
        //             d.scheduleId = patient_schedule_form.settings.scheduleId;
        //         }
        //     },
        //     'deferRender': true,
        //     'columnDefs': [
        //         { 'orderable': false, 'targets': 4 },
        //         { 'searchable': false, 'targets': 4 }
        //     ],
        //     drawCallback: function() {
        //         callBack();
        //     },
        //     responsive: {
        //         details: {
        //             renderer: function( api,rowIdx ) {
        //                 return global.dataTableResponsiveCallBack(api, rowIdx, callBack);
        //             }
        //         }
        //     }
        // });
    }
};