migrate old clinical notes form to clinic note (#4516)
[openemr.git] / interface / forms / clinic_note / report.php
blob26c87f2719491ae2ac2ba4789aff3405505a41f9
1 <?php
3 /**
4 * clinic_note report.php
6 * @package OpenEMR
7 * @link https://www.open-emr.org
8 * @author Rod Roark <rod@sunsetsystems.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2005 Rod Roark <rod@sunsetsystems.com>
11 * @copyright Copyright (c) 2021 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../../globals.php");
16 require_once($GLOBALS["srcdir"] . "/api.inc");
18 function clinic_note_report($pid, $encounter, $cols, $id)
20 $cols = 1; // force always 1 column
21 $count = 0;
22 $data = sqlQuery("SELECT * " .
23 "FROM form_clinic_note WHERE " .
24 "id = ? AND activity = '1'", array($id));
25 if ($data) {
26 print "<table cellpadding='0' cellspacing='0'>\n<tr>\n";
27 foreach ($data as $key => $value) {
28 if (
29 $key == "id" || $key == "pid" || $key == "user" || $key == "groupname" ||
30 $key == "authorized" || $key == "activity" || $key == "date" ||
31 $value == "" || $value == "0" || $value == "0.00"
32 ) {
33 continue;
36 if ($key == 'followup_required') {
37 switch ($value) {
38 case '1':
39 $value = 'Yes';
40 break;
41 case '2':
42 $value = 'Pending investigation';
43 break;
47 $key = ucwords(str_replace("_", " ", $key));
48 print "<td valign='top'><span class='bold'>" . xlt($key) . ": </span><span class='text'>" . text($value) . "&nbsp;</span></td>\n";
49 $count++;
50 if ($count == $cols) {
51 $count = 0;
52 print "</tr>\n<tr>\n";
56 print "</tr>\n</table>\n";