FYI - There’s a bug I just discovered in library/patient.inc. The function getPatientPID chokes when it tries to retrieve more than 5000 patients.
How do I know?
Well I tried running the function with the default arguments which allows NO limit on the number of results returned. In my case that number is 18,000. Yes, 18,000 patients in our database.
So, I’ll merrily go about fixing it. But I wanted to bring this to everyones attention in case we run into a similar limitation in the future.
Possibly the function failed because memory limitation or so for such a great number of results. If you want to avoid this situation, just limit this number (the last two args: $limit and $start in function declaration).
You can also modify ‘memory_limit’ parameter in php.ini to give more memory to your scripts. Just for my curiosity, how much is that value?
Something in that function stalls and never returns even before hitting the PHP memory limit. It’s likely some limit with MySQL on my server. The PHP memory limit is about 10mb. Which should be WAY more than enough for a single web request.
I did see that I could limit the results by a parameter in the function call. My feeling is that we should err on the side of caution so that people with smaller limitations don’t have the software fail outright on their servers. So if a search is going to return 5000+ results and cause a sever with typical settings to fail then we should force an artificial limit on the search.
I’ll be mulling over a solution to that today as I add back in the ‘search’ capability to the new calendar interface.