Currently, appointments module relies on a patient search API defined in bahmni commons module that is using raw SQL. This causes the data filter is not kicking in.
A new additional controller should be created. This new controller will be used specifically by the appointments and rely on openmrs service to fetch and filter patients, hence triggering the data filter. Its API can be lighter as appointments only needs to search by id or name.
Pull request created: