fix to immun expiration date print on shot record
[openemr.git] / interface / patient_file / summary / fitness_status.php
blob0bad5d7e5c7ef70f742210c7645260764a1cbfab
1 <?php
2 // Copyright (C) 2008 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 require_once("../../globals.php");
10 require_once("$srcdir/forms.inc");
11 require_once("$srcdir/patient.inc");
12 require_once("$srcdir/lists.inc");
13 require_once("$srcdir/acl.inc");
14 require_once("$srcdir/formatting.inc.php");
16 $accounting_enabled = $GLOBALS['oer_config']['ws_accounting']['enabled'];
18 // Get relevant ACL info.
19 $auth_notes_a = acl_check('encounters', 'notes_a');
20 $auth_notes = acl_check('encounters', 'notes');
21 $auth_relaxed = acl_check('encounters', 'relaxed');
22 $auth_demo = acl_check('patients' , 'demo');
24 $tmp = getPatientData($pid, "squad");
25 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
26 $auth_notes_a = $auth_notes = $auth_demo = $auth_relaxed = 0;
28 if (!($auth_notes_a || $auth_notes || $auth_relaxed)) {
29 echo "<body>\n<html>\n";
30 echo "<p>(".xl('Encounters not authorized').")</p>\n";
31 echo "</body>\n</html>\n";
32 exit();
35 <html>
36 <head>
37 <?php html_header_show();?>
38 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
39 <script type="text/javascript" src="../../../library/tooltip.js"></script>
41 <script language="JavaScript">
43 function toencounter(enc, datestr) {
44 top.restoreSession();
45 <?php if ($GLOBALS['concurrent_layout']) { ?>
46 parent.parent.left_nav.setEncounter(datestr, enc, parent.window.name);
47 parent.parent.left_nav.setRadio(parent.window.name, 'enc');
48 parent.location.href = '../encounter/encounter_top.php?set_encounter=' + enc;
49 <?php } else { ?>
50 top.Title.location.href = '../encounter/encounter_title.php?set_encounter=' + enc;
51 top.Main.location.href = '../encounter/patient_encounter.php?set_encounter=' + enc;
52 <?php } ?>
55 </script>
57 </head>
59 <body class="body_bottom">
61 <font class='title'><?php xl('Stength and Conditioning','e'); ?></font>
63 <br>
65 <table>
66 <tr>
67 <td class='bold'><?php xl('Date','e'); ?></td>
68 <td class='bold'><?php xl('Reason','e'); ?></td>
69 <td class='bold'><?php xl('Provider','e'); ?></td>
70 </tr>
72 <?php
73 $res = sqlStatement("SELECT " .
74 "f.encounter, f.user, fe.date, fe.reason, fe.sensitivity " .
75 "FROM forms AS f " .
76 "LEFT OUTER JOIN form_encounter AS fe ON fe.pid = f.pid " .
77 "AND fe.encounter = f.encounter " .
78 "WHERE f.pid = '$pid' AND f.formdir = 'strength_conditioning' " .
79 "ORDER BY fe.date DESC, f.encounter DESC");
81 while ($row = sqlFetchArray($res)) {
82 $raw_encounter_date = date("Y-m-d", strtotime($row['date']));
83 $reason_string = $row['reason'];
84 $auth_sensitivity = true;
86 $href = "javascript:window.toencounter(" . $row['encounter'] . ",\"" .
87 oeFormatShortDate($raw_encounter_date) . "\")";
88 $linkbeg = "<a class='text' href='$href'>";
89 $linkend = "</a>";
91 if ($row['sensitivity']) {
92 $auth_sensitivity = acl_check('sensitivities', $row['sensitivity']);
93 if (!$auth_sensitivity) {
94 $reason_string = "(No access)";
95 $linkbeg = "<span class='text'>";
96 $linkend = "</span>";
100 echo "<tr>\n";
102 // show encounter date
103 echo "<td valign='top'>$linkbeg$raw_encounter_date$linkend</td>\n";
105 // show encounter reason/title
106 echo "<td valign='top'>$linkbeg" . $reason_string . "$linkend</td>\n";
108 // show user who created the encounter
109 echo "<td valign='top'>$linkbeg" . $row['user'] . "$linkend</td>\n";
111 echo "</tr>\n";
115 </table>
117 </body>
118 </html>