c4c625f4aec7026eec88f4244c184f0e42d8c32c
[openemr.git] / interface / forms / procedure_order / report.php
blobc4c625f4aec7026eec88f4244c184f0e42d8c32c
1 <?php
2 // Copyright (C) 2010 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($GLOBALS["srcdir"] . "/options.inc.php");
13 function procedure_order_report($pid, $encounter, $cols, $id) {
14 $cols = 1; // force always 1 column
15 $count = 0;
16 $data = sqlQuery("SELECT pt.name as Procedure_Order,po.* " .
17 "FROM procedure_order as po, procedure_type as pt WHERE " .
18 "po.procedure_type_id = pt.procedure_type_id AND po.procedure_order_id = '$id' AND po.activity = '1'");
19 if ($data) {
20 print "<table cellpadding='0' cellspacing='0'>\n<tr>\n";
21 foreach($data as $key => $value) {
22 if ($key == "procedure_order_id" || $key == "pid" || $key == "user" || $key == "groupname" ||
23 $key == "authorized" || $key == "activity" || $key == "date" ||
24 $value == "" || $value == "0" || $value == "0.00") {
25 continue;
28 $key=ucwords(str_replace("_"," ",$key));
29 if ($key == "Order Priority") {
30 print "<td valign='top'><span class='bold'>" . xl($key). ": </span><span class='text'>" .
31 generate_display_field(array('data_type'=>'1','list_id'=>'ord_priority'),$value) .
32 " &nbsp;</span></td>\n";
34 else if ($key == "Order Status") {
35 print "<td valign='top'><span class='bold'>" . xl($key). ": </span><span class='text'>" .
36 generate_display_field(array('data_type'=>'1','list_id'=>'ord_status'),$value) .
37 " &nbsp;</span></td>\n";
39 else {
40 print "<td valign='top'><span class='bold'>" . xl($key). ": </span><span class='text'>$value &nbsp;</span></td>\n";
42 $count++;
43 if ($count == $cols) {
44 $count = 0;
45 print "</tr>\n<tr>\n";
48 print "</tr>\n</table>\n";