var patientChecklist = {
    settings: {
        referring_provider_autocomplete_url: '',
        referring_health_facility_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(patientChecklist.settings.referring_provider_autocomplete_url, '#form-referring-physician', '#form-referring-physician-id');
        global.autocomplete.bind(patientChecklist.settings.referring_health_facility_autocomplete_url, '#form-referring-affiliate', '#form-referring-affiliate-id');
    }
};