Highway to PSR2
[openemr.git] / contrib / forms / review_of_systems / report.php
blobc3064e25635d7d8ae28187d1d838ba800c433737
1 <?php
2 include_once("../../globals.php");
3 include_once($GLOBALS["srcdir"]."/api.inc");
5 function review_of_systems_report($pid, $encounter, $cols, $id)
7 $count = 0;
8 $data = formFetch("form_review_of_systems", $id);
9 $sql = "SELECT name from form_review_of_systems_checks where foreign_id = '" . add_escape_custom($id) . "'";
10 $results = sqlQ($sql);
11 $data2 = array();
12 while ($row = sqlFetchArray($results)) {
13 $data2[] = $row['name'];
16 $data = array_merge($data, $data2);
17 if ($data) {
18 print "<table><tr>";
19 foreach ($data as $key => $value) {
20 if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") {
21 continue;
24 if ($value == "on") {
25 $value = "yes";
28 $key=ucwords(str_replace("_", " ", $key));
29 if (is_numeric($key)) {
30 $key = "check";
33 print "<td><span class=bold>$key: </span><span class=text>$value</span></td>";
34 $count++;
35 if ($count == $cols) {
36 $count = 0;
37 print "</tr><tr>\n";