Autocomplete broken and not available in header template

@brady.miller @robert.down @robertovasquez

I am working over in the prescriptions section. The autocomplete is broken and there needs to be a new one built.

This is the call to the autocomplete in the openemr/templates/prescription/general_edit.html

{/literal}
{if $GLOBALS.weno_rx_enable}
    {literal}
    $('#drug').autocomplete({
        {/literal}
        source: '{$WEB_ROOT}/library/ajax/drug_autocomplete/search.php?csrf_token_form='+{$CSRF_TOKEN_FORM|js_url},
        minLength: 3
        {literal}
    });
    {/literal}
{else}
    {literal}
    $('#drug').autocomplete({
        {/literal}
        source: 'library/ajax/prescription_drugname_lookup.php?csrf_token_form=' + {$CSRF_TOKEN_FORM|js_url},
        minLength: 1
        {literal}
    });
    {/literal}
{/if}
{literal}   

I added the {$WEB_ROOT} it is not in the code base.
However, when I checked the header for

<script type="text/javascript" src="{$WEBROOT}/library/js/jquery.autocomplete.pack.js"></script>

It was not there. So, I looked in the js folder to see if the autocomplete pack was in there and it is not. It got dropped somewhere along the way. And there is no reference to it in the config.yaml.

Now, that is established. My question is how should I go about implementing this feature back into the program?

hi @juggernautsei ,

What error are you seeing in the js error console? The jquery-ui called here includes the autocomplete(at least it should). After you build the openemr package, there will be a file at public/assets/jquery-ui/jquery-ui.js which in the header states it includes the autocomplete.

-brady

To answer your question the first error in the console was not being able to find the library js. That is why I added the web root constant. After that, there are no errors. I just do not work.

After a minute of doing some digging into https://jqueryui.com/autocomplete/.

I see that it is baked into 1.12.4. I see that the jquery-1.12.1 is in the assets folder. But jquery-1.12.4 is used in the example code on the jqueryui page.

In this example https://makitweb.com/jquery-ui-autocomplete-with-php-and-ajax/ they are using jquery 1.12.1.

I am following the example of the 1.12.1. That is not being loaded in the header of the general_edit.

I have it working now.
I will post a PR.