@lluismf that’s odd. What UI are you rendering this in? You likely need to import the JS and CSS resources that this tag requires, though I thought we had covered that. Maybe you are running an older version of another module that is rendering htmlforms?
I have made the import that you suggested, but now every time I change the encounter date it reset the drugs and I am not able to create a new drug anymore.
Is this expected?
Oops, sorry @lluismf ! @luis.oliveira - there is code in place that will reset the drug orders if you change the encounter date - it should display a message to that affect and warn you. I’m not sure what you mean by “not able to create a new drug anymore” - that sounds unexpected.
All orders are intended to be placed as of the encounter date on the form, and orders can be a combination of new orders as well as revisions / discontinuations of existing orders, so changes to the encounter date affect which existing orders are available to revise, which is why the widget is reset when this field is changed.
@luis.oliveira - this tag is 100% javascript rendered, so if there are issues with how it is behaving (the new button not working, view mode not working, etc), the cause will be found in the JS console in the browser, likely as errors there. Can you open the JS console and have a look and see what it says? Hopefully the answer is straightforward.
Note: Its not possible to add a new drug order because some parameters are not there in the qa-refapp and because of that I can not test here if the view mode is working. But its possible to see that after changinfg the date is no longer possible to create a new drug order.
I tested the view mode (locally) and it seems to be working fine .
The only other problem is when I try to import the orderWidget.css and the orderWidget.js, they cannot be included as I expected:
You’re right, that looks like an oversight due to the fact that these were originally written and tested with a 1.x UI. We should have put them into the appropriate scripts and styles subfolders in htmlformentry.