var patientProgress = {
    settings: {
        patient_autocompleteUrl: '',
        company_autocomplete_url: '',
        health_facility_autocomplete_url: '',
        chartStatus_autocomplete_url: '',
        primary_clinician_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-health-facility-id').val(val);
        });

        jQ('#billing_branches').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-billing-health-facility-id').val(val);
        });
    },
    bindAutoComplete: function() {
        global.autocomplete.bind(patientProgress.settings.patient_autocompleteUrl, '#form-patient-fullName', '#form-patient-id');
        global.autocomplete.bind(patientProgress.settings.company_autocomplete_url, '#form-company-desc', '#form-company-id');
        global.autocomplete.bind(patientProgress.settings.health_facility_autocomplete_url, '#form-health-facility', '#form-health-facility-id');
        global.autocomplete.bind(patientProgress.settings.health_facility_autocomplete_url, '#form-billing-health-facility', '#form-billing-health-facility-id');
        global.autocomplete.bind(patientProgress.settings.chartType_autocomplete_url, '#form-encounter-type', '#form-encounter-type-id');
        global.autocomplete.bind(patientProgress.settings.chartStatus_autocomplete_url, '#form-encounter-status', '#form-encounter-status-id');
        global.autocomplete.bind(patientProgress.settings.primary_clinician_autocomplete_url, '#form-clinician-fullName', '#form-clinician-id');

    }
};