2 // Copyright (C) 2008 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 require_once("../../globals.php");
10 require_once("$srcdir/forms.inc");
11 require_once("$srcdir/pnotes.inc");
12 require_once("$srcdir/patient.inc");
13 require_once("$srcdir/lists.inc");
14 require_once("$srcdir/acl.inc");
15 require_once("$srcdir/formatting.inc.php");
17 $accounting_enabled = $GLOBALS['oer_config']['ws_accounting']['enabled'];
19 // Get relevant ACL info.
20 $auth_notes_a = acl_check('encounters', 'notes_a');
21 $auth_notes = acl_check('encounters', 'notes');
22 $auth_relaxed = acl_check('encounters', 'relaxed');
23 $auth_demo = acl_check('patients' , 'demo');
25 $tmp = getPatientData($pid, "squad");
26 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
27 $auth_notes_a = $auth_notes = $auth_demo = $auth_relaxed = 0;
29 if (!($auth_notes_a ||
$auth_notes ||
$auth_relaxed)) {
30 echo "<body>\n<html>\n";
31 echo "<p>(".xl('Encounters not authorized').")</p>\n";
32 echo "</body>\n</html>\n";
38 <?php
html_header_show();?
>
39 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
40 <script type
="text/javascript" src
="../../../library/tooltip.js"></script
>
42 <script language
="JavaScript">
44 function toencounter(enc
, datestr
) {
46 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
47 parent
.parent
.left_nav
.setEncounter(datestr
, enc
, parent
.window
.name
);
48 parent
.parent
.left_nav
.setRadio(parent
.window
.name
, 'enc');
49 parent
.location
.href
= '../encounter/encounter_top.php?set_encounter=' + enc
;
51 top
.Title
.location
.href
= '../encounter/encounter_title.php?set_encounter=' + enc
;
52 top
.Main
.location
.href
= '../encounter/patient_encounter.php?set_encounter=' + enc
;
60 <body
class="body_bottom">
62 <font
class='title'><?php
xl('Stength and Conditioning','e'); ?
></font
>
68 <td
class='bold'><?php
xl('Date','e'); ?
></td
>
69 <td
class='bold'><?php
xl('Reason','e'); ?
></td
>
70 <td
class='bold'><?php
xl('Provider','e'); ?
></td
>
74 $res = sqlStatement("SELECT " .
75 "f.encounter, f.user, fe.date, fe.reason, fe.sensitivity " .
77 "LEFT OUTER JOIN form_encounter AS fe ON fe.pid = f.pid " .
78 "AND fe.encounter = f.encounter " .
79 "WHERE f.pid = '$pid' AND f.formdir = 'strength_conditioning' " .
80 "ORDER BY fe.date DESC, f.encounter DESC");
82 while ($row = sqlFetchArray($res)) {
83 $raw_encounter_date = date("Y-m-d", strtotime($row['date']));
84 $reason_string = $row['reason'];
85 $auth_sensitivity = true;
87 $href = "javascript:window.toencounter(" . $row['encounter'] . ",\"" .
88 oeFormatShortDate($raw_encounter_date) . "\")";
89 $linkbeg = "<a class='text' href='$href'>";
92 if ($row['sensitivity']) {
93 $auth_sensitivity = acl_check('sensitivities', $row['sensitivity']);
94 if (!$auth_sensitivity) {
95 $reason_string = "(No access)";
96 $linkbeg = "<span class='text'>";
103 // show encounter date
104 echo "<td valign='top'>$linkbeg$raw_encounter_date$linkend</td>\n";
106 // show encounter reason/title
107 echo "<td valign='top'>$linkbeg" . $reason_string . "$linkend</td>\n";
109 // show user who created the encounter
110 echo "<td valign='top'>$linkbeg" . $row['user'] . "$linkend</td>\n";