Billing / HCFA Form > PHP Deprecated: usort() Errors

I tried quiet few different methods to work around this function usort so it doesn’t get called statically but PHP errors are still coming up so finally posting here hopefully you can help me:)

Situation
When client is filing a Billing claim: Fees > Billing Manager > Billing Status = Unbilled > Check off Patient Encounter(s) > HCFA Form > CMS 1500 PDF| incl FORM | TEXT > Validate and Clear | Validate Form.

Screen throws bunch of error messages incl. "PHP Deprecated: usort() expects parameter 2 to be a valid callback, non-static method OpenEMR\Billing\HCFA_Info::cmp_hcfa_info() should not be called statically in [OpenEMRdir]/src/Billing/HCFA_1500.php on line 119 " This HCFA Form issue unfortunately happens to my client all the time now.

User Issue: HCFA/CMS form files do get created on the server which then I have to deliver manually to my client though since a user is not capable to save these CMS 1500 files to his/her desktop due to received on-screen PHP Deprecated / usort errors.

HCFA_1500.php > Line 119 :
// Sort the entries to put them in the page base sequence.
usort($hcfa_entries, array(‘OpenEMR\Billing\HCFA_Info’, ‘cmp_hcfa_info’));

OpenEMR Version
5.0.2

Browser:
Chrome 76.0.3809.100 /Firefox 68.0.2

Operating System
Centos 7.4 / Linux / PHP 7.2| 7.3

Logs
Billing Manger GUI > View Log > there are No errors:

Generating HCFA claim 50-1100 for [PATIENT NAME}  on 2019-08-23 10:11. 
error_log output:
PHP Deprecated:  usort() expects parameter 2 to be a valid callback, non-static method OpenEMR\Billing\HCFA_Info::cmp_hcfa_info() should not be called statically in [OpenEMRdir]/src/Billing/HCFA_1500.php on line 119 

Any help, lead on this issue is appreciated. Thank you.

hi @TechMed, unable to reproduce on https://ten.openemr.io/d/openemr/interface/login/login.php?site=default

remember working on this and according to https://www.php.net/manual/en/language.types.callable.php and specifically example 1 it appears it should be fine since php 5.2.3

1 Like

hmm, on second thought it appears that openemr/HCFA_Info.php at master · openemr/openemr · GitHub isn’t declared as static

1 Like

Hi @stephenwaite, thank you for looking into this and mentioning it doesn’t appear declared as static. I also tried and couldn’t reproduce it on a demo site the other day. I will continue to troubleshoot this further. Thanks.

sure, naturally was about to test by adding static to that method

you might just have to turn errors off for now to get it working, https://www.open-emr.org/wiki/index.php/FAQ#What_are_the_correct_PHP_settings_.28can_be_found_in_the_php.ini_file.29.3F

1 Like

@stephenwaite I did turn errors off in php.ini as referenced, restarted HTTP server but unfortunately this didn’t get rid off errors. Then it hit me about Admin Globals logging settings I did turn on bunch during/post the OpenEMR upgrades so I did disable all the loggings incl. billing log debugging option and that did it! Ufff! I’m able now to generate CMS claim files without any PHP errors. Thank you for your help and leading me onto this. Next step, over this weekend I will troubleshoot each logging option and get down to which exact one was causing this issue. I will follow up with my findings. Thanks again.

1 Like

oh yeah, @sjpadgett’s new feature, Admin->Global->Logging->User Debug

1 Like

Confirmed @stephenwaite Without turning on any other loggings but just that one: User Debugging Options (All or Display Application Errors Only) will generate back those errors "PHP Deprecated: usort() " for me. Is that a normal behavior? While I do expect a debugging log to spit out bunch of warning/ debug log messages but I wouldn’t expect for program to error out… I’ve tried to recreate these errors on a demo site (demo.openemr.io/openemr) but I couldn’t, no such PHP errors were produced. Thanks.

hi @TechMed, yes. When the errors display it can interrupt the php script like in this case it prevents the claim form from being downloaded.

Right, I see -thanks @stephenwaite