This is a fundamental issue in OpenMRS: the observations in an encounter are not naturally sorted.
If you want to get these to display consistently you need to associate an encounter display template with the encounter type. (Sorry, offhand I don’t remember where you do this.) If this form is an HTML Form then there’s a quick way to render it using the HTML Form Entry module’s existing code (but I don’t remember how to do this offhand either).
This form is an HTML form yes. Could you explain me a little more that second option you are talking about: “Render it using the HFE module’s existing code” ? Or redirect me to the person who could help me ?
If I add "displayWithHtmlForm": true in this JSON, that works perfect, my encounter will be displayed with HFE form.
Now I would like to do this changes with my own module.
Is it possible for me to create my own myEncounterDisplay_extension.json that would add more supported encounter types on top of what’s already extended with the referenceapplication module ? So can the defaultEncounterTemplate be extended 2 times ?
If not, do I need to disable the first one to be sure mine is used instead ?
This should get what you want, I believe… the only issue is if you wanted to override the template for the visit note encounter type as defined by the reference application.
Right now there are generally two use cases–users that use the reference application out of the box, and that don’t use the reference application (ie, don’t install the reference application module) but have their own “setup” modules that do all the setup for their implementation. It does seem like it would be valuable to allow overriding… so implementations that wanted to generally use the reference app but make minor modifications could do so.