I thought the plan for encounter type is that there would be a global property setting, which the admin has to configure before anyone can use the order entry tool.
Encounter role should be similar. There should be a GP setting which controls what encounter role is used. Yes, on one configured server it can always be the same encounter role. The simple way would be for the admin to use a Clinician role. If they want to be more sophisticated they could have an “Order Signer” role or something like that.
Yes, I saw how to link to the next page in the response.
Wyclif’s comment solved the issue I had.
The reason why this was a blocker is because of the default limit of 50 results returned by the API. This prevented me from getting the actual total number of results if the orders were above 50. The totalCount was required for me to determine the number of pages to split the results based on the specified limit and show this on the UI.
@darius Still on the encounterRole issue. I seem to have noticed a sort of bug in the API endpoint needed to fetch encounter roles. It always returns an empty array when I search for role even when such role exist in the database. For example http://localhost:8081/openmrs-standalone/ws/rest/v1/encounterrole?q=Clinician returns [ ] whereas Clinician is already present.
I will like to open a ticket for this (but don’t know where) and perhaps be pointed to where the code (maybe I can fix this).
Thanks
Thanks @dkayiwa, I am done with the task. But before raising a PR I have a question, is it okay to let my new implementation replace the existing implementation for the encounterrole endpoint? I noticed I can’t use the define my endpoint using the encounterrole name because it is already taken in v1.9.
I had resorted into using encounterrolesearch but I feel I can still update the v1.9 without breaking any existing feature. Can I go ahead and do this?
One alternative solution is to require that the global property value should be uuid, not the name, thus you can just fetch it instead of searching for it.
on my file resulted in a duplication error indicating that the resource endpoint is already taken. So, my question is that is it okay to create a new resource type /encounterrolesearch to address this bug or should I find a way to still use the /encounterrole resource endpoint with this bug fix?
I haven’t been following this in detail but +1 to the suggestion from @darius that the global property be a uuid… using uuids has been our general approach for settings things like this (at least over the last few years).