Inventory - Related codes selection

Looks like Related Codes selection is broken for inventory item details.

To replicate:

  1. Make sure Inventory features are in use (Globals -> Features)
  2. Start adding a new item or select existing
  3. Click on ‘Related To’
  4. This would offer a code selection popup which is now unavailable.

Workaround:
Use sql to update corresponding entry in ‘drugs’ table. The entry should be in a format similar to issues, e.g. CVX:33;CPT4:90732

Add_edit_drug.php is missing a jquery version. Not sure why dlgopen no longer detects missing jquery and auto loads a min 1-9-1 version but it doesn’t in 5.0.1 or 5.0.2(use to). One can add jquery and dlgopen does loads bootstrap e.t.c.
I don’t have time for this now but if you take on, please restyle the popup to bootstrap classes.

@mdsupport, I found error as to why dialog was not loading jquery and fixed so I’ll go a head and restyle the drug dialog while here. So, i’ve got this…

1 Like

P.R
Fix Forum Issue Inventory - Related codes selection by sjpadgett · Pull Request #1868 · openemr/openemr · GitHub

1 Like

Thx @sjpadgett for fixing it even when you had other things on the plate. That works.

Side note: Bootstrap is verbose, perhaps too much so. What is working really well for us in BS4 world is a generic styler. So instead of changes to each input tag, it has a single jQ chain called at client … something like (:

$("input[type=text]").addClass("form-control form-control-sm").removeAttr("type");

Basic idea here is to pass barebone html code to client - least work for developers and server…

Not sure what you mean. I usually replace inputs types with BS classes when I do any restyles and if I do restyle, I try to keep to just using minimum BS styles/classes 'cause I know others are active in creating a uniform look. I may have missed a type in this case if that is what you mean.
I’m still unclear as to how BS4 fits in. Are we moving to BS4, or are we using BS4 selectively where it’s the best choice?
Anyway, keep me honest if I go wayward :slight_smile:

It was just a suggestion for updating legacy(pre-bootstrap) code after noticing that your PR included changes to several lines in the script. The jQ line of code suggested above effectively achieves the same result as your changes with following difference:

  • advantage - centralized control of layout, no need to look at existing script logic (just lazy), offload more processing to the client devices

  • disadvantages - need to watch out for dynamically generated code, form will look different if javascript errors occur before this statement.

The centralized control comes in handy during transitions such as bs3 to bs4. As an example, in bs4 every grid tier has been bumped up by one level. So .col-md-6 in v3 is now .col-lg-6 in v4. IMHO rolling out corresponding change by modifying a single line will be easier/cheaper.