When creating an appointment in the Bahmni Appointments Scheduling App, the application fails to handle more than 5 providers list from dropdown selection.
While the first 5 providers load and display perfectly, adding or scrolling to a 6th provider causes the dropdown element to crash. Following this crash, the Provider dropdown malfunctions, displaying a provider list of only 2 to 3 entries.
My Global property value"webservices.rest.maxResultsDefault=200
Has anyone encountered this issue before, or does anyone know a workaround to fix this dropdown behavior? Any help would be highly appreciated
To my understanding, your Global property value"webservices.rest.maxResultsDefault=200 controls how many results the server sends back - 200 is plenty. The problem is almost certainly on the display side, not the server side.
The setting maxAppointmentProviders in the appointments app configuration controls how many providers can be selected for a single appointment. The default value in Bahmni/default-config is 4, which would explain why the dropdown breaks around the 5th or 6th provider.
A couple of questions to help troubleshoot:
Are you using the standard Bahmni default-config, or do you have a custom config repository?
If standard : youâll need to override it with your own config repo to change this value.
If custom config: you can directly edit the setting in your config.
Thank you for your reply, regarding your troubleshooting question, We are managing the Git repository based on the Bahmni Standard version. The maxAppointmentProviders setting is already configured in our repo as: âmaxAppointmentProvidersâ: 15.
âmaxAppointmentProvidersâ: 15 (as you mentioned, this is not the configuration for controlling the provider list in the dropdown, but we increase this anyway to see the impact )
Steps followed:
I have created 5 providers; all 5 providers show on the drop-down.
I have created a 6th provider; only providers one and five show on the drop-down.
Retired the 6th provider; all 5 providers (1-5) show on the drop-down.
Unretired the 6th provider and retired provider one; 5 providers show on the drop-down (2-6); noticed the 6th provider showing on the drop-down list; this confirms the 6th provider data and entity link is ok.
I think in openmrs-module-appointments-frontend module this dropdown filtering option is causing trouble if a provider has multiple attributes and âAvailable for Appointmentsâ is not the first attribute then this code should missed the first index and break the entire provider list in provider option.
@sohel you are right ,the filtering logic checks only provider.attributes[0] to look for the âAvailable for Appointmentsâ attribute, assuming it is always the first element of the attributes array. If a provider has multiple attributes and âAvailable for Appointmentsâ is not the first one, the filter check fails for that provider, causing it to be dropped from the dropdown. This is why the effect appears to be âmore than 5 providers breaks the listâ - itâs actually dependent on attribute ordering per provider, not a hard count limit.
We will create a bug card and fix it in the upcoming days.