var appointmentHistory = {
    settings: {
        patient_autocompleteUrl: '',
        chartType_autocomplete_url: '',
        company_autocomplete_url: '',
        branch_autocomplete_url: '',
        provider_autocomplete_url: '',
    },
    init: function() {
        this.bindAutoComplete();

        jQ('#companies').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-company-id').val(val);
        });

        jQ('#branches').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-branch-id').val(val);
        });
    },
    bindAutoComplete: function() {
        global.autocomplete.bind(appointmentHistory.settings.patient_autocompleteUrl, '#form-patient-fullName', '#form-patient-id');
        global.autocomplete.bind(appointmentHistory.settings.chartType_autocomplete_url, '#form-chartType-desc', '#form-chartType-id');
        global.autocomplete.bind(appointmentHistory.settings.company_autocomplete_url, '#form-company-desc', '#form-company-id');
        global.autocomplete.bind(appointmentHistory.settings.branch_autocomplete_url, '#form-healthFacility-desc', '#form-healthFacility-id');
        global.autocomplete.bind(appointmentHistory.settings.provider_autocomplete_url, '#form-clinician-fullName', '#form-clinician-id');

    }
};