Onsite portal tab hangs

Situation
when using the onsite portal for selected patient, the tab opened with template selection hangs and times out. eventually i have been able to have it show the template selection but the page is slow and takes several minutes (5min) to open

OpenEMR Version
I’m using OpenEMR version V7.02 with patch

Browser:
I’m using: chrome/firefox

Operating System
I’m using: ubuntu 22 LTS on aws

Search
Did you search the forum for similar questions?

Logs
Did you check the logs? Yes. Here are the error entries from the apache logs

Was there anything pertinent in them?
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

[Tue Sep 10 15:09:07.752973 2024] [php:notice] [pid 2059169] [client xxx.xxx.xx.xxx:6586] [2024-09-10T15:09:07.752786-05:00] OpenEMR.DEBUG: buildPatientArray() {"patient_id":"26330","provider":"","pat_prov_rel":"primary","start":"","batchSize":"","onlyCount":"","billing_facility":""} [], referer: https://xxxxxx.xxxxx/interface/patient_file/summary/demographics.php
[Tue Sep 10 15:09:07.799163 2024] [php:notice] [pid 2059127] [client xxx.xxx.xx.xxx:18540] [2024-09-10T15:09:07.799024-05:00] OpenEMR.DEBUG: buildPatientArray() {"patient_id":"26330","provider":"","pat_prov_rel":"primary","start":"","batchSize":"","onlyCount":"","billing_facility":""} [], referer: https://xxxxxx.xxxxx/interface/patient_file/summary/demographics.php
[Tue Sep 10 15:09:20.527049 2024] [php:warn] [pid 2059085] [client xxx.xxx.xx.xxx:35774] PHP Warning:  Undefined variable $autojustify in /var/www/xxxxxx.xxxxx/openemr/library/FeeSheet.class.php on line 1033, referer: https://www.xxxxxx.xxxxx/interface/patient_file/encounter/load_form.php?formname=fee_sheet
[Tue Sep 10 15:09:36.630937 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.630979 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.630999 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631006 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631013 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631019 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631026 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631032 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631038 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631045 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631051 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631057 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631064 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 411, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX
[Tue Sep 10 15:09:36.631070 2024] [php:warn] [pid 2059153] [client xxx.xxx.xx.xxx:17230] PHP Warning:  Undefined array key "data_type" in /var/www/xxxxxx.xxxxx/openemr/interface/main/finder/dynamic_finder.php on line 413, referer: https://xxxxxx.xxxxx/interface/main/tabs/main.php?token_main=3eZ0yzrjcl0AbmTUHujQMOkmDAeYoAZTNjhpHZoX

I have run this on a test system i have on xampp without issues. It appears the production server hangs because I have 33,000 patients in my clinic database. For clarification, it hangs when i click templates in the onsite portal. I have to hit wait on a bowser popup at least 4-5 times and the site finally loads with location showing a list of the patients to chose from or all patients. This basically renders the onsite portal nonfunctional. Any help with this would be appreciated.

Todd

Those log entries don’t appear to be related to the portal lock up/lag you’re describing.
Maybe just add a limit to the SQL statement that’s building the patient list? that’s probably something that should already be there, in most cases there’s no good reason to load the entire contents of the patient_data table.

Please detail the file that contains the SQL query for that function.

Thanks

Todd

I will fix this tonight and add to next patch.
Unsure how I’ll approach.
How many portal patients do you have approx. @toddmleleux ? It must be 100’s.

Are you assigning patients to groups from demographics? Portal template assignments is geared for groups and though I haven’t documented it very well it is easy to customize and add groups from list.
Only restriction is to maintain ID syntax of group_? for new groups but feel free to modify titles.

Thanks for the response,

I have not setup any groupings or used the onsite portal. I imported the 33k patients from a prior EMR and was in the stages of implementing the onsite portal to use templates, groups, etc. Thats when I was getting the browser hanging issue. On the demo, with only 1 patient there is no issue. On my production with 33k patients, the browser hangs for several minutes, but by pressing wait it finally loads with a list of patients by aphabetical sorting. Hope this helps.

Todd

Yes I understand why. Will see what I can do.

Thanks,

If you make an edit to the code, please list it here so i can modify my code to use immediatley and not have to wait for the next patch as I am in production mode.

Todd

Sure but looks like it won’t be a one or two line change. That search is tied to several needs but I will give you files.
However, I have since last patch gotten rid of ckeditor and you will need to do a composer run after mods.

This required a complete rework of template and patient management so now user must drill down in a search using a button.
Because I also replaced ckeditor I can’t simply give you a file though I only had to touch 1 script.
We are working very hard to get the patch out by next week. It will include most every bug fix we could find since last patch plus feature upgrade.

I just don’t think it’s worth my effort to create a special patch for this one bug. You may look at my PR’s if you want to add the fix.

Thanks though for bringing this to community’s attention as you have with other bug reports.

Thanks for the update. I understand the issue w waiting for the patch. I apprecaite your contributions and i am happy to be a user and contributing member.

Todd