Hide empty fields in patient report

ijaraho wrote on Tuesday, September 10, 2013:

hi,
I entered some fields in “history” of a patient, then when I make Report (beside history) of this patient, it give me all fields of the history including empty and filled fields, I see that better to print only filled fields in the report, how I can do this??
thanks, you can see the attachment.

fsgl wrote on Tuesday, September 10, 2013:

Try clicking Clear All, then clicking desired items.

ijaraho wrote on Tuesday, September 10, 2013:

I tried this, but nothing change, as in steps in attached pictures.
I am talking on empty fields of “History” only.

fsgl wrote on Tuesday, September 10, 2013:

I don’t know how to change the codes to break History down to the 5 components in Report for selection and obviously you don’t either, otherwise you would not have posted.

Devi is great at this sort of thing. Let’s wait.

ijaraho wrote on Tuesday, September 10, 2013:

I don’t want to select (or deselect) in “history” of “Report”, I want only if any field in “History” is empty, not appear these fields in the report.

visolveemr wrote on Thursday, September 12, 2013:

Hi,

The fix for this is available in openEMR 4.1.2. and not in 4.1.1. But, still for displaying only the filled fields for the History section, we need to add following change in the file

/library/options.inc.php

In line 1617 - if(!empty($currvalue) && !($currvalue == '0000-00-00 00:00:00') && $currvalue!="|0|"){
In line 1670 - }

Thanks
OpenEMR Customization/Support provider,
ViSolve,Inc
services@visolve.com

ijaraho wrote on Thursday, September 12, 2013:

hi,
Now I am working on the version openEMR 4.1.2(1), the fix is not available in this version.
Any way I changed in the file /library/options.inc.php as you told, and the problem is solved partly.
that when I select the next items, then deselect them, they still appear even they empty
“General Exams/Tests” &
“Lifestyle Tobacco”
thanks very much

mdsupport wrote on Friday, September 13, 2013:

There is another bug you may come across later related to zero dates (not zero timestamps) printed by function printRecDataOne in library/report.inc. To eliminate fields with 00/00/0000 (or equivalent), you will need to change line 468 (towards the end of the file) from

if (sizeof($recres{$akey})>0 && ($recres{$akey}[1]{“value”}!=“0000-00-00 00:00:00”)) {

to

if (sizeof($recres{$akey})>0 && ($recres{$akey}[1]{“value”}!=“0000-00-00 00:00:00”) && ($recres{$akey}[1]{“value”}!=“0000-00-00”)) {

Does not truncate to allow for valid time value - but compares entire field to check if zero.

Haven’t tested all combinations but this should probably be part of the standard code.

ijaraho wrote on Sunday, September 15, 2013:

hi,
Sorry, I don’t understand you, what I will do, its not clear: move line, or change?? I searched on
“if (sizeof($recres{$akey})>0 && ($recres{$akey}[1]{“value”}!=“0000-00-00 00:00:00”)) {” ,
I did’t find it.
Now I work on version openEMR 4.1.2(1)

mdsupport wrote on Monday, September 16, 2013:

Line 469 in 4.1.2 code should be :

if (sizeof($recres{$akey})>0 
&& ($recres{$akey}[1]{"value"}!="0000-00-00 00:00:00") 
&& ($recres{$akey}[1]{"value"}!="0000-00-00")) {

You can see the complete changes we made in this post.