var referring_health_facility_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: '',
        referringHealthFacilityId: '',
        scheduleId: '',
        axn: '',
        appointmentNoticeFax_ajaxUrl: ''
    },
    init: function() {
        this.initAutocomplete();
        this.initDataTable();
    },
    initAutocomplete: function() {
        global.autocomplete.bind(this.settings.medical_facility_autocomplete_url, '#referringHealthFacility_schedule_health_facility_desc', '#referringHealthFacility_schedule_health_facility');
        global.autocomplete.bind(this.settings.marketing_staff_autocomplete_url, '#referringHealthFacility_schedule_marketingStaff_fullName', '#referringHealthFacility_schedule_marketingStaff');
        global.autocomplete.bind(this.settings.chartType_autocompleteUrl, '#referringHealthFacility_schedule_chartType_desc', '#referringHealthFacility_schedule_chartType');
        var
            params = {
                referringHealthFacility_id : this.settings.referringHealthFacilityId,
                schedule_id: this.settings.scheduleId
            };
        // global.autocomplete.bind(this.settings.patient_referring_provider_autocompleteUrl, '#appointment_notice_fax_referringHealthFacility_referring_provider_desc', '#appointment_notice_fax_referringHealthFacility_referring_provider', {});
        // global.autocomplete.bind(this.settings.referringHealthFacility_referring_health_facility_autocompleteUrl, '#appointment_notice_fax_referringHealthFacility_referring_health_facility_desc', '#appointment_notice_fax_referringHealthFacility_referring_health_facility');
        // global.autocomplete.bind(this.settings.referringHealthFacility_insurance_autocompleteUrl, '#appointment_notice_fax_referringHealthFacility_insurance_desc', '#appointment_notice_fax_referringHealthFacility_insurance');
        // jQ('#appointment_notice_fax_referringHealthFacility_referring_provider_desc').devbridgeAutocomplete('setOptions', {params: params});
        // jQ('#appointment_notice_fax_referringHealthFacility_referring_health_facility_desc').devbridgeAutocomplete('setOptions', {params: params});
        // jQ('#appointment_notice_fax_referringHealthFacility_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-HealthFacility').addClass('hide');
        //         jQ('#appointment_notice_fax_referringHealthFacility_referring_health_facility_desc, #appointment_notice_fax_referringHealthFacility_referring_health_facility, #appointment_notice_fax_referringHealthFacility_referring_provider_desc, #appointment_notice_fax_referringHealthFacility_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-HealthFacility, #affiliate-Insurance').addClass('hide');
        //         jQ('#referringHealthFacility_letter_referringHealthFacility_insurance_desc, #referringHealthFacility_letter_referringHealthFacility_insurance, #appointment_notice_fax_referringHealthFacility_referring_provider_desc, #appointment_notice_fax_referringHealthFacility_referring_provider').val(null);
        //     }else if(jQ(this).val() === 'Referring Physician'){
        //         jQ('#affiliate-Referring-HealthFacility').removeClass('hide');
        //         jQ('#create-new-appointment-notice-save').removeClass('hide');
        //         jQ('#affiliate-Referring-HealthFacility, #affiliate-Insurance').addClass('hide');
        //         jQ('#appointment_notice_fax_referringHealthFacility_insurance_desc, #appointment_notice_fax_referringHealthFacility_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-HealthFacility').addClass('hide');
        //         jQ('#affiliate-Referring-HealthFacility, #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);
        //             }
        //         }
        //     }
        // });
    }
};