[Appointment scheduling] Limit on the number of providers

Hi all

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?


1 Like

@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.

We can also think about moving the logic of filtering users from frontend (bahmniapps) to backend (Appointments omod). This would be more effective.

@pramidat thanks for your response.

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.

Are you saying that (from the mysql query log) no filter (LIMIT statement) is used? This seems odd

  1. Appointments UI is actually calling the default OpenMRS rest webservices for provider.
  • Only thing it does it request a custom representation of the Provider


  1. 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?

When searching providers the limit parameter is applied, see here.

However when fetching all providers it cannot, see here.