preparing for 5.0.1 release in several weeks (#1509)
[openemr.git] / interface / forms / observation / report.php
blob1ba1050df4fbf3b612867ecb4bf2b6b21918e820
1 <?php
2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2015 Z&H Consultancy Services Private Limited <sam@zhservices.com>
4 //
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 //
23 // Author: Jacob T Paul <jacob@zhservices.com>
24 // Vinish K <vinish@zhservices.com>
26 // +------------------------------------------------------------------------------+
28 include_once("../../globals.php");
29 include_once($GLOBALS["srcdir"] . "/api.inc");
31 function observation_report($pid, $encounter, $cols, $id)
33 $count = 0;
34 $sql = "SELECT * FROM `form_observation` WHERE id=? AND pid = ? AND encounter = ?";
35 $res = sqlStatement($sql, array($id,$_SESSION["pid"], $_SESSION["encounter"]));
39 for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
40 $data[$iter] = $row;
43 if ($data) {
44 print "<table style='border-collapse:collapse;border-spacing:0;width: 100%;'>
45 <tr>
46 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Code')."</span></td>
47 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Description')."</span></td>
48 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Code Type')."</span></td>
49 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Table Code')."</span></td>
50 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Value')."</span></td>
51 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Unit')."</span></td>
52 <td align='center' style='border:1px solid #ccc;padding:4px;'><span class=bold>".xlt('Date')."</span></td>
53 </tr>";
54 foreach ($data as $key => $value) {
55 if ($value['code'] == 'SS003') {
56 if ($value['ob_value'] == '261QE0002X') {
57 $value['ob_value'] ='Emergency Care';
58 } else if ($value['ob_value'] == '261QM2500X') {
59 $value['ob_value'] ='Medical Specialty';
60 } else if ($value['ob_value'] == '261QP2300X') {
61 $value['ob_value'] ='Primary Care';
62 } else if ($value['ob_value'] == '261QU0200X') {
63 $value['ob_value'] ='Urgent Care';
67 if ($value['code'] == '21612-7') {
68 if ($value['ob_unit'] == 'd') {
69 $value['ob_unit'] ='Day';
70 } else if ($value['ob_unit'] == 'mo') {
71 $value['ob_unit'] ='Month';
72 } else if ($value['ob_unit'] == 'UNK') {
73 $value['ob_unit'] ='Unknown';
74 } else if ($value['ob_unit'] == 'wk') {
75 $value['ob_unit'] ='Week';
76 } else if ($value['ob_unit'] == 'a') {
77 $value['ob_unit'] ='Year';
81 print "<tr>
82 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['code'])."</span></td>
83 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['description'])."</span></td>
84 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['code_type'])."</span></td>
85 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['table_code'])."</span></td>
86 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['ob_value'])."</span></td>
87 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['ob_unit'])."</span></td>
88 <td style='border:1px solid #ccc;padding:4px;'><span class=text>".text($value['date'])."</span></td>
89 </tr>";
90 print "\n";
93 print "</table>";