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");
13 require_once("$srcdir/amc.php");
18 <?php
html_header_show();?
>
19 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
21 <!-- supporting javascript code
-->
22 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
24 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
28 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
29 <link rel
="stylesheet" type
="text/css" href
="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
30 <style type
="text/css">@import
url(../../../library
/dynarch_calendar
.css
);</style
>
31 <script type
="text/javascript" src
="../../../library/textformat.js"></script
>
32 <script type
="text/javascript" src
="../../../library/dynarch_calendar.js"></script
>
33 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
34 <script type
="text/javascript" src
="../../../library/dynarch_calendar_setup.js"></script
>
35 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
36 <script type
="text/javascript" src
="../../../library/js/jquery.1.3.2.js"></script
>
37 <script type
="text/javascript" src
="../../../library/js/common.js"></script
>
38 <script type
="text/javascript" src
="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
40 <script language
="JavaScript">
42 // Process click on Delete link.
44 dlgopen('../deleter.php?encounterid=<?php echo $encounter; ?>', '_blank', 500, 450);
48 // Called by the deleter.php window on a successful delete.
49 function imdeleted(EncounterId
) {
50 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
51 top
.window
.parent
.left_nav
.removeOptionSelected(EncounterId
);
52 top
.window
.parent
.left_nav
.clearEncounter();
55 top
.Title
.location
.href
= '../patient_file/encounter/encounter_title.php';
56 top
.Main
.location
.href
= '../patient_file/encounter/patient_encounter.php?mode=new';
62 <script language
="javascript">
63 function expandcollapse(atr
){
66 var mydivid
="divid_"+i
;var myspanid
="spanid_"+i
;
67 var ele
= document
.getElementById(mydivid
); var text
= document
.getElementById(myspanid
);
68 ele
.style
.display
= "block";text
.innerHTML
= "<?php xl('Collapse','e'); ?>";
73 var mydivid
="divid_"+i
;var myspanid
="spanid_"+i
;
74 var ele
= document
.getElementById(mydivid
); var text
= document
.getElementById(myspanid
);
75 ele
.style
.display
= "none"; text
.innerHTML
= "<?php xl('Expand','e'); ?>";
81 function divtoggle(spanid
, divid
) {
82 var ele
= document
.getElementById(divid
);
83 var text
= document
.getElementById(spanid
);
84 if(ele
.style
.display
== "block") {
85 ele
.style
.display
= "none";
86 text
.innerHTML
= "<?php xl('Expand','e'); ?>";
89 ele
.style
.display
= "block";
90 text
.innerHTML
= "<?php xl('Collapse','e'); ?>";
95 <style type
="text/css">
101 div
.form_header_controls
{
102 float:left
;margin
-bottom
:2px
;
114 require_once("$incdir/patient_file/encounter/new_form.php");
116 <body
class="body_top">
118 <div id
="encounter_forms">
122 $dateres = getEncounterDateByEncounter($encounter);
123 $encounter_date = date("Y-m-d",strtotime($dateres["date"]));
124 $providerIDres = getProviderIdOfEncounter($encounter);
125 $providerNameRes = getProviderName($providerIDres);
128 <div style
='float:left'>
129 <span
class="title"><?php
echo oeFormatShortDate($encounter_date) . " " . xl("Encounter"); ?
> </span
>
131 $auth_notes_a = acl_check('encounters', 'notes_a');
132 $auth_notes = acl_check('encounters', 'notes');
133 $auth_relaxed = acl_check('encounters', 'relaxed');
135 if (is_numeric($pid)) {
136 // Check for no access to the patient's squad.
137 $result = getPatientData($pid, "fname,lname,squad");
138 echo htmlspecialchars( xl('for','',' ',' ') . $result['fname'] . " " . $result['lname'] );
139 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
140 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
142 // Check for no access to the encounter's sensitivity level.
143 $result = sqlQuery("SELECT sensitivity FROM form_encounter WHERE " .
144 "pid = '$pid' AND encounter = '$encounter' LIMIT 1");
145 if ($result['sensitivity'] && !acl_check('sensitivities', $result['sensitivity'])) {
146 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
153 <div style
='float:left;margin-left:10px'>
154 <?php
if (acl_check('admin', 'super')) { ?
>
155 <a href
='toggledivs(this.id,this.id);' class='css_button' onclick
='return deleteme()'><span
><?php
echo xl('Delete') ?
></span
></a
>
157  
; 
; 
;<a href
="#" onClick
='expandcollapse("expand");' style
="font-size:80%;"><?php
xl('Expand All','e'); ?
></a
>
158  
; 
; 
;<a style
="font-size:80%;" href
="#" onClick
='expandcollapse("collapse");'><?php
xl('Collapse All','e'); ?
></a
>
161 <?php
if ($GLOBALS['enable_amc_prompting']) { ?
>
162 <div style
='float:right;margin-right:25px;border-style:solid;border-width:1px;'>
163 <div style
='float:left;margin:5px 5px 5px 5px;'>
167 <?php
// Display the education resource checkbox (AMC prompting)
168 $itemAMC = amcCollect("patient_edu_amc", $pid, 'form_encounter', $encounter);
170 <?php
if (!(empty($itemAMC))) { ?
>
171 <input type
="checkbox" id
="prov_edu_res" checked
>
173 <input type
="checkbox" id
="prov_edu_res">
177 <span
class="text"><?php
echo xl('Provided Education Resource(s)?') ?
></span
>
182 <?php
// Display the Provided Clinical Summary checkbox (AMC prompting)
183 $itemAMC = amcCollect("provide_sum_pat_amc", $pid, 'form_encounter', $encounter);
185 <?php
if (!(empty($itemAMC))) { ?
>
186 <input type
="checkbox" id
="provide_sum_pat_flag" checked
>
188 <input type
="checkbox" id
="provide_sum_pat_flag">
192 <span
class="text"><?php
echo xl('Provided Clinical Summary?') ?
></span
>
195 <?php
// Display the medication reconciliation checkboxes (AMC prompting)
196 $itemAMC = amcCollect("med_reconc_amc", $pid, 'form_encounter', $encounter);
198 <?php
if (!(empty($itemAMC))) { ?
>
201 <input type
="checkbox" id
="trans_trand_care" checked
>
204 <span
class="text"><?php
echo xl('Transition/Transfer of Care?') ?
></span
>
208 <table style
="margin-left:2em;">
211 <?php
if (!(empty($itemAMC['date_completed']))) { ?
>
212 <input type
="checkbox" id
="med_reconc_perf" checked
>
214 <input type
="checkbox" id
="med_reconc_perf">
218 <span
class="text"><?php
echo xl('Medication Reconciliation Performed?') ?
></span
>
225 <input type
="checkbox" id
="trans_trand_care">
228 <span
class="text"><?php
echo xl('Transition/Transfer of Care?') ?
></span
>
232 <table style
="margin-left:2em;">
235 <input type
="checkbox" id
="med_reconc_perf" DISABLED
>
238 <span
class="text"><?php
echo xl('Medication Reconciliation Performed?') ?
></span
>
251 if ($result = getFormByEncounter($pid, $encounter, "id, date, form_id, form_name, formdir, user, deleted")) {
252 echo "<table width='100%' id='partable'>";
254 foreach ($result as $iter) {
255 $formdir = $iter['formdir'];
257 // skip forms whose 'deleted' flag is set to 1
258 if ($iter['deleted'] == 1) continue;
260 // Skip forms that we are not authorized to see.
261 if (($auth_notes_a) ||
262 ($auth_notes && $iter['user'] == $_SESSION['authUser']) ||
263 ($auth_relaxed && ($formdir == 'sports_fitness' ||
$formdir == 'podiatry'))) ;
266 // $form_info = getFormInfoById($iter['id']);
267 if (strtolower(substr($iter['form_name'],0,5)) == 'camos') {
268 //CAMOS generates links from report.php and these links should
269 //be clickable without causing view.php to come up unexpectedly.
270 //I feel that the JQuery code in this file leading to a click
271 //on the report.php content to bring up view.php steps on a
272 //form's autonomy to generate it's own html content in it's report
273 //but until any other form has a problem with this, I will just
274 //make an exception here for CAMOS and allow it to carry out this
275 //functionality for all other forms. --Mark
276 echo '<tr title="' . xl('Edit form') . '" '.
277 'id="'.$formdir.'~'.$iter['form_id'].'">';
279 echo '<tr title="' . xl('Edit form') . '" '.
280 'id="'.$formdir.'~'.$iter['form_id'].'" class="text onerow">';
282 $user = getNameFromUsername($iter['user']);
284 $form_name = ($formdir == 'newpatient') ?
xl('Patient Encounter') : xl_form_title($iter['form_name']);
287 echo "<td style='border-bottom:1px solid'>";
288 // a link to edit the form
289 echo "<div class='form_header_controls'>";
291 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
292 "' href='$rootdir/patient_file/encounter/view_form.php?" .
293 "formname=" . $formdir . "&id=" . $iter['form_id'] .
294 "' onclick='top.restoreSession()' class='css_button_small'><span>" . xl('Edit') . "</span></a>";
296 if (acl_check('admin', 'super') ) {
297 if ( $formdir != 'newpatient') {
298 // a link to delete the form from the encounter
300 ($GLOBALS['concurrent_layout'] ?
"_parent" : "Main") .
301 "' href='$rootdir/patient_file/encounter/delete_form.php?" .
302 "formname=" . $formdir .
303 "&id=" . $iter['id'] .
304 "&encounter=". $encounter.
306 "' class='css_button_small' title='" . xl('Delete this form') . "' onclick='top.restoreSession()'><span>" . xl('Delete') . "</span></a>";
308 ?
><a href
='javascript:;' class='css_button_small' style
='color:gray'><span
><?php
xl('Delete','e'); ?
></span
></a
><?php
312 echo "<div class='form_header'>";
314 // Figure out the correct author (encounter authors are the '$providerNameRes', while other
315 // form authors are the '$user['fname'] . " " . $user['lname']').
316 if ($formdir == 'newpatient') {
317 $form_author = $providerNameRes;
320 $form_author = $user['fname'] . " " . $user['lname'];
322 echo "<a href='#' onclick='divtoggle(\"spanid_$divnos\",\"divid_$divnos\");' class='small' id='aid_$divnos'><b>$form_name</b> <span class='text'>by " . htmlspecialchars( $form_author ) . "</span> (<span id=spanid_$divnos class=\"indicator\">" . xl('Collapse') . "</span>)</a></div>";
327 echo "<td valign='top' class='formrow'><div class='tab' id='divid_$divnos' style='display:block'>";
329 // Use the form's report.php for display. Forms with names starting with LBF
330 // are list-based forms sharing a single collection of code.
332 if (substr($formdir,0,3) == 'LBF') {
333 include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
334 call_user_func("lbf_report", $pid, $encounter, 2, $iter['form_id'], $formdir);
337 include_once($GLOBALS['incdir'] . "/forms/$formdir/report.php");
338 call_user_func($formdir . "_report", $pid, $encounter, 2, $iter['form_id']);
341 echo "</div></td></tr>";
348 <?php
if ($GLOBALS['athletic_team'] && $GLOBALS['concurrent_layout'] == 2) { ?
>
349 <script language
='JavaScript'>
350 // If this is the top frame then show the encounters list in the bottom frame.
351 // var n = parent.parent.left_nav;
352 var n
= top
.left_nav
;
353 var nf
= n
.document
.forms
[0];
354 if (parent
.window
.name
== 'RTop' && nf
.cb_bot
.checked
) {
355 var othername
= 'RBot';
356 n
.setRadio(othername
, 'ens');
357 n
.loadFrame('ens1', othername
, 'patient_file/history/encounters.php');
362 </div
> <!-- end large encounter_forms DIV
-->
365 <script language
="javascript">
366 // jQuery stuff to make the page a little easier to use
368 $
(document
).ready(function(){
369 $
(".save").click(function() { top
.restoreSession(); document
.my_form
.submit(); });
370 $
(".dontsave").click(function() { location
.href
='<?php echo "$rootdir/patient_file/encounter/$returnurl";?>'; });
372 $
(".onerow").mouseover(function() { $
(this
).toggleClass("highlight"); });
373 $
(".onerow").mouseout(function() { $
(this
).toggleClass("highlight"); });
374 $
(".onerow").click(function() { GotoForm(this
); });
376 $
("#prov_edu_res").click(function() {
377 if ( $
('#prov_edu_res').attr('checked') ) {
383 top
.restoreSession();
384 $
.post( "../../../library/ajax/amc_misc_data.php",
385 { amc_id
: "patient_edu_amc",
388 patient_id
: <?php
echo htmlspecialchars($pid,ENT_NOQUOTES
); ?
>,
389 object_category
: "form_encounter",
390 object_id
: <?php
echo htmlspecialchars($encounter,ENT_NOQUOTES
); ?
>
395 $
("#provide_sum_pat_flag").click(function() {
396 if ( $
('#provide_sum_pat_flag').attr('checked') ) {
402 top
.restoreSession();
403 $
.post( "../../../library/ajax/amc_misc_data.php",
404 { amc_id
: "provide_sum_pat_amc",
407 patient_id
: <?php
echo htmlspecialchars($pid,ENT_NOQUOTES
); ?
>,
408 object_category
: "form_encounter",
409 object_id
: <?php
echo htmlspecialchars($encounter,ENT_NOQUOTES
); ?
>
414 $
("#trans_trand_care").click(function() {
415 if ( $
('#trans_trand_care').attr('checked') ) {
417 // Enable the reconciliation checkbox
418 $
("#med_reconc_perf").removeAttr("disabled");
422 //Disable the reconciliation checkbox (also uncheck it if applicable)
423 $
("#med_reconc_perf").attr("disabled", true);
424 $
("#med_reconc_perf").removeAttr("checked");
426 top
.restoreSession();
427 $
.post( "../../../library/ajax/amc_misc_data.php",
428 { amc_id
: "med_reconc_amc",
431 patient_id
: <?php
echo htmlspecialchars($pid,ENT_NOQUOTES
); ?
>,
432 object_category
: "form_encounter",
433 object_id
: <?php
echo htmlspecialchars($encounter,ENT_NOQUOTES
); ?
>
438 $
("#med_reconc_perf").click(function() {
439 if ( $
('#med_reconc_perf').attr('checked') ) {
440 var mode
= "complete";
443 var mode
= "uncomplete";
445 top
.restoreSession();
446 $
.post( "../../../library/ajax/amc_misc_data.php",
447 { amc_id
: "med_reconc_amc",
450 patient_id
: <?php
echo htmlspecialchars($pid,ENT_NOQUOTES
); ?
>,
451 object_category
: "form_encounter",
452 object_id
: <?php
echo htmlspecialchars($encounter,ENT_NOQUOTES
); ?
>
457 // $(".deleteme").click(function(evt) { deleteme(); evt.stopPropogation(); });
459 var GotoForm
= function(obj
) {
460 var parts
= $
(obj
).attr("id").split("~");
461 top
.restoreSession();
462 <?php
if ($GLOBALS['concurrent_layout']): ?
>
463 parent
.location
.href
= "<?php echo $rootdir; ?>/patient_file/encounter/view_form.php?formname="+parts
[0]+
"&id="+parts
[1];
465 top
.Main
.location
.href
= "<?php echo $rootdir; ?>/patient_file/encounter/view_form.php?formname="+parts
[0]+
"&id="+parts
[1];