From: bradymiller Date: Sat, 30 Mar 2013 07:25:24 +0000 (-0700) Subject: Do not include the empty demographic fields in the reports when they are empty. X-Git-Tag: whats-been-changed~324 X-Git-Url: https://repo.or.cz/w/openemr.git/commitdiff_plain/95660d7cd10487af0d9531344dbb77b7c10a000b Do not include the empty demographic fields in the reports when they are empty. Problem Summary: Patient report generation was printing all the demographics fields even if they were empty. Description: There are like around 50 fields in demographics and the patient report prints all the 50 fields with empty labels even if we fill just 3 or 4. Fix: I am filtering the empty fields not to be included for printing in the reports. --Contributed by Athiyaman Muthukumarasamy. --- diff --git a/library/options.inc.php b/library/options.inc.php index 3b83d525c..a849500fa 100644 --- a/library/options.inc.php +++ b/library/options.inc.php @@ -1615,56 +1615,59 @@ function display_layout_rows($formtype, $result1, $result2='') { $last_group = $this_group; } - // Handle starting of a new row. - if (($titlecols > 0 && $cell_count >= $CPR) || $cell_count == 0) { - disp_end_row(); - echo ""; - if ($group_name) { - echo ""; - //echo ""; - //echo "$group_name"; + // filter out all the empty field data from the patient report. + if (!empty($currvalue) && !($currvalue == '0000-00-00 00:00:00')) { + // Handle starting of a new row. + if (($titlecols > 0 && $cell_count >= $CPR) || $cell_count == 0) { + disp_end_row(); + echo ""; + if ($group_name) { + echo ""; + //echo ""; + //echo "$group_name"; - // Added 5-09 by BM - Translate label if applicable - echo htmlspecialchars(xl_layout_label($group_name),ENT_NOQUOTES); + // Added 5-09 by BM - Translate label if applicable + echo htmlspecialchars(xl_layout_label($group_name),ENT_NOQUOTES); - $group_name = ''; - } else { - //echo ""; - echo " "; - } - echo ""; - } - - if ($item_count == 0 && $titlecols == 0) $titlecols = 1; + $group_name = ''; + } else { + //echo ""; + echo " "; + } + echo ""; + } - // Handle starting of a new label cell. - if ($titlecols > 0) { - disp_end_cell(); - //echo ""; - $cell_count += $titlecols; - } - ++$item_count; + if ($item_count == 0 && $titlecols == 0) $titlecols = 1; + + // Handle starting of a new label cell. + if ($titlecols > 0) { + disp_end_cell(); + //echo ""; + $cell_count += $titlecols; + } + ++$item_count; - // Added 5-09 by BM - Translate label if applicable - if ($frow['title']) echo htmlspecialchars(xl_layout_label($frow['title']).":",ENT_NOQUOTES); else echo " "; + // Added 5-09 by BM - Translate label if applicable + if ($frow['title']) echo htmlspecialchars(xl_layout_label($frow['title']).":",ENT_NOQUOTES); else echo " "; + + // Handle starting of a new data cell. + if ($datacols > 0) { + disp_end_cell(); + //echo " 0) echo " style='padding-left:5pt'"; + echo ">"; + $cell_count += $datacols; + } - // Handle starting of a new data cell. - if ($datacols > 0) { - disp_end_cell(); - //echo " 0) echo " style='padding-left:5pt'"; - echo ">"; - $cell_count += $datacols; + ++$item_count; + echo generate_display_field($frow, $currvalue); } - - ++$item_count; - echo generate_display_field($frow, $currvalue); } disp_end_group();