2 include_once("../../globals.php");
3 include_once("$srcdir/forms.inc");
4 include_once("$srcdir/calendar.inc");
5 include_once("$srcdir/acl.inc");
10 <?php
html_header_show();?
>
11 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
12 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
14 <script language
="JavaScript">
16 // Process click on Delete link.
18 dlgopen('../deleter.php?encounterid=<?php echo $encounter; ?>', '_blank', 500, 450);
22 // Called by the deleter.php window on a successful delete.
23 function imdeleted() {
24 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
25 parent
.parent
.left_nav
.clearEncounter();
28 top
.Title
.location
.href
= '../patient_file/encounter/encounter_title.php';
29 top
.Main
.location
.href
= '../patient_file/encounter/patient_encounter.php?mode=new';
37 <body
class="body_top">
39 <span
class="title"><?php
xl('This Encounter','e'); ?
></span
>
41 $auth_notes_a = acl_check('encounters', 'notes_a');
42 $auth_notes = acl_check('encounters', 'notes');
43 $auth_relaxed = acl_check('encounters', 'relaxed');
45 if (is_numeric($pid)) {
46 // Check for no access to the patient's squad.
47 $result = getPatientData($pid, "fname,lname,squad");
48 echo " for " . $result['fname'] . " " . $result['lname'];
49 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
50 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
52 // Check for no access to the encounter's sensitivity level.
53 $result = sqlQuery("SELECT sensitivity FROM form_encounter WHERE " .
54 "pid = '$pid' AND encounter = '$encounter' LIMIT 1");
55 if ($result['sensitivity'] && !acl_check('sensitivities', $result['sensitivity'])) {
56 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
61 if (acl_check('admin', 'super')) {
62 echo " <a href='' onclick='return deleteme()'>" .
63 "<font class='more' style='color:red'>(Delete)</font></a>";
67 if ($result = getFormByEncounter($pid, $encounter, "id, date, form_id, form_name, formdir, user, deleted")) {
68 echo "<table style='border-collapse:collapse; width:100%;'>";
69 echo "<tr><th>User</th><th>Form</th><th></th></tr>";
70 foreach ($result as $iter) {
71 $formdir = $iter['formdir'];
73 // skip forms whose 'deleted' flag is set to 1
74 if ($iter['deleted'] == 1) continue;
76 // Skip forms that we are not authorized to see.
77 if (($auth_notes_a) ||
78 ($auth_notes && $iter['user'] == $_SESSION['authUser']) ||
79 ($auth_relaxed && ($formdir == 'sports_fitness' ||
$formdir == 'podiatry'))) ;
82 // $form_info = getFormInfoById($iter['id']);
83 echo '<tr style="vertical-align:top; border-bottom:1px solid black;">';
84 $user = getNameFromUsername($iter['user']);
86 $form_name = ($formdir == 'newpatient') ?
"Patient Encounter" : $iter['form_name'];
88 echo '<td style="border-top:1px solid black;" class="text"><span style="font-weight:bold;">' .
89 $user['fname'] . " " . $user['lname'] .'</span></td>';
90 echo "<td style='vertical-align:top; border-top:1px solid black; text-align:center;' >";
92 // a link to edit the form
94 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
95 "' href='$rootdir/patient_file/encounter/view_form.php?" .
96 "formname=" . $formdir . "&id=" . $iter['form_id'] .
97 "' class='text' onclick='top.restoreSession()'>$form_name</a>";
99 if (acl_check('admin', 'super')) {
100 // a link to delete the form from the encounter
101 echo "<span class='small'> (<a target='".
102 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
103 "' href='$rootdir/patient_file/encounter/delete_form.php?" .
104 "formname=" . $formdir .
105 "&id=" . $iter['id'] .
106 "&encounter=". $encounter.
108 "' class='small' title='Delete this form' onclick='top.restoreSession()'>Delete</a>)</span>";
112 "<td style='border-top:1px solid black; width: 25px'> </td>\n" .
113 "<td style='border-top:1px solid black; vertical-align:top;'>";
115 // Use the form's report.php for display.
117 include_once($GLOBALS['incdir'] . "/forms/$formdir/report.php");
118 call_user_func($formdir . "_report", $pid, $iter['encounter'], 2, $iter['form_id']);
126 <?php
if ($GLOBALS['athletic_team'] && $GLOBALS['concurrent_layout'] == 2) { ?
>
127 <script language
='JavaScript'>
128 // If this is the top frame then show the encounters list in the bottom frame.
129 var n
= parent
.parent
.left_nav
;
130 var nf
= n
.document
.forms
[0];
131 if (parent
.window
.name
== 'RTop' && nf
.cb_bot
.checked
) {
132 var othername
= 'RBot';
133 n
.setRadio(othername
, 'ens');
134 n
.loadFrame('ens1', othername
, 'patient_file/history/encounters.php');