<script>

$( "#cvemedico" ).autocomplete({
source: function (request, response) {
            $.ajax({
                url: '<?php echo site_url('reportes/busca_cveMedicoAll'); ?>',
                dataType: "json",
                data: {
                    term : request.term,
                    sucursal: $("#sucursal").val()
                },
                success: function(data) {
                    response(data);
                }
            });
        },
minLength: 2,
select: function ( event, ui ) {
    
    
    $("#cvemedico").val(ui.item.cvemedico);
    $("#nombremedico").val(ui.item.nombremedico);    
    return false;
    
    }
});


</script>   