function list_results($test_entry) { $measure_list = get_test_type_measure($test_entry->testTypeId); if ($test_entry->isPending()) { echo "ERROR: Test results pending<br>"; return; } $result_list = explode(",", $test_entry->result); ?> <table cellspacing='6px'> <tbody> <tr> <td></td> <td></td> <td></td> <td>Global Normal Ranges</td> </tr> <?php for ($i = 0; $i < count($measure_list); $i++) { # Pretty print $curr_measure = $measure_list[$i]; echo "<tr>"; echo "<td>" . $curr_measure->getName() . "</td>"; echo "<td>{$result_list[$i]}</td>"; echo "<td>[{$curr_measure->unit}]</td>"; $range = $curr_measure->range; if (strpos($range, ":")) { $range_bounds = explode(":", $range); echo "<td>({$range_bounds['0']} - {$range_bounds['1']})</td>"; } else { echo "<td>---</td>"; } echo "</tr>"; } ?> </tbody> </table> <?php }
function list_results($test_entry, $not_bold_measure_name) { $measure_list = get_test_type_measure($test_entry->testTypeId); if ($test_entry->isPending()) { echo LangUtil::$generalTerms['ERROR'] . ": " . LangUtil::$generalTerms['PENDING_RESULTS'] . "<br>"; return; } $result_list = explode(",", $test_entry->result); $print_range_label = false; for ($i = 0; $i < count($measure_list); $i++) { $curr_measure = $measure_list[$i]; $range = $curr_measure->range; if (strpos($range, ":")) { # Numeric range exists: Show range label ("Golabl Normal Ranges") $print_range_label = true; break; } } ?> <table cellspacing='6px' style='text-align:left;'> <tbody> <tr> <td></td> <td></td> <td></td> <td> <?php if ($print_range_label) { echo LangUtil::$pageTerms['RANGE_NORMAL']; } ?> </td> <td> <?php echo LangUtil::$generalTerms['RESULT_COMMENTS']; ?> </td> </tr> <?php for ($i = 0; $i < count($measure_list); $i++) { # Pretty print $curr_measure = $measure_list[$i]; echo "<tr>"; echo "<td>"; if ($not_bold_measure_name) { echo $curr_measure->getName(); } else { echo "<b>" . $curr_measure->getName() . "<b>"; } echo "</td>"; echo "<td>{$result_list[$i]}</td>"; echo "<td>"; if (trim($curr_measure->unit) != "") { echo "[{$curr_measure->unit}]"; } echo "</td>"; echo "<td>"; if ($print_range_label) { $range = $curr_measure->range; if (strpos($range, ":")) { $range_bounds = explode(":", $range); echo "({$range_bounds['0']} - {$range_bounds['1']})"; } else { //Do nothing } } echo "</td>"; echo "<td>"; if (trim($test_entry->comments) == "") { echo "-"; } else { echo $test_entry->comments; } echo "</td>"; echo "</tr>"; } ?> </tbody> </table> <?php }