2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 include_once("../../globals.php");
10 include_once($GLOBALS["srcdir"] . "/api.inc");
11 include_once("lines.php");
13 function physical_exam_report($pid, $encounter, $cols, $id) {
17 $res = sqlStatement("SELECT * FROM form_physical_exam WHERE forms_id = '$id'");
18 while ($row = sqlFetchArray($res)) {
19 $rows[$row['line_id']] = $row;
22 echo "<table cellpadding='0' cellspacing='0'>\n";
24 foreach ($pelines as $sysname => $sysarray) {
25 $sysnamedisp = xl($sysname);
26 foreach ($sysarray as $line_id => $description) {
27 $linedbrow = $rows[$line_id];
28 if (!($linedbrow['wnl'] ||
$linedbrow['abn'] ||
$linedbrow['diagnosis'] ||
29 $linedbrow['comments'])) continue;
30 if ($sysname != '*') { // observation line
32 echo " <td class='text' align='center'>" . ($linedbrow['wnl'] ?
"WNL" : "") . " </td>\n";
33 echo " <td class='text' align='center'>" . ($linedbrow['abn'] ?
"ABN1" : "") . " </td>\n";
34 echo " <td class='text' nowrap>$sysnamedisp </td>\n";
35 echo " <td class='text' nowrap>$description </td>\n";
36 echo " <td class='text'>" . $linedbrow['diagnosis'] . " </td>\n";
37 echo " <td class='text'>" . htmlentities($linedbrow['comments']) . "</td>\n";
39 } else { // treatment line
41 echo " <td class='text' align='center'>" . ($linedbrow['wnl'] ?
"Y" : "") . " </td>\n";
42 echo " <td class='text' align='center'> </td>\n";
43 echo " <td class='text' colspan='2' nowrap>$description </td>\n";
44 echo " <td class='text' colspan='2'>" . htmlentities($linedbrow['comments']) . "</td>\n";
49 } // end of system name