2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
7 require_once("../../globals.php");
8 require_once("$srcdir/forms.inc");
9 require_once("$srcdir/calendar.inc");
10 require_once("$srcdir/acl.inc");
11 require_once("$srcdir/formatting.inc.php");
12 require_once("$srcdir/patient.inc");
17 <?php
html_header_show();?
>
18 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
20 <!-- supporting javascript code
-->
21 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
23 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
27 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
28 <link rel
="stylesheet" type
="text/css" href
="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
29 <style type
="text/css">@import
url(../../../library
/dynarch_calendar
.css
);</style
>
30 <script type
="text/javascript" src
="../../../library/textformat.js"></script
>
31 <script type
="text/javascript" src
="../../../library/dynarch_calendar.js"></script
>
32 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
33 <script type
="text/javascript" src
="../../../library/dynarch_calendar_setup.js"></script
>
34 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
35 <script type
="text/javascript" src
="../../../library/js/jquery.1.3.2.js"></script
>
36 <script type
="text/javascript" src
="../../../library/js/common.js"></script
>
37 <script type
="text/javascript" src
="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
39 <script language
="JavaScript">
41 // Process click on Delete link.
43 dlgopen('../deleter.php?encounterid=<?php echo $encounter; ?>', '_blank', 500, 450);
47 // Called by the deleter.php window on a successful delete.
48 function imdeleted() {
49 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
50 parent
.parent
.left_nav
.clearEncounter();
53 top
.Title
.location
.href
= '../patient_file/encounter/encounter_title.php';
54 top
.Main
.location
.href
= '../patient_file/encounter/patient_encounter.php?mode=new';
60 <script language
="javascript">
61 function expandcollapse(atr
){
64 var mydivid
="divid_"+i
;var myspanid
="spanid_"+i
;
65 var ele
= document
.getElementById(mydivid
); var text
= document
.getElementById(myspanid
);
66 ele
.style
.display
= "block";text
.innerHTML
= "<?php xl('Collapse','e'); ?>";
71 var mydivid
="divid_"+i
;var myspanid
="spanid_"+i
;
72 var ele
= document
.getElementById(mydivid
); var text
= document
.getElementById(myspanid
);
73 ele
.style
.display
= "none"; text
.innerHTML
= "<?php xl('Expand','e'); ?>";
79 function divtoggle(spanid
, divid
) {
80 var ele
= document
.getElementById(divid
);
81 var text
= document
.getElementById(spanid
);
82 if(ele
.style
.display
== "block") {
83 ele
.style
.display
= "none";
84 text
.innerHTML
= "<?php xl('Expand','e'); ?>";
87 ele
.style
.display
= "block";
88 text
.innerHTML
= "<?php xl('Collapse','e'); ?>";
93 <style type
="text/css">
99 div
.form_header_controls
{
100 float:left
;margin
-bottom
:2px
;
111 <body
class="body_top">
113 <div id
="encounter_forms">
117 $dateres = getEncounterDateByEncounter($encounter);
118 $encounter_date = date("Y-m-d",strtotime($dateres["date"]));
121 <div style
='float:left'>
122 <span
class="title"><?php
echo oeFormatShortDate($encounter_date) . " " . xl("Encounter"); ?
> </span
>
124 $auth_notes_a = acl_check('encounters', 'notes_a');
125 $auth_notes = acl_check('encounters', 'notes');
126 $auth_relaxed = acl_check('encounters', 'relaxed');
128 if (is_numeric($pid)) {
129 // Check for no access to the patient's squad.
130 $result = getPatientData($pid, "fname,lname,squad");
131 echo htmlspecialchars( xl('for','',' ',' ') . $result['fname'] . " " . $result['lname'] );
132 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
133 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
135 // Check for no access to the encounter's sensitivity level.
136 $result = sqlQuery("SELECT sensitivity FROM form_encounter WHERE " .
137 "pid = '$pid' AND encounter = '$encounter' LIMIT 1");
138 if ($result['sensitivity'] && !acl_check('sensitivities', $result['sensitivity'])) {
139 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
144 <div style
='float:left;margin-left:10px'>
145 <?php
if (acl_check('admin', 'super')) { ?
>
146 <a href
='toggledivs(this.id,this.id);' class='css_button' onclick
='return deleteme()'><span
><?php
echo xl('Delete') ?
></span
></a
>
147  
; 
; 
;<a href
="#" onClick
='expandcollapse("expand");' style
="font-size:80%;"><?php
xl('Expand All','e'); ?
></a
>
148  
; 
; 
;<a style
="font-size:80%;" href
="#" onClick
='expandcollapse("collapse");'><?php
xl('Collapse All','e'); ?
></a
>
155 if ($result = getFormByEncounter($pid, $encounter, "id, date, form_id, form_name, formdir, user, deleted")) {
156 echo "<table width='100%' id='partable'>";
158 foreach ($result as $iter) {
159 $formdir = $iter['formdir'];
161 // skip forms whose 'deleted' flag is set to 1
162 if ($iter['deleted'] == 1) continue;
164 // Skip forms that we are not authorized to see.
165 if (($auth_notes_a) ||
166 ($auth_notes && $iter['user'] == $_SESSION['authUser']) ||
167 ($auth_relaxed && ($formdir == 'sports_fitness' ||
$formdir == 'podiatry'))) ;
170 // $form_info = getFormInfoById($iter['id']);
171 if (strtolower(substr($iter['form_name'],0,5)) == 'camos') {
172 //CAMOS generates links from report.php and these links should
173 //be clickable without causing view.php to come up unexpectedly.
174 //I feel that the JQuery code in this file leading to a click
175 //on the report.php content to bring up view.php steps on a
176 //form's autonomy to generate it's own html content in it's report
177 //but until any other form has a problem with this, I will just
178 //make an exception here for CAMOS and allow it to carry out this
179 //functionality for all other forms. --Mark
180 echo '<tr title="' . xl('Edit form') . '" '.
181 'id="'.$formdir.'~'.$iter['form_id'].'">';
183 echo '<tr title="' . xl('Edit form') . '" '.
184 'id="'.$formdir.'~'.$iter['form_id'].'" class="text onerow">';
186 $user = getNameFromUsername($iter['user']);
188 $form_name = ($formdir == 'newpatient') ?
xl('Patient Encounter') : xl_form_title($iter['form_name']);
191 echo "<td style='border-bottom:1px solid'>";
192 // a link to edit the form
193 echo "<div class='form_header_controls'>";
195 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
196 "' href='$rootdir/patient_file/encounter/view_form.php?" .
197 "formname=" . $formdir . "&id=" . $iter['form_id'] .
198 "' onclick='top.restoreSession()' class='css_button_small'><span>" . xl('Edit') . "</span></a>";
200 if (acl_check('admin', 'super') ) {
201 if ( $formdir != 'newpatient') {
202 // a link to delete the form from the encounter
204 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
205 "' href='$rootdir/patient_file/encounter/delete_form.php?" .
206 "formname=" . $formdir .
207 "&id=" . $iter['id'] .
208 "&encounter=". $encounter.
210 "' class='css_button_small' title='" . xl('Delete this form') . "' onclick='top.restoreSession()'><span>" . xl('Delete') . "</span></a>";
212 ?
><a href
='javascript:;' class='css_button_small' style
='color:gray'><span
><?php
xl('Delete','e'); ?
></span
></a
><?php
216 echo "<div class='form_header'>";
217 echo "<a href='#' onclick='divtoggle(\"spanid_$divnos\",\"divid_$divnos\");' class='small' id='aid_$divnos'><b>$form_name</b> <span class='text'>by " . htmlspecialchars( $user['fname'] . " " . $user['lname'] ) . "</span> (<span id=spanid_$divnos class=\"indicator\">" . xl('Collapse') . "</span>)</a></div>";
221 echo "<td valign='top' class='formrow'><div class='tab' id='divid_$divnos' style='display:block'>";
223 // Use the form's report.php for display. Forms with names starting with LBF
224 // are list-based forms sharing a single collection of code.
226 if (substr($formdir,0,3) == 'LBF') {
227 include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
228 call_user_func("lbf_report", $pid, $encounter, 2, $iter['form_id'], $formdir);
231 include_once($GLOBALS['incdir'] . "/forms/$formdir/report.php");
232 call_user_func($formdir . "_report", $pid, $encounter, 2, $iter['form_id']);
235 echo "</div></td></tr>";
242 <?php
if ($GLOBALS['athletic_team'] && $GLOBALS['concurrent_layout'] == 2) { ?
>
243 <script language
='JavaScript'>
244 // If this is the top frame then show the encounters list in the bottom frame.
245 var n
= parent
.parent
.left_nav
;
246 var nf
= n
.document
.forms
[0];
247 if (parent
.window
.name
== 'RTop' && nf
.cb_bot
.checked
) {
248 var othername
= 'RBot';
249 n
.setRadio(othername
, 'ens');
250 n
.loadFrame('ens1', othername
, 'patient_file/history/encounters.php');
255 </div
> <!-- end large encounter_forms DIV
-->
258 <script language
="javascript">
259 // jQuery stuff to make the page a little easier to use
261 $
(document
).ready(function(){
262 $
(".save").click(function() { top
.restoreSession(); document
.my_form
.submit(); });
263 $
(".dontsave").click(function() { location
.href
='<?php echo "$rootdir/patient_file/encounter/$returnurl";?>'; });
265 $
(".onerow").mouseover(function() { $
(this
).toggleClass("highlight"); });
266 $
(".onerow").mouseout(function() { $
(this
).toggleClass("highlight"); });
267 $
(".onerow").click(function() { GotoForm(this
); });
269 // $(".deleteme").click(function(evt) { deleteme(); evt.stopPropogation(); });
271 var GotoForm
= function(obj
) {
272 var parts
= $
(obj
).attr("id").split("~");
273 top
.restoreSession();
274 <?php
if ($GLOBALS['concurrent_layout']): ?
>
275 parent
.location
.href
= "<?php echo $rootdir; ?>/patient_file/encounter/view_form.php?formname="+parts
[0]+
"&id="+parts
[1];
277 top
.Main
.location
.href
= "<?php echo $rootdir; ?>/patient_file/encounter/view_form.php?formname="+parts
[0]+
"&id="+parts
[1];