2 // Copyright (C) 2010 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($GLOBALS["srcdir"] . "/options.inc.php");
13 function procedure_order_report($pid, $encounter, $cols, $id) {
14 $cols = 1; // force always 1 column
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'");
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") {
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 " </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 " </span></td>\n";
40 print "<td valign='top'><span class='bold'>" . xl($key). ": </span><span class='text'>$value </span></td>\n";
43 if ($count == $cols) {
45 print "</tr>\n<tr>\n";
48 print "</tr>\n</table>\n";