Fee sheet review button intermittant

Having an issue with the fee sheet review button. Every now and then it shows nothing. It hangs on certain patients’. The current patient I am looking at has 4 past encounters. The review button is doing absolutely nothing. Since it seems like it is not the code because the code should be consistant. It must be the data that is trying to retrieve.

I started the investigation with the console and this is what the console is return

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ index.js:4:14909

TypeError: json_source.justify is null[Learn More] fee_sheet_review_view_model.js:51:9
procedure http://10.0.1.7/openemr/interface/forms/fee_sheet/review/fee_sheet_review_view_model.js:51:9
map_procedures http://10.0.1.7/openemr/interface/forms/fee_sheet/review/fee_sheet_review_view_model.js:116:21
request_encounter_data/< http://10.0.1.7/openemr/interface/forms/fee_sheet/review/fee_sheet_review_view_model.js:167:47
n.Callbacks/i http://10.0.1.7/openemr/public/assets/jquery-min-2-2-0/index.js:2:27060
n.Callbacks/j.fireWith http://10.0.1.7/openemr/public/assets/jquery-min-2-2-0/index.js:2:27828
z http://10.0.1.7/openemr/public/assets/jquery-min-2-2-0/index.js:4:11825
.send/c/< http://10.0.1.7/openemr/public/assets/jquery-min-2-2-0/index.js:4:15387

line 51 of the fee_sheet_review_mode.js is where the error occurs

var justify_codes=json_source.justify.split(":");

So, it is suppose to split something that is not there.

What about an if statement before declaring the var?

So it ended up that the TypeError: json_source.justify is null. So for those instances where the json_source.justfy is null I did the below fix.

if(json_source.justify !== null){
      var justify_codes=json_source.justify.split(":");
    }else
    {
        var justify_codes="";
    }

Hello juggernautsei,
We have pen down the steps regarding the workflow of REVIEW button in Fee-sheet.

  1. Create a new encounter and enter the details in fee sheet. Now when you click on REVIEW button, you can be able to get a similar screen as mentioned below.
  2. Create another encounter for the same patient and click on the REVIEW button in fee sheet. The screen would be like

If you couldn’t able to get the values, Can you specify the steps, version of openemr and screenshots of your input. So it would be better to analyze further.
Let us know, if you have further clarifications.

Thanks
ViSolve

in your example leave the justification blank.

Where you able to duplicate the issue?

Hello juggernautsei,

We have tried the scenario by leaving the justification blank. Though we can’t able to reproduce the issue and the review button works fine.If possible can you provide more information.

Thanks
ViSolve

It may be a windows issue. This instance is running on a Windows 7 OS, WAMP 3.0.8, Apache 2.4.17, PHP 5.6.16
MySQL 5.7.9.

I gave you error that was in the console of my browser:
TypeError: json_source.justify is null[Learn More] fee_sheet_review_view_model.js:51:9
procedure http://10.0.1.7/openemr/interface/forms/fee_sheet/review/fee_sheet_review_view_model.js:51:9
map_procedures

Now, I know I am not making this up and I followed the clues to line 51 for the stated file in the console.

Added the if statement that I shared and that fixed the problem for us. I post here in case anyone ever has this issue. They can fix it. Not suggesting this be added to the code base. Because sometime issues are specific to setup and if you are running on a linux box. You may not encounter this issue because.

The browser we are using is Ice Dragon. But it happened in Firefox, Chrome, and Edge also.

If this fix isn’t harmful and you have confirmed it on windows systems, then recommend getting it into the codebase(post a PR so we can look at the code in context). That also reminds me of the fix you did for the database patient id max issue; we should probably get that into the codebase since that is not harmful.
-brady