External database import utility.
[openemr.git] / interface / forms / physical_exam / report.php
blobf60cfdac6d6ddbb6734a499decc0198cc987ff77
1 <?php
2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
3 //
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) {
14 global $pelines;
16 $rows = array();
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
31 echo " <tr>\n";
32 echo " <td class='text' align='center'>" . ($linedbrow['wnl'] ? "WNL" : "") . "&nbsp;&nbsp;</td>\n";
33 echo " <td class='text' align='center'>" . ($linedbrow['abn'] ? "ABN1" : "") . "&nbsp;&nbsp;</td>\n";
34 echo " <td class='text' nowrap>$sysnamedisp&nbsp;&nbsp;</td>\n";
35 echo " <td class='text' nowrap>$description&nbsp;&nbsp;</td>\n";
36 echo " <td class='text'>" . $linedbrow['diagnosis'] . "&nbsp;&nbsp;</td>\n";
37 echo " <td class='text'>" . htmlentities($linedbrow['comments']) . "</td>\n";
38 echo " </tr>\n";
39 } else { // treatment line
40 echo " <tr>\n";
41 echo " <td class='text' align='center'>" . ($linedbrow['wnl'] ? "Y" : "") . "&nbsp;&nbsp;</td>\n";
42 echo " <td class='text' align='center'>&nbsp;&nbsp;</td>\n";
43 echo " <td class='text' colspan='2' nowrap>$description&nbsp;&nbsp;</td>\n";
44 echo " <td class='text' colspan='2'>" . htmlentities($linedbrow['comments']) . "</td>\n";
45 echo " </tr>\n";
47 $sysnamedisp = '';
48 } // end of line
49 } // end of system name
51 echo "</table>\n";
53 ?>