I’m surprised my old code works that way, but if so it was definitely a temporary hack just to get moving, and it’s definitely wrong.
The way I think it should work is that the administrator needs to set a global property specifying what Encounter Type to use when saving a set of orders. This requirement needs to be documented for someone who’s starting to use this app. (E.g. we suggest that they create an encounter type called “Order Entry”)
In case no value is set, the most correct thing to do would be to not allow the UI to be used at all and have a big error message saying “configuration required”. Before failing it might make sense to look for an encounter type with a known UUID that would be included in the reference application. (But save that for later.)
Just so you know, the ideal behavior from the perspective of an EHR system is a bit more complex, e.g. entering the orders likely happens during the same encounter where you recorded some diagnoses and clinician notes. But we should ignore this complexity for now, and get things working in a straightforward way first.