I noticed that there seems to be a limit on the amount of providers that bahmni tries to load when opening the page to create a new appointment.
Using the mysql query log, I made the following observations:
A query is executed when the page loads, using a fixed list of 100 provider IDs to load all the providers in the system. No selection seems to be done yet and I could not identify the query which preloads these provider IDs. Our database has 122 providers, so 22 of them are not being selected.
From this list, the providers are being filtered and only the non-retired ones which are linked to a user and who have the right provider attributes set, are retained.
All providers left after applying this filtering are present in the provider list when creating an appointment.
In the implementation where I found this issue, there are a lot of providers which are not used to make appointments and which are not supposed to be in the list. But due to the hard limit of 100 providers before filtering, many valid ones were not showing up because they were not selected by the first query.
I have the openmrs global properties âwebservices.rest.maxResultsAbsoluteâ and âwebservices.rest.maxResultsDefaultâ both set to 1000.
Does anyone know where the limit of 100 comes from?
And can we consider rewriting the way the providers are being loaded to avoid invalid providers pushing the valid ones beyond the limit?
@ramses According to Openmrs documentation, the default value of âwebservices.rest.maxResultsDefaultâ is 50. Looks like the default value changed to 100 in recent releases of Openmrs. Please change it to â200â so that the problem in Appointment Scheduling will get solved. I have checked with other implementations also and most of them have âwebservices.rest.maxResultsDefaultâ value set to >=200.
As I wrote in the question, however, that setting is already set to 1000 and still only 100 providers are being selected. I tried restarting openmrs after changing the value, this didnât help either.
If you look at the code of ProviderResource and eventually the ProviderService call, it is just filtering the retired providers. Are the 22 providers anyway retired?
@dkayiwa, @mksd have you heard of this sort of issue before?