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?