Bahmni Connect: how to setup the LocationBasedSyncStrategy?

Thanks @shruthipitta for spending the time to debug this with me :+1: .

We have found that the problem is likely coming from the fact that too many calls are made when the address set on the Login location is a high level in the address hierarchy.

Indeed, there is as many calls made as there is filter values (ie, address entries):

In my use case, there is only one possible login location named ‘Health Center’ because the clinic is a mobile clinic and provides care across 3 provinces. So I would have to set the level to the highest one, “country”. That is 16,459 address entries.

This means that in the code below, promises will contain 16,459 promises.

And as many HTTP calls will be made. This seems to freeze the Chrome window.

If one sets a lower address level to the Login location, such as a District or Village, the number of child entries is much smaller and all works. For instance, with few trials I can say that around 500~700 entries max, the page works and loads fine.


Conclusion: I believe the LocationBasedSyncStrategy was not created to load such a big number of entries and may just not fit for me here.

I am thinking I should create a “AllPatientsSyncStrategy” instead to simply retrieve all patients.

4 Likes